! $Id$ ! ! --- !====================================================================== ! Apply the reflectance coefficients to produce a reflectance !====================================================================== subroutine REF_CAL(Num_Scans_Read) integer, intent(in):: Num_Scans_Read integer:: iline !--- channel 1 where (Chan_Counts_Avhrr(1,:,:) <= Ch1_Switch_Count_Cal) Ref_Ch1 = Ch1_Gain_low*(Chan_Counts_Avhrr(1,:,:) - Ch1_Dark_Count_Cal) elsewhere Ref_Ch1 = Ref_Ch1_Switch + Ch1_Gain_High*(Chan_Counts_Avhrr(1,:,:) - Ch1_Switch_Count_Cal) end where !--- channel 2 where (Chan_Counts_Avhrr(2,:,:) <= Ch2_Switch_Count_Cal) Ref_Ch2 = Ch2_Gain_low*(Chan_Counts_Avhrr(2,:,:) - Ch2_Dark_Count_Cal) elsewhere Ref_Ch2 = Ref_Ch2_Switch + Ch2_Gain_High*(Chan_Counts_Avhrr(2,:,:) - Ch2_Switch_Count_Cal) end where !--- channel 3a where (Chan_Counts_Avhrr(3,:,:) <= Ch3a_Switch_Count_Cal) Ref_Ch6 = Ch3a_Gain_low*(Chan_Counts_Avhrr(3,:,:) - Ch3a_Dark_Count_Cal) elsewhere Ref_Ch6 = Ref_Ch6_Switch + Ch3a_Gain_High*(Chan_Counts_Avhrr(3,:,:) - Ch3a_Switch_Count_Cal) end where do iline = Line_Idx_Min_Segment,Line_Idx_Min_Segment + Num_Scans_Read - 1 !--- check for a bad scan, if so then skip if (Bad_Scan_Flag(iline) == sym%YES) then Ref_Ch1(:,iline) = Missing_Value_Real4 Ref_Ch2(:,iline) = Missing_Value_Real4 Ref_Ch6(:,iline) = Missing_Value_Real4 endif !--- set Ref_Ch6 to missing for Ch3a = off if (Ch3a_On(iline) == sym%NO) then Ref_Ch6(:,iline) = Missing_Value_Real4 endif enddo end subroutine REF_CAL