Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
L2 pipelines
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Metis scientific pipeline
L2 pipelines
Commits
a72c5e3e
Commit
a72c5e3e
authored
3 years ago
by
Roberto Susino
Browse files
Options
Downloads
Patches
Plain Diff
Update UVDA dark selection procedure
parent
807a3e87
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
metis_dark_uvda.pro
+58
-6
58 additions, 6 deletions
metis_dark_uvda.pro
with
58 additions
and
6 deletions
metis_dark_uvda.pro
+
58
−
6
View file @
a72c5e3e
function
m_angle_uv
,
matrix
a
=
mean
(
matrix
[
10
:
45
,
10
:
45
])
b
=
mean
(
matrix
[
980
:
1014
,
10
:
45
])
c
=
mean
(
matrix
[
10
:
45
,
980
:
1014
])
d
=
mean
(
matrix
[
980
:
1014
,
980
:
1014
])
return
,
[
a
,
b
,
c
,
d
]
end
function
m_center_uv
,
matrix
a
=
mean
(
matrix
[
454
:
574
,
460
:
582
])
return
,
a
end
function
correzione_uvda
,
image
,
dark
ima_ndit1
=
rebin
(
image
,
1024
,
1024
,
/
sample
)
ima_ndit2
=
rebin
(
dark
,
1024
,
1024
,
/
sample
)
x
=
[
m_angle_uv
(
ima_ndit2
),
m_center_uv
(
ima_ndit2
)]
y
=
[
m_angle_uv
(
ima_ndit1
),
m_center_uv
(
ima_ndit1
)]
r
=
linfit
(
x
,
y
,
yfit
=
yfit
)
ima
=
r
[
0
]
+
ima_ndit2
*
r
[
1
]
s
=
size
(
image
)
ima
=
rebin
(
ima
,
s
[
1
],
s
[
2
])
return
,
ima
end
function
metis_dark_uvda
,
data
,
header
,
cal_pack
,
error
=
error
,
quality_matrix
=
quality_matrix
,
history
=
history
dark
=
cal_pack
.
uv_channel
.
dark
...
...
@@ -24,11 +59,27 @@ function metis_dark_uvda, data, header, cal_pack, error = error, quality_matrix
for
i
=
0
,
n_elements
(
dark
)
-
1
do
begin
if
$
(
dark
[
i
].
dit
eq
dit
)
and
$
(
dark
[
i
].
ndit1
eq
ndit1
)
and
$
(
dark
[
i
].
ndit2
eq
ndit2
)
and
$
(
abs
(
dark
[
i
].
tsensor
-
tsensor
)
lt
5
)
and
$
(
flag_use_notfullset
or
dark
[
i
].
fullset
)
and
$
(
dark
[
i
].
extrapol
eq
'False'
)
then
$
obt_available
=
[
obt_available
,
dark
[
i
].
obt_beg
]
endfor
;
if
not
,
search
for
extrapolated
dark
matrices
with
same
parameters
if
~
isa
(
obt_available
)
and
flag_use_extrapolated
then
begin
for
i
=
0
,
n_elements
(
dark
)
-
1
do
begin
if
$
(
dark
[
i
].
dit
eq
dit
)
and
$
(
dark
[
i
].
ndit1
eq
ndit1
)
and
$
(
dark
[
i
].
ndit2
eq
ndit2
)
and
$
(
abs
(
dark
[
i
].
tsensor
-
tsensor
)
lt
5
)
and
$
(
dark
[
i
].
ndit1
eq
ndit1
)
and
(
dark
[
i
].
ndit2
eq
ndit2
)
and
$
flag_use_notfullset
and
flag_use_extrapolated
then
$
(
flag_use_notfullset
or
dark
[
i
].
fullset
)
and
$
(
dark
[
i
].
extrapol
eq
'True'
)
then
$
obt_available
=
[
obt_available
,
dark
[
i
].
obt_beg
]
endfor
endif
;
if
not
,
exit
with
error
code
if
~
isa
(
obt_available
)
then
begin
...
...
@@ -48,9 +99,6 @@ function metis_dark_uvda, data, header, cal_pack, error = error, quality_matrix
dark_file
=
dark
[
i
].
filename
.
cnt_1
[
obj_cnt
-
1
]
else
$
dark_file
=
dark
[
i
].
filename
.
cnt_2
;
apply
normalization
if
required
if
flag_normalize_dark
and
masking
.
contains
(
'disabled'
,
/
fold
)
then
$
dark_image
=
correzione_uvda
(
data
,
cal_pack
.
path
+
dark_file
)
else
$
dark_image
=
float
(
readfits
(
cal_pack
.
path
+
dark_file
,
/
silent
))
dark_nobin
=
dark_image
...
...
@@ -59,6 +107,10 @@ function metis_dark_uvda, data, header, cal_pack, error = error, quality_matrix
dark_image
=
rebin
(
dark_image
,
header
.
naxis1
,
header
.
naxis2
)
*
nbin
dark_image
=
dark_image
*
ndit1
*
ndit2
;
apply
normalization
if
required
if
flag_normalize_dark
and
masking
.
contains
(
'disabled'
,
/
fold
)
then
$
dark_image
=
correzione_uvda
(
data
,
dark_image
)
mask
=
where
(
data
eq
0
.,
count
)
data
=
data
-
dark_image
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment