Re: questions about HDF4 SDS data

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Fri Jun 25 2010 - 14:36:05 MDT

Answers embedded below

On 06/24/2010 02:16 PM, Yi Wang wrote:
> Hi friends,
> I want to plot the LW TOA Total-Sky field in
> *CER_ZAVG_Aqua-FM4-MODIS_Edition2B_007005.200503.hdf* (you can find it
> at
> ftp://ftp.hdfgroup.uiuc.edu/pub/outgoing/veer/MAP_DATA/files/CERES/CER_ZAVG_Aqua-FM4-MODIS_Edition2B_007005.200503.hdf).
>
> My codes is in *CER_ZAVG_Aqua-FM4-MODIS_Edition2B_007005.200503.ncl* (in
> attachment).
> But I have some questions.
> *Question 1:*
> There are four LW TOA Total-Sky fields in this hdf file:
> 1.0 Degree Zonal -> Monthly Hourly Averages -> Observed TOA Fluxes -> LW
> TOA Total-Sky
> 1.0 Degree Zonal -> Monthly Averages -> Observed TOA Fluxes -> LW TOA
> Total-Sky
> Global -> Monthly Hourly Averages -> Observed TOA Fluxes -> LW TOA Total-Sky
> Global -> Monthly Averages -> Observed TOA Fluxes -> LW TOA Total-Sky
> I found from
> http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclFormatSupport.shtml that
> I probably can use
> data = hdf_file->LW_TOA_Total_Sky__0 to specify 1.0 Degree Zonal ->
> Monthly Hourly Averages -> Observed TOA Fluxes -> LW TOA Total-Sky,
> and use data = hdf_file->LW_TOA_Total_Sky__1, data =
> hdf_file->LW_TOA_Total_Sky__2, data = hdf_file->LW_TOA_Total_Sky__3 to
> specify the other three LW_TOA_Total_Sky fields.
> But, can I use something like
> data =
> hdf_file->LW_TOA_Total_Sky__Observed_TOA_Fluxes__Monthly_Hourly_Averages __1_0_Degree_Zonal
> to specify the LW TOA Total-Sky field? Because I just want to explicitly
> show the full path.

==
No.

The closest would be to explicitly show the named dimensions:

   data = LW_TOA_Total_Sky__0(LW_TOA_Total_Sky__0 ( Stats|:,
Monthly_Hourly_Avgs|:, 1_0_deg_zonal_colat_zones|:,
1_0_deg_zonal_long_zones|: )

Note: This is less efficient than

  data = LW_TOA_Total_Sky__0
===

> *Question 2:*
> There are several sentences in
> http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclFormatSupport.shtml saying
> that "It also provides two additional attributes to the variable:
> /hdf_group/, whose value is the HDF string name of the group, and
> /hdf_group_id/, whose value is the same as the group number appended to
> the end of the variable name."
> Can I use something like printVarSummary() to print out the information
> about hdf_group and hdf_group_id (Let us still take 1.0 Degree Zonal ->
> Monthly Hourly Averages -> Observed TOA Fluxes -> LW TOA Total-Sky as an
> example) ? If not, how can I get the hdf_group and hdf_group_id
> information?

==
Do not know.
==

> *Question 3:*
> I used my codes to get a plot (see
> *CER_ZAVG_Aqua-FM4-MODIS_Edition2B_007005.200503_LW_TOA_Total_Sky.pdf*
> in the attachment). However, if I hope the range of X-axis (latitude) is
> -89.5~89.5 (not 0~179), and the range of Y-axis is 0~7 (not 0.0~7.0).
> How can I change the codes?
> In addition, there is an overlap in the subtitles, how to avoid it (I
> hope it can only shows "FIELD NAME: LW TOA Total-Sky" and "UNITS: Watt
> per square meter" as the subtitles) ?

==
     res@tmYLFormat = "f" ; no unnecessary zeros

There are examples of modifying tick marks [tm] at
     http://www.ncl.ucar.edu/Applications/tickmarks.shtml

==
     lat = fspan(-89.5,89.5,180)
     lat!0 = "lat"
     lat@units = "degrees_north"
     data!1 = "lat"
     data&lat = lat
==

When using gsn_csm*

By default, the "units" attribute is plotted in the upper right.
By default, the "long_name" is plotted in the upper left.

If no long_name [or standard_name] then you can manually use (say)

    res@gsnLeftString = data@hdf_name ; hdf_name plotted in upper left

See attached

==
Please look at the mini-Graphics manual at:
    http://www.ncl.ucar.edu/Document/Manuals/

==
Good luck

> Thanks a lot!
> Best,
> Yi
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
======================================================
Dennis J. Shea                  tel: 303-497-1361    |
P.O. Box 3000                   fax: 303-497-1333    |
Climate Analysis Section                             |
Climate & Global Dynamics Div.                       |
National Center for Atmospheric Research             |
Boulder, CO  80307                                   |
USA                        email: shea 'at' ucar.edu |
======================================================


_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Received on Fri Jun 25 14:36:10 2010

This archive was generated by hypermail 2.1.8 : Fri Jul 02 2010 - 07:45:13 MDT