;docformat = 'rst rst' ;+ ; This function takes as input the the retrieved C (ozone column density), sigma, and rayleigh ; nadir profiles from a given CIPS orbit and makes a determination if the data are good ; or bad, based on screening for either negative values or NaN's in these background ; parameters. ; ; :Author: ; Jerry Lumpe, Bill Barrett ;- ;+ ; :Params: ; cden: in, required, type=object array ; Retrieved Ozone column density profile. ; sig: in, required, type=object array ; Retrieved Scale height ratio profile. ; nadir: in, required, type=object array ; Retrieved nadir rayleigh profile ; ; :Returns: ; An empty string ('') if the data is good. ; If the data is not good, either the string ; 'column_density', 'sigma', or 'nadir' depending ; on which parameter was flagged as bad. ;- function screen_l2,cden,sig,nadir ; Get the number of ozone column density profiles d=size(cden) niter=d[2] ; Three or more negative values cause the data to be rejected nmin_neg=3 ; Any NaN's cause the data to be rejected nmin_nan=0 error_msg = ['column_density', 'sigma', 'nadir'] for iter=0,niter-1 do begin for i = 0, 2 do begin case i of ; Ozone column density profile 0: temp = cden ; Scale height ratio profile 1: temp = sig ; nadir rayleigh profile 2: temp = nadir endcase ; How many array elements were negative? neg=where(temp[*,iter] lt 0,n_neg) ; Any NaN's in the array nan=where(finite(temp[*,iter]) ne 1, n_nan) ; Flag the data as bad if any of the rejection criteria are triggered ; and exit immediately if n_nan ne nmin_nan || n_neg ge nmin_neg then return, error_msg[i] endfor endfor ; This line is reached only if none of the rejection criteria are triggered return, '' end