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
89cc7f42
Commit
89cc7f42
authored
3 years ago
by
Roberto Susino
Browse files
Options
Downloads
Patches
Plain Diff
Add error calculation in radiometric cal. procedure
parent
06d76118
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_rad_cal.pro
+90
-24
90 additions, 24 deletions
metis_rad_cal.pro
with
90 additions
and
24 deletions
metis_rad_cal.pro
+
90
−
24
View file @
89cc7f42
function
metis_rad_cal
,
data
,
header
,
cal_pack
,
polarimetric
=
polarimetric
,
history
=
history
function
metis_rad_cal
,
data
,
header
,
cal_pack
,
polarimetric
=
polarimetric
,
norad
=
norad
,
error
=
error
,
quality_matrix
=
quality_matrix
,
history
=
history
if
header
.
filter
.
contains
(
'VL'
,
/
fold
)
then
begin
channel
=
cal_pack
.
vl_channel
radiometry
=
channel
.
radiometry
;
NOTE
-
this
is
to
take
into
account
that
calibration
of
polarimetric
images
or
their
combination
,
must
not
include
the
pmp
efficiency
(
0.5
)
since
this
is
included
in
the
demodulation
formulae
unit_factor
=
radiometry
.
msb
.
value
unit_error
=
radiometry
.
msb
.
error
if
keyword_set
(
polarimetric
)
then
pmp_factor
=
2
.
D0
else
pmp_factor
=
1
.
D0
;
NOTE
-
this
is
to
take
into
account
that
calibration
of
polarimetric
images
or
their
combination
,
must
not
include
the
pmp
efficiency
(
0.5
)
since
this
is
already
included
in
the
demodulation
if
keyword_set
(
polarimetric
)
then
pmp_factor
=
2
.
else
pmp_factor
=
1
.
angular_pixel
=
cal_pack
.
vl_channel
.
angular_pixel
.
value
*
header
.
nbin
rad_info
=
cal_pack
.
vl_channel
.
radiometry
[
0
]
units
=
cal_pack
.
vl_channel
.
cal_units
unit_factor
=
rad_info
.
msb
.
value
ndit
=
header
.
ndit
end
if
header
.
filter
.
contains
(
'UV'
,
/
fold
)
then
begin
angular_pixel
=
cal_pack
.
uv_channel
.
angular_pixel
.
value
*
header
.
nbin
rad_info
=
cal_pack
.
uv_channel
.
radiometry
[
0
]
units
=
cal_pack
.
uv_channel
.
cal_units
unit_factor
=
1
.
D0
pmp_factor
=
1
.
D0
channel
=
cal_pack
.
uv_channel
radiometry
=
channel
.
radiometry
unit_factor
=
1
.
unit_error
=
0
.
;
the
pmp
factor
does
not
apply
to
the
uv
channel
pmp_factor
=
1
.
ndit
=
header
.
ndit1
*
header
.
ndit2
endif
rad_factor
=
rad_info
.
rad_response
.
value
*
pmp_factor
*
$
cal_pack
.
instrument
.
pupil_area
.
value
*
$
angular_pixel
*
$
unit_factor
;
read
the
uv
/
vl
ratio
of
the
door
retro
-
illumination
,
to
be
used
as
correction
for
the
optical
efficiency
xposure
=
header
.
dit
/
1000
.
D0
*
ndit
cal_factor
=
1
.
/
rad_factor
/
xposure
efficiency_file
=
radiometry
.
opt_efficiency
.
file_name
efficiency
=
float
(
readfits
(
cal_pack
.
path
+
efficiency_file
,
/
silent
))
data
=
data
*
cal_factor
eff_nobin
=
efficiency
efficiency
=
rebin
(
efficiency
,
header
.
naxis1
,
header
.
naxis2
)
eff_error_file
=
radiometry
.
opt_efficiency
.
error
eff_error
=
float
(
readfits
(
cal_pack
.
path
+
eff_error_file
,
/
silent
))
eff_error
=
efficiency
*
sqrt
(
rebin
((
eff_error
/
eff_nobin
)
^
2
,
header
.
naxis1
,
header
.
naxis2
)
/
header
.
nbin
)
s
=
where
(
efficiency
le
0
.,
count
)
quality_matrix
[
s
]
=
0
;
WARN
-
temporary
patch
to
bypass
efficiency
correction
of
the
uv
channel
;
efficiency_file
=
'not applied'
;
efficiency
=
1
.
endif
angular_pixel
=
channel
.
angular_pixel
.
value
*
header
.
nbin
units
=
channel
.
cal_units
if
~
isa
(
history
)
then
history
=
!
null
history
=
[
history
,
'Radiometric calibration:'
,
' cal. factor = '
+
string
(
cal_factor
,
format
=
'(E8.2)'
)
+
' '
+
units
+
'/DN'
]
history
=
[
history
,
'Radiometric calibration:'
]
journal
,
'Radiometric calibration:'
journal
,
' rad. response = '
+
string
(
rad
_info
.
rad_response
.
value
,
format
=
'(F0)'
)
+
' DN/phot.'
journal
,
' rad. response = '
+
string
(
rad
iometry
.
rad_response
.
value
,
format
=
'(F0)'
)
+
' DN/phot.'
journal
,
' pupil area = '
+
string
(
cal_pack
.
instrument
.
pupil_area
.
value
,
format
=
'(F0)'
)
+
' cm²'
journal
,
' pixel solid angle = '
+
string
(
angular_pixel
,
format
=
'(E8.2)'
)
+
' sr'
;
exposure
normalisation
xposure
=
header
.
dit
/
1000
.
D0
*
ndit
cal_factor
=
1
.
/
xposure
cal_error
=
0
.
journal
,
' exposure time = '
+
string
(
xposure
,
format
=
'(F0)'
)
+
' s'
journal
,
' pmp corr. factor = '
+
string
(
pmp_factor
,
format
=
'(F0)'
)
if
keyword_set
(
norad
)
then
begin
history
=
[
history
,
' exposure normalisation only'
]
journal
,
' total cal. factor = exposure normalisation only'
endif
else
begin
;
radiometric
factor
rad_factor
=
radiometry
.
rad_response
.
value
*
$
cal_pack
.
instrument
.
pupil_area
.
value
*
$
angular_pixel
*
$
unit_factor
*
$
pmp_factor
cal_factor
=
cal_factor
/
rad_factor
cal_error
=
sqrt
((
radiometry
.
rad_response
.
error
/
radiometry
.
rad_response
.
value
)
^
2
+
(
cal_pack
.
instrument
.
pupil_area
.
error
/
cal_pack
.
instrument
.
pupil_area
.
value
)
^
2
+
(
channel
.
angular_pixel
.
error
/
channel
.
angular_pixel
.
value
)
^
2
+
(
unit_error
/
unit_factor
)
^
2
)
history
=
[
history
,
' cal. factor = '
+
string
(
cal_factor
,
format
=
'(E8.2)'
)
+
' '
+
units
+
'/DN'
]
journal
,
' total cal. factor = '
+
string
(
cal_factor
,
format
=
'(E8.2)'
)
+
' '
+
units
+
'/DN'
journal
,
' cal. factor error = '
+
string
(
cal_error
,
format
=
'(E8.2)'
)
+
' '
+
units
+
'/DN'
endelse
;
radiometric
calibration
data
=
data
*
cal_factor
if
isa
(
error
)
then
error
+=
cal_error
^
2
if
header
.
filter
.
contains
(
'UV'
,
/
fold
)
then
begin
;
efficiency
correction
data
=
data
/
abs
(
efficiency
)
if
isa
(
error
)
then
error
+=
(
eff_error
/
efficiency
)
^
2
history
=
[
history
,
' efficiency corr. map = '
+
efficiency_file
]
journal
,
' UV efficiency corr. map = '
+
efficiency_file
endif
return
,
data
end
\ No newline at end of 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