Re: AMSR-E Swath attributes reading problem

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Tue Feb 15 2011 - 11:57:11 MST

Hi Joe,

If you open the file as an HDF file (rather than as an HDFEOS2 file) you will see the attributes.

ncl 0> f = addfile("AMSR_E_L2A_BrightnessTemperatures_V10_200501180027_D.hdf","r")
ncl 1> print(f)
ncl 2> printFileVarSummary(f,"89_0V_Res_5A_TB_not_resampled")

Variable: 89_0V_Res_5A_TB_not_resampled
Type: short
Total Size: 1941084 bytes
            970542 values
Number of Dimensions: 2
Dimensions and sizes: [DataTrack_lo_High_Res_A_Swath | 1997] x [DataXTrack_hi_High_Res_A_Swath | 486]
Coordinates:
            DataTrack_lo_High_Res_A_Swath: not a coordinate variable
            DataXTrack_hi_High_Res_A_Swath: not a coordinate variable
Number of Attributes: 4
  SCALE_FACTOR : 0.01
  OFFSET : 327.68
  UNIT : Kelvin
  hdf_name : 89.0V_Res.5A_TB_(not-resampled)

I realize the present implementation is inconvenient because you need to open the file as an HDFEOS2 file to get the coordinates and again as an HDF4 file to get the attributes. Sometime in the not too distant future we intend to add support for HDF4 attributes in the HDFEOS reader.

 -dave

On Feb 15, 2011, at 7:40 AM, H. Joe Lee wrote:

> Hi,
>
> I found a problem in reading attributes from AMSR-E HDF-EOS2 swath
> data file with NCL.
>
> Here's the detail.
>
> [Environment]
> NCL Version: 5.2.1
> OS: CentOS Linux 32-bit
> Input file: NSIDC AMSR_E Swath. See [1] below for URL.
>
> [Code]
> begin
> eos_file=addfile("AMSR_E_L2A_BrightnessTemperatures_V10_200501180027_D.hdf.he2",
> "r") data_unscaled=eos_file->89_0V_Res_5B_TB__not_resampled__High_Res_B_Swath
> ; read specific subset of data field
> ; print(eos_file);
> printVarSummary(data_unscaled)
> print(data_unscaled@UNIT)
> end
>
> [Output of the above code]
> Variable: data_unscaled
> Type: short
> Total Size: 1941084 bytes
> 970542 values
> Number of Dimensions: 2
> Dimensions and sizes: [DataTrack_lo_High_Res_B_Swath | 1997] x
> [DataXTrack_hi_High_Res_B_Swath | 486]
> Coordinates:
> Number Of Attributes: 2
> coordinates : Latitude_High_Res_B_Swath, Longitude_High_Res_B_Swath
> hdfeos_name : 89.0V_Res.5B_TB_(not-resampled)]
> warning:Attempt to reference attribute (UNIT) which is undefined
> (0) -999
>
> [Problem]
> If you look at the input file with HDFView as shown in [2], you will
> see "UNIT", "OFFSET", and "SCALE_FACTOR" attributes associated with
> the swath dataset. However, NCL doesn't read them properly. Thus, I
> cannot apply the "short2flt_hdf()" function to the swath datatset.
>
> [Discussion]
> I know I can assign attributes manually and apply scale factor and
> offset but I think it would be great if NCL can read those attributes
> automatically.
>
>
> [References]
> [1] ftp://ftp.hdfgroup.uiuc.edu/pub/outgoing/NASAHDF/AMSR_E_L2A_BrightnessTemperatures_V10_200501180027_D.hdf
> [2] ftp://ftp.hdfgroup.uiuc.edu/pub/outgoing/joe/ncl/AMSR_E_L2A_BrightnessTemperatures_V10_200501180027_D.hdf.89.0V_Res.5B_TB_%28not-resampled%29.attributes.jpg
> --
> 1.217.531.6125
> Docs into PDF, Data into HDF.
> _______________________________________________
> 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 Feb 15 11:57:17 2011

This archive was generated by hypermail 2.1.8 : Thu Feb 17 2011 - 22:00:17 MST