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
06d76118
Commit
06d76118
authored
3 years ago
by
Roberto Susino
Browse files
Options
Downloads
Patches
Plain Diff
Add error calculation in flat-field corr. procedure
parent
dc77a722
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_flat_field.pro
+14
-3
14 additions, 3 deletions
metis_flat_field.pro
with
14 additions
and
3 deletions
metis_flat_field.pro
+
14
−
3
View file @
06d76118
function
metis_flat_field
,
data
,
header
,
cal_pack
,
history
=
history
function
metis_flat_field
,
data
,
header
,
cal_pack
,
error
=
error
,
quality_matrix
=
quality_matrix
,
history
=
history
journal
,
'Flat-field correction:'
...
...
@@ -6,11 +6,13 @@ function metis_flat_field, data, header, cal_pack, history = history
ff_info
=
cal_pack
.
vl_channel
.
flat_field
ff_image
=
readfits
(
cal_pack
.
path
+
ff_info
.
file_name
,
/
silent
)
ff_error
=
readfits
(
cal_pack
.
path
+
ff_info
.
file_name
,
exten_no
=
1
,
/
silent
)
ff_file
=
ff_info
.
file_name
first_row
=
header
.
ref_rows
eq
'Included'
?
2
:
0
detector_size
=
cal_pack
.
vl_channel
.
detector_size
.
value
ff_image
=
ff_image
[
*,
first_row
:
first_row
+
detector_size
-
1
]
ff_error
=
ff_error
[
*,
first_row
:
first_row
+
detector_size
-
1
]
journal
,
' VL ref. rows = '
+
header
.
ref_rows
.
tolower
()
endif
...
...
@@ -18,19 +20,28 @@ function metis_flat_field, data, header, cal_pack, history = history
if
header
.
filter
.
contains
(
'UV'
,
/
fold
)
then
begin
ff_info
=
cal_pack
.
uv_channel
.
flat_field
nbin
=
sqrt
(
header
.
nbin
)
i
=
where
(
ff_info
.
nbin
eq
nbin
)
i
=
where
(
ff_info
.
nbin
eq
sqrt
(
header
.
nbin
))
ff_image
=
readfits
(
cal_pack
.
path
+
ff_info
[
i
].
file_name
,
/
silent
)
;
WARN
-
flat
field
for
the
uv
channel
must
still
be
provided
ff_error
=
ff_image
*
0
.
ff_file
=
ff_info
[
i
].
file_name
endif
;
WARN
-
error
for
binning
must
be
checked
ff_nobin
=
ff_image
ff_image
=
rebin
(
ff_image
,
header
.
naxis1
,
header
.
naxis2
)
ff_error
=
ff_image
*
sqrt
(
rebin
((
ff_error
/
ff_nobin
)
^
2
,
header
.
naxis1
,
header
.
naxis2
)
/
header
.
nbin
)
mask
=
where
(
ff_image
le
0
.)
ff_image
[
mask
]
=
1
.
data
=
data
/
ff_image
data
[
mask
]
=
0
.
if
isa
(
error
)
then
error
+=
(
ff_error
/
ff_image
)
^
2
if
~
isa
(
history
)
then
history
=
!
null
history
=
[
history
,
'Flat-field correction: '
,
' '
+
ff_file
]
...
...
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