Skip to content

Commit

Permalink
Add instrument-specific bias correction to setup, addressing ORAC-CC#44
Browse files Browse the repository at this point in the history
  • Loading branch information
adamcpovey committed Mar 10, 2021
1 parent e824e3d commit 0390872
Show file tree
Hide file tree
Showing 7 changed files with 132 additions and 49 deletions.
3 changes: 3 additions & 0 deletions pre_processing/allocate_channel_info.F90
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,7 @@ subroutine allocate_channel_info(channel_info)
allocate(channel_info%channel_fm_sea_uncertainty( &
channel_info%nchannels_total))

allocate(channel_info%channel_absolute_bias(channel_info%nchannels_total))
allocate(channel_info%channel_relative_bias(channel_info%nchannels_total))

end subroutine allocate_channel_info
5 changes: 5 additions & 0 deletions pre_processing/channel_structures.F90
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
! 2016/07/01, GT: Added map_ids_sw_to_channel and map_ids_lw_to_channel.
! 2016/08/04, GM: Added map_ids_channel_to_sw and map_ids_channel_to_lw.
! 2017/07/05, AP: Add NAll to track the total number of channels.
! 2021/03/09, AP: Add radiance bias corrections.
!
! Bugs:
! None known.
Expand Down Expand Up @@ -98,6 +99,10 @@ module channel_structures_m
real(kind=sreal), dimension(:), pointer :: channel_fm_lnd_uncertainty
real(kind=sreal), dimension(:), pointer :: channel_fm_sea_uncertainty

! Bias correction for each channel
real(kind=sreal, dimension(:), pointer :: channel_absolute_bias
real(kind=sreal, dimension(:), pointer :: channel_relative_bias

end type channel_info_t

contains
Expand Down
2 changes: 2 additions & 0 deletions pre_processing/deallocate_channel_info.F90
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ subroutine deallocate_channel_info(channel_info)
deallocate(channel_info%channel_minimum_uncertainty)
deallocate(channel_info%channel_fm_lnd_uncertainty)
deallocate(channel_info%channel_fm_sea_uncertainty)
deallocate(channel_info%channel_absolute_bias)
deallocate(channel_info%channel_relative_bias)
deallocate(channel_info%sw_rttov_viewone_id)
deallocate(channel_info%sw_view_ids)
deallocate(channel_info%lw_rttov_viewone_id)
Expand Down
11 changes: 10 additions & 1 deletion pre_processing/read_imager.F90
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
! instead of IMPF (as previous). The new driver file option
! USE_GSICS enables this to be disabled.
! 2018/06/08, SP: New global attribute to store satellite position information
! 2019/8/14, SP: Add Fengyun-4A support.
! 2019/08/14, SP: Add Fengyun-4A support.
! 2021/03/09, AP: Add radiance bias corrections.
!
! Bugs:
! None known.
Expand Down Expand Up @@ -255,7 +256,15 @@ subroutine read_imager(sensor, platform, path_to_l1b_file, path_to_geo_file, &
stop error_stop_code
end if

! Bias correction (these are defined in the appropriate setup.F90 routine)
do k = 1, channel_info%nchannels_total
imager_measurements%data(:,:,k) = channel_info%channel_absolute_bias(k) + &
channel_info%channel_relative_bias(k) * &
imager_measurements%data(:,:,k)
end do

! Estimate measurement uncertainty
! NOTE: Doing this here as instruments will eventually provide L1 uncs
do k = 1, channel_info%nchannels_total
do j = 1, imager_geolocation%ny
do i = imager_geolocation%startx, imager_geolocation%endx
Expand Down
23 changes: 0 additions & 23 deletions pre_processing/read_slstr.F90
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,6 @@ module read_slstr_m

implicit none

! The calibration of SLSTR is under ongoing revisions, such that the
! application of empirical correction factors is currently required.
! These are taken from the SLSTR User Guide and/or personal communications.
real, parameter :: slstr_correction_factor(18) = [ &
0.95, & ! Ch1
-1.0, & ! Ch2
-1.0, & ! Ch3
-1.0, & ! Ch4
1.10, & ! Ch5
1.10, & ! Ch6
-1.0, & ! Ch7
-1.0, & ! Ch8
-1.0, & ! Ch9
0.92, & ! Ch10
0.93, & ! Ch11
0.93, & ! Ch12
-1.0, & ! Ch13
-1.0, & ! Ch14
-1.0, & ! Ch15
-1.0, & ! Ch16
-1.0, & ! Ch17
-1.0 ] ! Ch18

contains

! When defined, the offset between the nadir and oblique views is assumed
Expand Down
8 changes: 1 addition & 7 deletions pre_processing/read_slstr_main.F90
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,7 @@ subroutine read_slstr(infile, imager_geolocation, imager_measurements, &
stop error_stop_code
end if

! Apply some correction factors
if (slstr_correction_factor(band_ids(i)) .gt. 0.0) then
imager_measurements%data(:,:,i) = imager_measurements%data(:,:,i) * &
slstr_correction_factor(band_ids(i))
end if

! Other corrections have previously been applied in this code to minimise
! Corrections have previously been applied in this code to minimise
! problems with the geolocation, dynamic range, and calibration of SLSTR.
! These have been removed at this point, as many are now included in the
! L1B files but may still be necessary for earlier data. The main one is
Expand Down
Loading

0 comments on commit 0390872

Please sign in to comment.