Re: outpout data for region

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon, 29 May 2006 09:30:40 -0600 (MDT)

> Did u get the sample file which i send you as an attachment ?
> anyway i could able to write sub set data for a particular region but one
> small problem i need to write for 12 level data up to 100hPa instead of 24
> levels ( 1 hpa) can you help me in this regards ? with warm regards
>
>>> I am using AIRS hdf data to extract different parameters.I am writing
>>> the out put on a singale file, because of large volume of the data sets i
>>> am not able to write it on a singale file for a season or so i could able
>>> to write for about 10 days data. Is there anyway of writng it for a region
>>> say 30E-150E and -30S-30N ?
>>> given below is the code which i used
____________________________________________________________________________
Hello,

Yes, we did get the file. I took a quick look at it using
NCL's command line operator: ncl_filedump

%> ncl_filedump AIRS.2005.07.20.L3.RetStd001.v4.0.9.0.G05203185105.hdf

filename: AIRS.2005.07.20.L3.RetStd001.v4.0.9.0.G05203185105
path: AIRS.2005.07.20.L3.RetStd001.v4.0.9.0.G05203185105.hdf
    file global attributes:
       HDFEOSVersion : HDFEOS_V2.12
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       ^^^^^^^ NOTE ^^^^^^^^^^^^^^
[snip]

This is a HDF-EOS file. EOS means "Earth Observing System".
EOS is a convention under the standard HDF-SDS [Scientific Data Set]
format.

It is best to read this with a ".hdfeos" extension. So if the file
ia named AIRS.2005.07.20.L3.RetStd001.v4.0.9.0.G05203185105 on the
disk then:

     f = addfile("AIRS.2005.07.20.L3.RetStd001.v4.0.9.0.G05203185105.hdfeos","r")

or if it the name has the hdf extension ... hust add hdfeos in addfile.

     f = addfile("AIRS.2005.07.20.L3.RetStd001.v4.0.9.0.G05203185105.hdf.hdfeos","r")

NCL uses the rightmost file extension to identify the file type.

-------------------------------

[1] The date and pressure level information are file attributes.

     day = f_at_Day_location
     mon = f_at_Month_location
     year = f_at_Year_location

     lev = f_at_ATempPresLvls_location

[2] The latitude and longitudes are two dimensional.
     However, examination of the array contents indicate that
     the values are repetitive. Further, the longitudes
     span -179.5 -> 179.5

     lon2d = f->Longitude_location
     lat2d = f->Latitude_location

     lon = lon2d(0,:) ; extract 1d subset
     lat = lat2d(:,0)

[3] The following are not required but I think it is like documenting
     the code.

     lev_at_units = "hPa" ; add units attribute
     lon2d_at_units = "degrees_east" ; add units
     lat2d_at_units = "degrees_north"

     lev!0 = "lev" ; name dimensions
     lon!0 = "lon"
     lat!0 = "lat"

     printVarSummary( lev )
     printVarSummary( lat )
     printVarSummary( lon )

[4] Examine one of the desired temperature variables using ncl_filedump

%> ncl_filedump -v Temperature_MW_D_descending_MW_only AIRS.2005.07.20.L3.RetStd001.v4.0.9.0.G05203185105.hdfeos | less

    shows that the temperatures are Kelvin. NCL indicates the _FillVallue
    attribute as -9999.

[5] Read data

     T_D = f->Temperature_MW_D_descending_MW_only
     T_A = f->Temperature_MW_D_ascending_MW_only

[6] Assign netCDF type named dimensions and coordinate variables
     These facilitate "natural" subsetting of the data.

     T_D!0 = "lev"
     T_D!1 = "lat"
     T_D!2 = "lon"
     T_D&lev = lev
     T_D&lat = lat
     T_D&lon = lon

     T_A!0 = "lev"
     T_A!1 = "lat"
     T_A!2 = "lon"
     T_A&lev = lev
     T_A&lat = lat
     T_A&lon = lon

     printVarSummary( T_D )
     printMinMax( T_D, True )
     printVarSummary( T_A )
     printMinMax( T_A, True )

[7] Use NCL's coordinate subscripting to select regions/ levels of interest

     t_a = T_A({lev|1000:100} , {lat|-30:30}, {lon|:30:150})
     t_d = T_d({lev|1000:100} , {lat|-30:30}, {lon|:30:150})

     printVarSummary( t_d )
     printMinMax( t_d, True )
     printVarSummary( t_a )
     printMinMax( t_a, True )

[8] binary write

     fbindirwrite(path,T_A )
     fbindirwrite(path,T_D )

Good luck

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon May 29 2006 - 09:30:40 MDT

This archive was generated by hypermail 2.2.0 : Tue May 30 2006 - 09:35:39 MDT