Commit 4c4dc5a7 authored by Ian Boyd's avatar Ian Boyd
Browse files

Upload New File

parent 471a2808
PRO read_2110,filename, meas ,ndscheader=ndscheader
; Read NDSC NASA-Ames 2110 and returns meas structure.
; Modification history:
; 2005-07-27: Original by BoBo (bojan.bojkov@gsfc.nasa.gov)
; 2005-10-05: Adapted by TL (leblanc@tmf.jpl.nasa.gov) for multiple NDSC stations: routine is now PI dependent
if keyword_set(ndscheader) then ndscheader=ndscheader else ndscheader=''
EX_RD2110, filename, xname=xname, xvalues=xvals $ ; Read LIDAR file:
, yname=yname, yvalues=yvals $
, vname=vname, data=dat, vmiss=vmiss $
, aname=aname, auxdat=auxdat, amiss=amiss $
, n_dimens=n_dimens, nauxv=nauxv, err=err $
, oname=oname,sname=sname,org=org,mname=mname $
, date=date, mod_date=mod_date $
, spec_comments=scom, norm_comments=ncom $
, ndscheader=ndscheader
if n_elements(ncom) eq 0 then ncom='' ; no of normal comment lines in AMES header
if n_elements(scom) eq 0 then scom='' ; no of special comment lines in AMES header
n_profiles = N_ELEMENTS(auxdat[*, 0]) & PRINT, 'No. of profiles in the file: ', n_profiles ; no of datasets
n_levels = REFORM(auxdat[*, 0])
n_columns = n_elements(dat(0,*))
pi=strmid(filename,strlen(filename)-3,3) & if strupcase(pi) eq 'MLO' or strupcase(pi) eq 'TMF' or strupcase(pi) eq 'TMO' then pi='mdl'
mjd0 = INDGEN(n_profiles, /DOUBLE) & mjd1=mjd0 & mjd2=mjd0
if pi eq 'mgl' then begin ; GSFC (STROZ, McGee)
time_int = REFORM(auxdat[*,6]) ; Integration time
FOR i = 0, n_profiles-1 DO begin
mjd0[i] = JULIAN_DATE(REFORM(auxdat[i,1:5]), /M) ; datetime
mjd1[i] = mjd0[i]-time_int[i]/24.D0 ; start time NOTE: this is a simplification of the real meas. config.
mjd2[i] = mjd0[i]+time_int[i]/24.D0 ; end time NOTE: this is a simplification of the real meas. config.
endfor
lat = REFORM(auxdat[*,7]) &
lon = REFORM(auxdat[*,8]) & lon(*)=-155.6D ; !!! needs fixing in input STROZ file !!!
alt = REFORM(auxdat[*,9])*1000.D0 ; convert to m
endif else if pi eq 'mdl' then begin ; JPL (MLO,TMF, McDermid)
time_int = REFORM(auxdat[*,8]) ; Integration time
FOR i = 0, n_profiles-1 DO begin
mjd0[i] = JULIAN_DATE(reform(auxdat[i,1:5]), /M) ; datetime
mjd2[i] = JULIAN_DATE([reform(auxdat[i,1:3]),reform(auxdat[i,6:7])], /M) ; end time
mjd1[i] = 4*mjd0[i] - 3*mjd2[i] + time_int[i]/24.d0 ; start time (weighted from datetime, endtime, and time_int)
endfor
lon = REFORM(auxdat[*,10]) & for i = 0, n_profiles-1 do if lon[i] gt 180. then lon[i]=lon[i]-360. ; Forcing to range [-180,180]
lat = REFORM(auxdat[*,9])
alt = REFORM(auxdat[*,11])
endif else if pi eq 'nal' then begin ; NIES (Tsukuba, Nakane)
time_int = REFORM(auxdat[*,8]) ; Integration time
FOR i = 0, n_profiles-1 DO begin
mjd2[i] = JULIAN_DATE(reform(auxdat[i,1:5]), /M) ; stop time
mjd1[i] = mjd2[i]-time_int[i]/24.d0 ; start time
mjd0[i] = mjd2[i]-0.5*time_int[i]/24.d0 ; mean time (not weighted)
endfor
lat = REFORM(auxdat[*, 9])
lon = REFORM(auxdat[*,10])
alt = REFORM(auxdat[*,11])
endif else if pi eq 'sbl' then begin ; DWD (Hohenpeissenberg, Steinbrecht)
time_int = REFORM(auxdat[*,7]) ; Integration time
FOR i = 0, n_profiles-1 DO begin
doy_ut=JulVar(Strjul(strtrim(fix(auxdat[i,1]),2)+'/01/01 00:00:00')+xvals[i]) ; UT date from reported DOY
mjd0[i] = JULIAN_DATE(doy_ut[0:4], /M) ; mean time from DOY (NOTE: poor precision)
mjd1[i] = JULIAN_DATE(reform(auxdat[i,1:5]), /M) ; start time
mjd2[i] = 4./3.*mjd0[i] - 1./3.*mjd1[i] + 1./3.*time_int[i]/24.d0 ; stop time (weighted from datetime, start time, and time_int)
endfor
lat = REFORM(auxdat[*,8])
lon = REFORM(auxdat[*,9])
alt = REFORM(auxdat[*,10])
endif else if pi eq 'swl' then begin ; RIVM (Lauder, Swart)
time_int = REFORM(auxdat[*,8]) ; Integration time
FOR i = 0, n_profiles-1 DO begin
mjd2[i] = JULIAN_DATE(reform(auxdat[i,1:5]), /M) ; stop time
mjd1[i] = mjd2[i]-time_int[i]/24.d0 ; start time
mjd0[i] = mjd2[i]-0.5*time_int[i]/24.d0 ; mean time (not weighted)
endfor
lon = REFORM(auxdat[*,9])
lat = REFORM(auxdat[*,10])
alt = REFORM(auxdat[*,11])
endif else if pi eq 'gol' or pi eq 'anl' or pi eq 'hgl' or pi eq 'hal' then begin ; OHP, ALOMAR (OHP, Andoya, Godin, Ancellet, Hansen)
time_int = REFORM(auxdat[*,6]) ; Integration time
FOR i = 0, n_profiles-1 DO begin
mjd1[i] = JULIAN_DATE(reform(auxdat[i,1:5]), /M) ; start time
mjd2[i] = mjd1[i]+time_int[i]/24.d0 ; stop time
mjd0[i] = mjd1[i]+0.5*time_int[i]/24.d0 ; mean time (not weighted)
endfor
lon = REFORM(auxdat[*,8])
lat = REFORM(auxdat[*,7])
alt = REFORM(auxdat[*,9])
endif
data = INDGEN(N_ELEMENTS(yvals), n_columns+1, /DOUBLE) ; Data: need to merge yvals with data
data[*, 0] = yvals & data[*, 1:n_columns] = dat
meas = { sname : sname, $ ; Assign to structure
ncomments : ncom, $
scomments : scom, $
n_profiles : n_profiles, $
n_levels : n_levels, $
mjd0 : mjd0, $
mjd1 : mjd1, $
mjd2 : mjd2, $
time_int : time_int, $
lat : lat, $
lon : lon, $
alt : alt, $
fill : [ -99999, vmiss], $
data : data }
RETURN
END
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment