Skip to content. | Skip to navigation

Personal tools
You are here: GES DISC Home AIRS Documentation read_L3_pro.txt

read_L3_pro.txt

;===============================================================
; PROGRAM: read_L3.pro
;
; DESCRIPTION: Reader for Level 3 Grid files. Written in
; Interactive Data Language (IDL). this reoutine
; reads the AIRS beta Level 3 HDF-EOS Grid product.
;
; HISTORY: March 2004 - Original - Stephanie Granger (JPL)
;
; CALL SEQUENCE: read_L3, filename, aord, L3
;
; INPUTS:
; filename: Path/filename of AIRS Level 3 beta standard product
; to be read
; aord: string that specifies whether to return ascending or descending
; products, e.g., 'A' or 'D'
;
; OUTPUT:
; L3: A structure of 6 structures.
;
;================================================================
pro read_L3, filename, aord, L3

fid = eos_gd_open ( filename, /read )
if fid < 0 then stop

; variables used to set up input buffers

numlon = 360
numlat = 180
numTlvl = 28
numHlvl = 13

; -- temperature profile buffer

tbuff = { Level3TprofBuffer, $
counts:fltarr(numlon, numlat, numTlvl), $
mean:fltarr(numlon, numlat, numTlvl) }

; -- water vapor profile buffer

hbuff = { Level3H2OProfBuffer, $
counts:fltarr(numHlvl, numlon, numlat), $
mean:fltarr(numHlvl, numlon, numlat) }

; -- buffer for 2-D parameters

sbuff = { Level3Buffer, $
counts:fltarr(numlon,numlat), $
mean:fltarr(numlon,numlat) }

; -- buffer for output structure of structures

L3 = { Level3, $
totozo:sbuff[0], $
tsurf:sbuff[0], $
tairsurf:sbuff[0], $
tairstd:tbuff[0], $
toth2o:sbuff[0], $
h2ommrstd:hbuff[0] }

CASE aord OF
'A': BEGIN

; ---- totozo ascending

gid = eos_gd_attach ( fid, 'totO3Std_asc' )
ret = eos_gd_readfield ( gid, 'Counts', buffr)
L3.totozo.counts = buffr
if ret ne 0 then stop, ret
ret = eos_gd_readfield ( gid, 'Mean', buffr )
L3.totozo.mean = buffr
if ret ne 0 then stop, ret
ret = eos_gd_detach (gid)

; ---- tsurf ascending

gid = eos_gd_attach ( fid, 'TSurfStd_asc' )
ret = eos_gd_readfield ( gid, 'Counts', buffr)
L3.tsurf.counts = buffr
if ret ne 0 then stop, ret
ret = eos_gd_readfield ( gid, 'Mean', buffr )
L3.tsurf.mean = buffr
if ret ne 0 then stop, ret
ret = eos_gd_detach (gid)

; ---- tairsurf ascending

gid = eos_gd_attach ( fid, 'TSurfAir_asc' )
ret = eos_gd_readfield ( gid, 'Counts', buffr)
L3.tairsurf.counts = buffr
if ret ne 0 then stop, ret
ret = eos_gd_readfield ( gid, 'Mean', buffr )
L3.tairsurf.mean = buffr
if ret ne 0 then stop, ret
ret = eos_gd_detach (gid)

; ---- tairstd ascending

gid = eos_gd_attach ( fid, 'TAirStd_asc' )
ret = eos_gd_readfield ( gid, 'Counts', buffr)
L3.tairstd.counts = buffr
if ret ne 0 then stop, ret
ret = eos_gd_readfield ( gid, 'Mean', buffr )
L3.tairstd.mean = buffr
if ret ne 0 then stop, ret
ret = eos_gd_detach (gid)

; ---- toth2o ascending

gid = eos_gd_attach ( fid, 'totH2OStd_asc' )
ret = eos_gd_readfield ( gid, 'Counts', buffr)
L3.toth2o.counts = buffr
if ret ne 0 then stop, ret
ret = eos_gd_readfield ( gid, 'Mean', buffr )
L3.toth2o.mean = buffr
if ret ne 0 then stop, ret
ret = eos_gd_detach (gid)

; ---- h2ommrstd ascending

gid = eos_gd_attach ( fid, 'H2OMMRStd_asc' )
ret = eos_gd_readfield ( gid, 'Counts', buffr)
L3.h2ommrstd.counts = buffr
if ret ne 0 then stop, ret
ret = eos_gd_readfield ( gid, 'Mean', buffr )
L3.h2ommrstd.mean = buffr
if ret ne 0 then stop, ret
ret = eos_gd_detach (gid)

END ; Ascending

'D': BEGIN ; Descending

; ---- totozo descending

gid = eos_gd_attach ( fid, 'totO3Std_desc' )
ret = eos_gd_readfield ( gid, 'Counts', buffr)
L3.totozo.counts = buffr
if ret ne 0 then stop, ret
ret = eos_gd_readfield ( gid, 'Mean', buffr )
L3.totozo.mean = buffr
if ret ne 0 then stop, ret
ret = eos_gd_detach (gid)

; ---- tsurf descending

gid = eos_gd_attach ( fid, 'TSurfStd_desc' )
ret = eos_gd_readfield ( gid, 'Counts', buffr)
L3.tsurf.counts = buffr
if ret ne 0 then stop, ret
ret = eos_gd_readfield ( gid, 'Mean', buffr )
L3.tsurf.mean = buffr
if ret ne 0 then stop, ret
ret = eos_gd_detach (gid)

; ---- tairsurf descending

gid = eos_gd_attach ( fid, 'TSurfAir_desc' )
ret = eos_gd_readfield ( gid, 'Counts', buffr)
L3.tairsurf.counts = buffr
if ret ne 0 then stop, ret
ret = eos_gd_readfield ( gid, 'Mean', buffr )
L3.tairsurf.mean = buffr
if ret ne 0 then stop, ret
ret = eos_gd_detach (gid)


; ---- tairstd descending

gid = eos_gd_attach ( fid, 'TAirStd_desc' )
ret = eos_gd_readfield ( gid, 'Counts', buffr)
L3.tairstd.counts = buffr
if ret ne 0 then stop, ret
ret = eos_gd_readfield ( gid, 'Mean', buffr )
L3.tairstd.mean = buffr
if ret ne 0 then stop, ret
ret = eos_gd_detach (gid)

; ---- toth2o descending

gid = eos_gd_attach ( fid, 'totH2OStd_desc' )
ret = eos_gd_readfield ( gid, 'Counts', buffr)
L3.toth2o.counts = buffr
if ret ne 0 then stop, ret
ret = eos_gd_readfield ( gid, 'Mean', buffr )
L3.toth2o.mean = buffr
if ret ne 0 then stop, ret
ret = eos_gd_detach (gid)

; ---- h2ommrstd descending

gid = eos_gd_attach ( fid, 'H2OMMRStd_desc' )
ret = eos_gd_readfield ( gid, 'Counts', buffr)
L3.h2ommrstd.counts = buffr
if ret ne 0 then stop, ret
ret = eos_gd_readfield ( gid, 'Mean', buffr )
L3.h2ommrstd.mean = buffr
if ret ne 0 then stop, ret
ret = eos_gd_detach (gid)

END ; Descending
ENDCASE

ret = eos_gd_close (fid)

end

end

Document Actions
NASA Logo - nasa.gov
NASA Privacy Policy and Important Notices
Last updated: Sep 09, 2009 02:25 PM ET
Top