pro read_nvapm device, decomposed = 0 ;ENTER THE NAME OF THE FILE YOU WISH TO READ/DISPLAY filename = 'U:\NVAPO_V1.3\1990.154.NVAPO.tpw.1xdaily.nc' ;PARSE OUT INFORMATION ABOUT THE DATE AND PRODUCT TYPE FROM THE ;FILE NAME THIS INFORMATION WILL ALSO BE USED TO DETERMINE THE ;NAMES OF ASCII OUTPUT FILES. ipos = strpos(filename, '.', /reverse_search) stream = strmid(filename, ipos-13, 1) jday = strmid(filename, ipos-21, 3) year = strmid(filename, ipos-26, 4) t_or_l = strmid(filename, ipos-11,3) day = fix(jday) yr = fix(year) if (stream eq 'C' and t_or_l eq 'tpw') then index = 1 if (stream eq 'C' and t_or_l eq 'lpw') then index = 2 if (stream eq 'S' and t_or_l eq 'tpw') then index = 3 if (stream eq 'S' and t_or_l eq 'lpw') then index = 4 if (stream eq 'O') then index = 5 ;SET UP COLOR BAR ncolors = 253 red = BYTE([25,0,0,1,0,0,0, 32, 50, 113,178,255,255, 255, $ 255,255,255,255,255,255, 178, 199,255]) green = BYTE([25,0,80,125,206,255,228, 246, 205,222, 252,255,227, $ 199,171,133,100,85, 69, 0, 34,21, 0]) blue = BYTE([112,191,255,255,255,255,181,112, $ 0, 0,50, 0,0, 0,0,0,50,70, 0, 0,34, 133,146]) white = 255B black = 0B red = [150B, rebin(red, nColors, /sample ), black, white] green = [150B, rebin(green, nColors, /sample ), black, white] blue = [150B, rebin(blue, nColors, /sample ), black, white] ctable = bytarr(3,256) for i = 0, 255 do begin ctable(0,i) = red(i) ctable(1,i) = green(i) ctable(2,i) = blue(i) endfor tvlct, red, green, blue ;END COLOR BAR. START SELECTION OF PRODUCT TYPE/RESOLUTION TO READ AND ;DISPLAY THE FILE case index of 1: begin ;NVAP-M CLIMATE TPW cdfid = ncdf_open(filename) nlon = 360 nlat = 180 ntimes = 1 nlayers = 1 varid = ncdf_varid(cdfid, 'water_vapor') ncdf_varget, cdfid, varid, tpw varid2 = ncdf_varid(cdfid, 'SSMI_DSC') ncdf_varget, cdfid, varid2, ssmi_dsc varid3 = ncdf_varid(cdfid, 'HIRS_DSC') ncdf_varget, cdfid, varid3, hirs_dsc varid4 = ncdf_varid(cdfid, 'Sonde_DSC') ncdf_varget, cdfid, varid4, sonde_dsc varid5 = ncdf_varid(cdfid, 'AIRS_DSC') ncdf_varget, cdfid, varid5, airs_dsc ncdf_close, cdfid help, tpw, ssmi_dsc, hirs_dsc, sonde_dsc, airs_dsc ;OUTPUT TPW TO ASCII FILE. THIS CAN SIMILARLY BE REPEATED WITH ;ALL OF THE DATA SOURCE CODE INFORMATION, IF DESIRED tpwfile = year+'.'+jday+'.'+'NVAP'+stream+'.'+t_or_l+'.1xdaily.dat' print,tpwfile openr, lun, tpwfile, /get_lun printf, lun, nlon,nlat,ntimes, nlayers, format = '(4i5)' printf, lun, tpw free_lun, lun ;DISPLAY TPW ON SCREEN. window, 1, xsize= 720, ysize = 360 tpw = bytscl(tpw, max = 80, min =0, top = 253) tpw = rebin(tpw, 720,360,/sample) tv, tpw map_set, 0, 0, /cylindrical, xmargin = 0, ymargin=0, /noborder,$ /noerase, color = 254, mlinethick = 2, /continents, /hires end 2: begin ;NVAP-M CLIMATE LAYERED PW nlon = 360 nlat = 180 ntimes = 1 nlayers = 4 cdfid = ncdf_open(filename) varid = ncdf_varid(cdfid, 'water_vapor') ncdf_varget, cdfid, varid, lpw varid2 = ncdf_varid(cdfid, 'HIRS_DSC') ncdf_varget, cdfid, varid2, hirs_dsc varid3 = ncdf_varid(cdfid, 'Sonde_DSC') ncdf_varget, cdfid, varid3, sonde_dsc varid4 = ncdf_varid(cdfid, 'AIRS_DSC') ncdf_varget, cdfid, varid4, airs_dsc ncdf_close, cdfid help, lpw, hirs_dsc, sonde_dsc, airs_dsc ;OUTPUT TPW TO ASCII FILE. THIS CAN SIMILARLY BE REPEATED WITH ;ALL OF THE DATA SOURCE CODE INFORMATION, IF DESIRED tpwfile = year+'.'+jday+'.'+'NVAP'+stream+'.'+t_or_l+'.1xdaily.dat' print, tpwfile openr, lun, tpwfile, /get_lun printf, lun, nlon,nlat,ntimes, nlayers, format = '(4i5)' printf, lun, tpw free_lun, lun ;DISPLAY TPW ON SCREEN. window, 1, xsize= 720, ysize = 360 tpw = bytscl(lpw(*,*,3), max = 60, min =0, top = 253) tpw = rebin(tpw, 720,360,/sample) tv, tpw map_set, 0, 0, /cylindrical, xmargin = 0, ymargin=0, /noborder,$ /noerase, color = 254, mlinethick = 2, /continents, /hires end ;NVAP-M WEATHER TPW 3: begin nlon = 720 nlat = 360 ntimes = 4 nlayers = 1 cdfid = ncdf_open(filename) varid = ncdf_varid(cdfid, 'water_vapor') ncdf_varget, cdfid, varid, tpw varid2 = ncdf_varid(cdfid, 'SSMI_DSC') ncdf_varget, cdfid, varid2, ssmi_dsc varid3 = ncdf_varid(cdfid, 'HIRS_DSC') ncdf_varget, cdfid, varid3, hirs_dsc varid4 = ncdf_varid(cdfid, 'Sonde_DSC') ncdf_varget, cdfid, varid4, sonde_dsc varid5 = ncdf_varid(cdfid, 'AIRS_DSC') ncdf_varget, cdfid, varid5, airs_dsc varid6 = ncdf_varid(cdfid, 'GPS_DSC') ncdf_varget, cdfid, varid6, gps_dsc ncdf_close, cdfid help, tpw, ssmi_dsc, hirs_dsc, sonde_dsc, airs_dsc,gps_dsc ;OUTPUT TPW TO ASCII FILE. THIS CAN SIMILARLY BE REPEATED WITH ;ALL OF THE DATA SOURCE CODE INFORMATION, IF DESIRED tpwfile = year+'.'+jday+'.'+'NVAP'+stream+'.'+t_or_l+'.4xdaily.dat' print, tpwfile openr, lun, tpwfile, /get_lun printf, lun, nlon,nlat,ntimes, nlayers, format = '(4i5)' printf, lun, tpw free_lun, lun ;DISPLAY TPW ON SCREEN. window, 1, xsize= 720, ysize = 360 tpw = bytscl(tpw(*,*,3), max = 80, min =0, top = 253) tpw = rebin(tpw, 720,360,/sample) tv, tpw map_set, 0, 0, /cylindrical, xmargin = 0, ymargin=0, /noborder,$ /noerase, color = 254, mlinethick = 2, /continents, /hires end 4: begin ; NVAP-M WEATHER LAYERED PW nlon = 720 nlat = 360 ntimes = 4 nlayers = 4 cdfid = ncdf_open(filename) varid = ncdf_varid(cdfid, 'water_vapor') ncdf_varget, cdfid, varid, lpw varid2 = ncdf_varid(cdfid, 'HIRS_DSC') ncdf_varget, cdfid, varid2, hirs_dsc varid3 = ncdf_varid(cdfid, 'Sonde_DSC') ncdf_varget, cdfid, varid3, sonde_dsc varid4 = ncdf_varid(cdfid, 'AIRS_DSC') ncdf_varget, cdfid, varid4, airs_dsc ncdf_close, cdfid help, lpw, hirs_dsc, sonde_dsc, airs_dsc ;OUTPUT TPW TO ASCII FILE. THIS CAN SIMILARLY BE REPEATED WITH ;ALL OF THE DATA SOURCE CODE INFORMATION, IF DESIRED tpwfile = year+'.'+jday+'.'+'NVAP'+stream+'.'+t_or_l+'.4xdaily.dat' print, tpwfile ; openr, lun, tpwfile, /get_lun ; printf, lun, nlon,nlat,ntimes, nlayers, format = '(4i5)' ; printf, lun, tpw ; free_lun, lun ;DISPLAY TPW ON SCREEN. window, 1, xsize= 720, ysize = 360 tpw = bytscl(lpw(*,*,3,0), max = 60, min =0, top = 253) tpw = rebin(tpw, 720,360,/sample) tv, tpw map_set, 0, 0, /cylindrical, xmargin = 0, ymargin=0, /noborder,$ /noerase, color = 254, mlinethick = 2, /continents, /hires end 5: begin ; NVAP-M OCEAN ONLY TPW nlon = 360 nlat = 180 ntimes = 1 nlayers = 1 cdfid = ncdf_open(filename) varid = ncdf_varid(cdfid, 'water_vapor') ncdf_varget, cdfid, varid, tpw varid2 = ncdf_varid(cdfid, 'SSMI_DSC') ncdf_varget, cdfid, varid2, ssmi_dsc ncdf_close, cdfid help, tpw, ssmi_dsc ;OUTPUT TPW TO ASCII FILE. THIS CAN SIMILARLY BE REPEATED WITH ;ALL OF THE DATA SOURCE CODE INFORMATION, IF DESIRED tpwfile = year+'.'+jday+'.'+'NVAP'+stream+'.'+t_or_l+'.1xdaily.dat' print, tpwfile ; openr, lun, tpwfile, /get_lun ; printf, lun, nlon,nlat,ntimes, nlayers, format = '(4i5)' ; printf, lun, tpw ; free_lun, lun ;DISPLAY TPW ON SCREEN. window, 1, xsize= 720, ysize = 360 tpw = bytscl(tpw, max = 80, min =0, top = 253) tpw = rebin(tpw, 720,360,/sample) tv, tpw map_set, 0, 0, /cylindrical, xmargin = 0, ymargin=0, /noborder,$ /noerase, color = 254, mlinethick = 2, /continents, /hires end endcase end