Skip to content
Commits on Source (3)
...@@ -2012,7 +2012,11 @@ bool SeqDataMgr::WaitBLOB(unsigned int timeout) ...@@ -2012,7 +2012,11 @@ bool SeqDataMgr::WaitBLOB(unsigned int timeout)
{ {
U9_LLOG(__FUNCTION__ << " ~ Waiting " << waited_time/1000.f << "/" << timeout/1000.f << "s"); U9_LLOG(__FUNCTION__ << " ~ Waiting " << waited_time/1000.f << "/" << timeout/1000.f << "s");
} }
if(m_getFitsAbortFlag)break; if(m_getFitsAbortFlag)
{
W_LLOG(__FUNCTION__ << " ~ Acquisition aborted by user");
break;
}
if(m_bReceivedEof) if(m_bReceivedEof)
{ {
E_LLOG("Received EOF"); E_LLOG("Received EOF");
......
...@@ -321,7 +321,7 @@ void * SeqSetup::init_calibration_control(void * arg) ...@@ -321,7 +321,7 @@ void * SeqSetup::init_calibration_control(void * arg)
} }
catch(...) catch(...)
{ {
E_LLOG("Could not move CAL_FIBER_DEPT to HOME"); E_LLOG("Could not move CAL_FIBER_DEP to HOME");
SeqISetupLogBoostDiagnosticInformation(__LINE__); SeqISetupLogBoostDiagnosticInformation(__LINE__);
} }
U8_LLOG(__FUNCTION__ << " ~ m_calunit_initialized = " << me.m_calunit_initialized); U8_LLOG(__FUNCTION__ << " ~ m_calunit_initialized = " << me.m_calunit_initialized);
......
...@@ -2573,7 +2573,7 @@ Ice::Int SequencerI::setContext(const dictSetupNamedPos & _osContext, const Ice: ...@@ -2573,7 +2573,7 @@ Ice::Int SequencerI::setContext(const dictSetupNamedPos & _osContext, const Ice:
std::map<std::string, std::string>::const_iterator itSetup; std::map<std::string, std::string>::const_iterator itSetup;
for(itSetup = _osContext.begin(); itSetup != _osContext.end(); itSetup++) for(itSetup = _osContext.begin(); itSetup != _osContext.end(); itSetup++)
{ {
U9_LLOG("Keyword : " << std::setfill('_') << std::setw(16) << itSetup->first << "; Value : " << std::setw(60) << itSetup->second); U9_LLOG("Keyword : " << std::setfill('_') << std::setw(16) << itSetup->first << "; Value : " << std::setw(70) << itSetup->second);
} }
try try
{ {
......
...@@ -74,6 +74,7 @@ class SetupObject(object): ...@@ -74,6 +74,7 @@ class SetupObject(object):
content = xmltodict.parse(xml_file)["ReferenceSetup"] content = xmltodict.parse(xml_file)["ReferenceSetup"]
content["filename"] = str(filename) content["filename"] = str(filename)
else: else:
#print(xml_file)
content = xmltodict.parse(xml_file)["ObservationBlock"]#["Template"] content = xmltodict.parse(xml_file)["ObservationBlock"]#["Template"]
content["filename"] = str(filename) content["filename"] = str(filename)
todos.append(content) todos.append(content)
...@@ -111,19 +112,19 @@ class DocObject(object): ...@@ -111,19 +112,19 @@ class DocObject(object):
def todos(self): def todos(self):
todos = [] todos = []
filenames = self.path.glob("*"+self.ext) filenames = self.path.glob("*"+self.ext)
for filename in sorted(filenames): for filename in sorted(filenames):
with open(str(filename)) as xml_file: with open(str(filename)) as xml_file:
content = xmltodict.parse(xml_file)["doc"] content = xmltodict.parse(xml_file)["doc"]
content["filename"] = str(filename) content["filename"] = str(filename)
todos.append(content) todos.append(content)
return todos return todos
def read(self, name): def read(self, name):
for item in self.todos: for item in self.todos:
if item["filename"] == str(self.path / (name+self.ext)): if item["filename"] == str(self.path / (name+self.ext)):
return item["description"] return item["description"]
...@@ -217,6 +218,7 @@ class SetupObject(object): ...@@ -217,6 +218,7 @@ class SetupObject(object):
content = xmltodict.parse(xml_file)["ReferenceSetup"] content = xmltodict.parse(xml_file)["ReferenceSetup"]
content["filename"] = str(filename) content["filename"] = str(filename)
else: else:
print(xml_file)
content = xmltodict.parse(xml_file)["ObservationBlock"]#["Template"] content = xmltodict.parse(xml_file)["ObservationBlock"]#["Template"]
content["filename"] = str(filename) content["filename"] = str(filename)
todos.append(content) todos.append(content)
...@@ -236,11 +238,11 @@ class SetupObject(object): ...@@ -236,11 +238,11 @@ class SetupObject(object):
for item in self.todos: for item in self.todos:
if "ref" in str(self.path): if "ref" in str(self.path):
if item["filename"] == str(self.path / (name+self.ext)): if item["filename"] == str(self.path / (name+self.ext)):
print("ref file: "+str(self.path / (name+self.ext))) print("ref file: "+str(self.path / (name+self.ext)))
return item return item
else: else:
if item["filename"] == str(self.path / (name+self.ext)): if item["filename"] == str(self.path / (name+self.ext)):
print("def file: "+str(self.path / (name+self.ext))) print("def file: "+str(self.path / (name+self.ext)))
return item return item
def content(self, name): def content(self, name):
......
...@@ -377,10 +377,20 @@ class RtcObject(object): ...@@ -377,10 +377,20 @@ class RtcObject(object):
return status return status
def flatten(self): def flatten(self):
modes = [0] * 96#39 try:
status = self.obsController.RTCTTModeUpload(modes, absolute=True) mode = ufun.get_status_by_name(self.obsController, ['rtc_dm_mode'])[0]
status = self.load_ncpa(name="zeri.txt") if mode == "ZONAL":
return status print("detected ZONAL")
modes = [0] * 99
status = self.obsController.RTCTTModeUpload(modes, absolute=True)
elif mode=="MODAL":
modes = [0] * 39
status = self.obsController.RTCTTModeUpload(modes, absolute=True)
status = self.load_ncpa(name="zeri.txt")
return status
except Exception as e:
print(e)
def close_loop(self): def close_loop(self):
status = self.obsController.RTCTTCloseLoop() status = self.obsController.RTCTTCloseLoop()
...@@ -675,7 +685,7 @@ class RtcObject(object): ...@@ -675,7 +685,7 @@ class RtcObject(object):
riservati = [0,0] riservati = [0,0]
sign = -1 # rotation direction sign = -1 # rotation direction
sleep = 5#10 sleep = 5#10
threshold = 0.5 threshold = 0.3#0.5
ins_s = {"DROT":-9999} ins_s = {"DROT":-9999}
angle_where_ncpa_was_optimized = float(self.obsController.getPosition("DEGREE", ins_s)[1]["DROT"]) angle_where_ncpa_was_optimized = float(self.obsController.getPosition("DEGREE", ins_s)[1]["DROT"])
......
alignment @ 4c818cbf
Subproject commit 5aa3f7e962d60ce9a2ffa9ca37286a919a095bfc Subproject commit 4c818cbf246bf9374b0908bad68a599c37d79acf
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
<InstrumentSetup> <InstrumentSetup>
<!-- <ADC_Mode>OFF</ADC_Mode> --> <!-- <ADC_Mode>OFF</ADC_Mode> -->
<STEPS>11</STEPS> <STEPS>11</STEPS>
<SCI_FILT_W1>HOLE<SCI_FILT_W1> <SCI_FILT_W1>HOLE</SCI_FILT_W1>
<SCI_FILT_W2>HOLE<SCI_FILT_W2> <SCI_FILT_W2>HOLE</SCI_FILT_W2>
</InstrumentSetup> </InstrumentSetup>
<TelescopeSetup> <TelescopeSetup>
......
...@@ -125,10 +125,10 @@ class SHARKNIR_cal_Flux_MaskRemoval(SHINSApp): ...@@ -125,10 +125,10 @@ class SHARKNIR_cal_Flux_MaskRemoval(SHINSApp):
meaned = np.mean(np.asarray(im_arr), 0) meaned = np.mean(np.asarray(im_arr), 0)
saly.PSFNoCoro.LoadImage(meaned) saly.PSFNoCoro.LoadImage(meaned)
saly.PSFNoCoro.removeHotPixels(verbose=True) saly.PSFNoCoro.removeHotPixels(verbose=True)
saly.PSFNoCoro.calculate_bkg() #saly.PSFNoCoro.calculate_bkg()
self.tpl_output = { self.tpl_output = {
uvars.tpl_output_names["sasha_flux"] : np.round(saly.PSFNoCoro.flux, 2), #uvars.tpl_output_names["sasha_flux"] : np.round(saly.PSFNoCoro.flux, 2),
uvars.tpl_output_names["sasha_max"] : np.max(saly.PSFNoCoro.image), uvars.tpl_output_names["sasha_max"] : np.max(saly.PSFNoCoro.image),
uvars.tpl_output_names["sasha_min"] : np.min(saly.PSFNoCoro.image) uvars.tpl_output_names["sasha_min"] : np.min(saly.PSFNoCoro.image)
} }
...@@ -185,7 +185,7 @@ class SHARKNIR_gen_tec_PupilLyotAlignment(SHINSApp): ...@@ -185,7 +185,7 @@ class SHARKNIR_gen_tec_PupilLyotAlignment(SHINSApp):
LBTCYarr = [] LBTCYarr = []
internal_circle = True internal_circle = True
rmin, rmax = 35, 45 if internal_circle else 335, 345 rmin, rmax = [35, 45] if internal_circle else [335, 345]
while nIteration < maxIteration and not converged: while nIteration < maxIteration and not converged:
......