RH[ind]
return, RHcorr
end
; *****************************************************************************
; *****************************************************************************
function empircorr_day, RH, P, altang
; Written by Larry Miloshevich. Released March 2009.
; Apply the empirical bias correction of Miloshevich et al. [2009] to DAYTIME
; measurements from Vaisala RS92 (or RS90) radiosondes.
;
; CALL: RH_corrected = empircorr_day(RH, P, altang)
;
; RH: 1-D array of RH measurements (ideally time-lag-corrected...see below).
; P: Corresponding array of pressure measurements (mb).
; altang: Corresponding array of solar altitude angle (degrees).
;
; CAUTION: THE DAYTIME CORRECTION WILL OVERCORRECT IN CLOUDS AND IS
; NOT RECOMMENDED FOR DAYTIME CLOUDY CASES. SEE THE PAPER.
;
; NOTE: This correction is intended for RH data that have already been
; corrected for sensor time-lag error [Miloshevich et al., 2004].
; It can be applied to original (uncorrected) RS92 RH measurements with
; full accuracy up to about the -45C level, but results will still
; contain time-lag error in the UT/LS region. See the 2009 paper.
indg = where((P gt -999.) and (RH gt -999.), ngood)
if (ngood eq 0) then return,RH
; Correction Parameters.
; The coefsXX arrays are the F(P) curves for each RH interval from Table 1 and
; Fig. 9 in the paper. coefsS is the stratospheric F(P) curve when P 0. ; no SR corr for nighttime points
RHg = RHgN + sr_error*frac ; add SRE back to nighttime correction
;RHg = RH[indg] + sr_error*frac ; for testing SR corr without CAL corr
;print,'EMPIR: Returning only SR corr and not SR+CAL for daytime soundings'
; Restore full RH array.
RHcorr = RH & RHcorr[indg] = RHg
; RHmax = 100.1 & RHcorr = RHcorr < RHmax
return, RHcorr
end
; *****************************************************************************
; *****************************************************************************
function empircorr, RH, P, altang
; Written by Larry Miloshevich. Released March 2009.
; Apply the empirical bias correction of Miloshevich et al. [2009] to RH
; measurements from Vaisala RS92 (or RS90) radiosondes. This function calls
; the appropriate NIGHTTIME correction, empircorr_night(RH, P), or DAYTIME
; correction, empircorr_day(RH, P, altang), based on the solar altitude angle.
;
; CALL: RH_corrected = empircorr(RH, P, altang)
;
; RH: 1-D array of RH measurements (ideally time-lag-corrected...see below).
; P: Corresponding array of pressure measurements (mb).
; altang: Corresponding array of solar altitude angle (degrees).
;
; CAUTION: THE DAYTIME CORRECTION (altang > 0) WILL OVERCORRECT IN CLOUDS AND
; IS NOT RECOMMENDED FOR DAYTIME CLOUDY CASES. SEE THE PAPER.
;
; NOTE: This correction is intended for RH data that have already been
; corrected for sensor time-lag error [Miloshevich et al., 2004].
; It can be applied to original (uncorrected) RS92 RH measurements with
; full accuracy up to about the -45C level, but results will still
; contain time-lag error in the UT/LS region. See the 2009 paper.
;
; NOTE: The daytime and nighttime corrections can be called individually if
; desired. The altang is not input for nighttime soundings.
daythresang = float(0.) ; Use daytime corr if altang > daythresang
ind = where(altang ge daythresang, nday)
if (nday gt 0) then begin ; DAYTIME CORRECTION
return, empircorr_day(RH, P, altang)
endif else begin ; NIGHTTIME CORRECTION
return, empircorr_night(RH, P)
endelse
end