Skip to content
GitLab
Explore
Sign in
Davide Ricci
SHINS
Compare revisions
ba677dffe852449f9f8722e704cc4d45922dd32e to 42d68024198e92d814156deb5f8c75e18dee7b83
Commits on Source (3)
Template changes for march 21 night
· bd796815
Davide Ricci
authored
Mar 21, 2024
and
Alessandro Lorenzetto
committed
Mar 21, 2024
bd796815
default ob invalid xml corrected
· 5ff21df0
Davide Ricci
authored
Mar 21, 2024
and
Alessandro Lorenzetto
committed
Mar 21, 2024
5ff21df0
obs_ctrl improvements
· 42d68024
Davide Ricci
authored
Mar 21, 2024
and
Alessandro Lorenzetto
committed
Mar 21, 2024
42d68024
Hide whitespace changes
Inline
Side-by-side
src/obs_ctrl/seqIDataMgr.cpp
View file @
42d68024
...
...
@@ -2012,7 +2012,11 @@ bool SeqDataMgr::WaitBLOB(unsigned int timeout)
{
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
)
{
E_LLOG
(
"Received EOF"
);
...
...
src/obs_ctrl/seqISetup.cpp
View file @
42d68024
...
...
@@ -321,7 +321,7 @@ void * SeqSetup::init_calibration_control(void * arg)
}
catch
(...)
{
E_LLOG
(
"Could not move CAL_FIBER_DEP
T
to HOME"
);
E_LLOG
(
"Could not move CAL_FIBER_DEP to HOME"
);
SeqISetupLogBoostDiagnosticInformation
(
__LINE__
);
}
U8_LLOG
(
__FUNCTION__
<<
" ~ m_calunit_initialized = "
<<
me
.
m_calunit_initialized
);
...
...
src/obs_ctrl/sequencerI.cpp
View file @
42d68024
...
...
@@ -2573,7 +2573,7 @@ Ice::Int SequencerI::setContext(const dictSetupNamedPos & _osContext, const Ice:
std
::
map
<
std
::
string
,
std
::
string
>::
const_iterator
itSetup
;
for
(
itSetup
=
_osContext
.
begin
();
itSetup
!=
_osContext
.
end
();
itSetup
++
)
{
U9_LLOG
(
"Keyword : "
<<
std
::
setfill
(
'_'
)
<<
std
::
setw
(
16
)
<<
itSetup
->
first
<<
"; Value : "
<<
std
::
setw
(
6
0
)
<<
itSetup
->
second
);
U9_LLOG
(
"Keyword : "
<<
std
::
setfill
(
'_'
)
<<
std
::
setw
(
16
)
<<
itSetup
->
first
<<
"; Value : "
<<
std
::
setw
(
7
0
)
<<
itSetup
->
second
);
}
try
{
...
...
src/scripts/apis/data_access_object.py
View file @
42d68024
...
...
@@ -74,6 +74,7 @@ class SetupObject(object):
content
=
xmltodict
.
parse
(
xml_file
)[
"
ReferenceSetup
"
]
content
[
"
filename
"
]
=
str
(
filename
)
else
:
#print(xml_file)
content
=
xmltodict
.
parse
(
xml_file
)[
"
ObservationBlock
"
]
#["Template"]
content
[
"
filename
"
]
=
str
(
filename
)
todos
.
append
(
content
)
...
...
@@ -111,19 +112,19 @@ class DocObject(object):
def
todos
(
self
):
todos
=
[]
filenames
=
self
.
path
.
glob
(
"
*
"
+
self
.
ext
)
for
filename
in
sorted
(
filenames
):
with
open
(
str
(
filename
))
as
xml_file
:
content
=
xmltodict
.
parse
(
xml_file
)[
"
doc
"
]
content
[
"
filename
"
]
=
str
(
filename
)
todos
.
append
(
content
)
todos
.
append
(
content
)
return
todos
def
read
(
self
,
name
):
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
"
]
...
...
@@ -217,6 +218,7 @@ class SetupObject(object):
content
=
xmltodict
.
parse
(
xml_file
)[
"
ReferenceSetup
"
]
content
[
"
filename
"
]
=
str
(
filename
)
else
:
print
(
xml_file
)
content
=
xmltodict
.
parse
(
xml_file
)[
"
ObservationBlock
"
]
#["Template"]
content
[
"
filename
"
]
=
str
(
filename
)
todos
.
append
(
content
)
...
...
@@ -236,11 +238,11 @@ class SetupObject(object):
for
item
in
self
.
todos
:
if
"
ref
"
in
str
(
self
.
path
):
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
else
:
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
def
content
(
self
,
name
):
...
...
src/scripts/apis/devices_access_object.py
View file @
42d68024
...
...
@@ -377,10 +377,20 @@ class RtcObject(object):
return
status
def
flatten
(
self
):
modes
=
[
0
]
*
96
#39
status
=
self
.
obsController
.
RTCTTModeUpload
(
modes
,
absolute
=
True
)
status
=
self
.
load_ncpa
(
name
=
"
zeri.txt
"
)
return
status
try
:
mode
=
ufun
.
get_status_by_name
(
self
.
obsController
,
[
'
rtc_dm_mode
'
])[
0
]
if
mode
==
"
ZONAL
"
:
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
):
status
=
self
.
obsController
.
RTCTTCloseLoop
()
...
...
@@ -675,7 +685,7 @@ class RtcObject(object):
riservati
=
[
0
,
0
]
sign
=
-
1
# rotation direction
sleep
=
5
#10
threshold
=
0.5
threshold
=
0.3
#
0.5
ins_s
=
{
"
DROT
"
:
-
9999
}
angle_where_ncpa_was_optimized
=
float
(
self
.
obsController
.
getPosition
(
"
DEGREE
"
,
ins_s
)[
1
][
"
DROT
"
])
...
...
alignment
@
4c818cbf
Subproject commit
5aa3f7e962d60ce9a2ffa9ca37286a919a095bfc
Subproject commit
4c818cbf246bf9374b0908bad68a599c37d79acf
src/scripts/templates/ob/SHARKNIR_cal_tec_NCPA_trial_DBI.xml
View file @
42d68024
...
...
@@ -23,8 +23,8 @@
<InstrumentSetup>
<!-- <ADC_Mode>OFF</ADC_Mode> -->
<STEPS>
11
</STEPS>
<SCI_FILT_W1>
HOLE
<SCI_FILT_W1>
<SCI_FILT_W2>
HOLE
<SCI_FILT_W2>
<SCI_FILT_W1>
HOLE
<
/
SCI_FILT_W1>
<SCI_FILT_W2>
HOLE
<
/
SCI_FILT_W2>
</InstrumentSetup>
<TelescopeSetup>
...
...
src/scripts/templates/tpl/SHARKNIR_cal_Flux_MaskRemoval.py
View file @
42d68024
...
...
@@ -125,10 +125,10 @@ class SHARKNIR_cal_Flux_MaskRemoval(SHINSApp):
meaned
=
np
.
mean
(
np
.
asarray
(
im_arr
),
0
)
saly
.
PSFNoCoro
.
LoadImage
(
meaned
)
saly
.
PSFNoCoro
.
removeHotPixels
(
verbose
=
True
)
saly
.
PSFNoCoro
.
calculate_bkg
()
#
saly.PSFNoCoro.calculate_bkg()
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_min
"
]
:
np
.
min
(
saly
.
PSFNoCoro
.
image
)
}
src/scripts/templates/tpl/SHARKNIR_gen_tec_PupilLyotAlignment.py
View file @
42d68024
...
...
@@ -185,7 +185,7 @@ class SHARKNIR_gen_tec_PupilLyotAlignment(SHINSApp):
LBTCYarr
=
[]
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
:
...
...