Re: NCL Debugging and HDF-EOS Support for AMSR-E LAMAZ Projection?

From: Wei Huang <huangwei_at_nyahnyahspammersnyahnyah>
Date: Mon Apr 11 2011 - 10:01:35 MDT

Stewart,

Which NCL version are you using (ncl -V)?
I'd suggest you try out NCL6.0.0beta,

Here, use data as HDF(4), I have:
ncl_filedump AMSR_E_L3_5DaySnow_V09_20050126.hdf

...
   dimensions:
      YDim_Northern_Hemisphere = 721
      XDim_Northern_Hemisphere = 721
      YDim_Southern_Hemisphere = 721
      XDim_Southern_Hemisphere = 721
   variables:
      ubyte SWE_NorthernPentad ( YDim_Northern_Hemisphere, XDim_Northern_Hemisphere )
         _FillValue : 255
         hdf_name : SWE_NorthernPentad

      ubyte Flags_NorthernPentad ( YDim_Northern_Hemisphere, XDim_Northern_Hemisphere )
         _FillValue : 255
         hdf_name : Flags_NorthernPentad

      ubyte SWE_SouthernPentad ( YDim_Southern_Hemisphere, XDim_Southern_Hemisphere )
         _FillValue : 255
         hdf_name : SWE_SouthernPentad

      ubyte Flags_SouthernPentad ( YDim_Southern_Hemisphere, XDim_Southern_Hemisphere )
         hdf_name : Flags_SouthernPentad

Use as HE2, we can see:
ncl_filedump AMSR_E_L3_5DaySnow_V09_20050126.hdf.he2

....

Variable: f
Type: file
filename: AMSR_E_L3_5DaySnow_V09_20050126.hdf
path: AMSR_E_L3_5DaySnow_V09_20050126.hdf
   file global attributes:
   dimensions:
      YDim_Northern_Hemisphere = 721
      XDim_Northern_Hemisphere = 721
      YDim_Southern_Hemisphere = 721
      XDim_Southern_Hemisphere = 721
   variables:
      double GridLat_Southern_Hemisphere ( YDim_Southern_Hemisphere, XDim_Southern_Hemisphere )
         projection : Lambert Azimuthal Equal Area
         corners : ( 1e+51, 1e+51, 1e+51, 1e+51 )
         long_name : latitude
         units : degrees_north

      double GridLon_Southern_Hemisphere ( YDim_Southern_Hemisphere, XDim_Southern_Hemisphere )
         projection : Lambert Azimuthal Equal Area
         corners : ( 1e+51, 1e+51, 1e+51, 1e+51 )
         long_name : longitude
         units : degrees_east

      byte Flags_SouthernPentad_Southern_Hemisphere ( YDim_Southern_Hemisphere, XDim_Southern_Hemisphere )
         coordinates : GridLat_Southern_Hemisphere, GridLon_Southern_Hemisphere
         hdfeos_name : Flags_SouthernPentad
         projection : Lambert Azimuthal Equal Area
         unsigned : True

      byte SWE_SouthernPentad_Southern_Hemisphere ( YDim_Southern_Hemisphere, XDim_Southern_Hemisphere )
         coordinates : GridLat_Southern_Hemisphere, GridLon_Southern_Hemisphere
         hdfeos_name : SWE_SouthernPentad
         projection : Lambert Azimuthal Equal Area
         unsigned : True
         _FillValue : -1

      double GridLat_Northern_Hemisphere ( YDim_Northern_Hemisphere, XDim_Northern_Hemisphere )
         projection : Lambert Azimuthal Equal Area
         corners : ( 1e+51, 1e+51, 1e+51, 1e+51 )
         long_name : latitude
         units : degrees_north

      double GridLon_Northern_Hemisphere ( YDim_Northern_Hemisphere, XDim_Northern_Hemisphere )
         projection : Lambert Azimuthal Equal Area
         corners : ( 1e+51, 1e+51, 1e+51, 1e+51 )
         long_name : longitude
         units : degrees_east

      byte Flags_NorthernPentad_Northern_Hemisphere ( YDim_Northern_Hemisphere, XDim_Northern_Hemisphere )
         coordinates : GridLat_Northern_Hemisphere, GridLon_Northern_Hemisphere
         hdfeos_name : Flags_NorthernPentad
         projection : Lambert Azimuthal Equal Area
         unsigned : True
         _FillValue : -1

      byte SWE_NorthernPentad_Northern_Hemisphere ( YDim_Northern_Hemisphere, XDim_Northern_Hemisphere )
         coordinates : GridLat_Northern_Hemisphere, GridLon_Northern_Hemisphere
         hdfeos_name : SWE_NorthernPentad
         projection : Lambert Azimuthal Equal Area
         unsigned : True
         _FillValue : -1

 

huangwei@ucar.edu
VETS/CISL
National Center for Atmospheric Research
P.O. Box 3000 (1850 Table Mesa Dr.)
Boulder, CO 80307-3000 USA
(303) 497-8924

On Apr 8, 2011, at 2:50 PM, Stewart Dickson wrote:

> Hello, List,
>
> Here's the short list of questions -- details below.
> Does NCL::addfile(".he2")->GridLon_, GridLat_ handle EOS (EASE) grids with projection type LAMAZ?
> Data fields of type DFNT_UINT8 ? The errors I see seem to relate to data type clashes, and I'm at a loss as to how to debug.
> I am comparing a working example of visualizing HDF-EOS files in NCL:
> AMSR_E_L3_SeaIce6km_V11_20050118.hdf of EosZOO NSIDC Examples
> http://www.hdfeos.org/zoo/index_openNSIDC_Examples.php ->
> AMSR_E_L3_SeaIce6km_V11_20050118_SI_06km_NH_89V_DAY.ncl
>
> With HDF-EOS2 file: ftp://ftp.hdfgroup.uiuc.edu/pub/outgoing/NASAHDF/AMSR_E_L3_5DaySnow_V09_20050126.hdf
> [LAMAZ Projection] Listed further down on the same page.
>
> ncl_filedump AMSR_E_L3_SeaIce6km_V11_20050118.hdf reports:
> GridName="NpPolarGrid06km" ... Projection=GCTP_PS
> DataFieldName="SI_06km_NH_89V_DAY"
> DataType=DFNT_INT16 -- corresponds to NCL constant Literal suffix 'h'
> ncl_filedump AMSR_E_L3_5DaySnow_V09_20050126.hdf reports:
>
> GridName="Northern Hemisphere" ... Projection=GCTP_LAMAZ
> DataFieldName="SWE_NorthernPentad"
> DataType=DFNT_UINT8 -- corresponds to NCL constant Literal suffix 'B'
>
> My first attempt to visualize AMSR_E_L3_5DaySnow_V09_20050126.hdf projection: 11 -- LAMAZ in NCL
> begin
> eos_file=addfile("AMSR_E_L3_5DaySnow_V09_20050126.hdf.he2", "r")
> data=eos_file->SWE_NorthernPentad_Northern_Hemisphere(:,:)
> data@lon2d=eos_file->GridLon_Northern_Hemisphere
> data@lat2d=eos_file->GridLat_Northern_Hemisphere
> data@_FillValue=0B
> Results in:
> fatal:Type Mismatch: The type of missing value could not be converted to type of variable (data)
> Changing:
> data@_FillValue=0B
> To:
> data@_FillValue=0b
> Results in:
> fatal:NhlCvtStringToEnum: Unable to convert string "missing" to requested type
> warning:Error retrieving resource amJust from args - Ignoring Arg
> fatal:NhlCvtStringToEnum: Unable to convert string "missing" to requested type
> warning:Error retrieving resource amSide from args - Ignoring Arg
> ... (Repeated 12 times)
> The remaining code consists of:
> xwks=gsn_open_wks("pdf","AMSR_E_L3_5DaySnow_V09_20050126_SWE_NH")
> res=True
> res@... ;options...
> gsn_define_colormap(xwks,"BlAqGrYeOrReVi200")
> plot=gsn_csm_contour_map(xwks,data,res) ; create plot
>
> delete(plot) ; cleaning up
> delete(xwks)
> delete(data)
> delete(res)
> delete(eos_file)
> end
>
> Thanks,
>
> -Stewart Dickson, HDF Group
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Apr 12 02:01:50 2011

This archive was generated by hypermail 2.1.8 : Tue Apr 19 2011 - 18:32:03 MDT