Re: reading raw calipso data in NCL

From: Matthew Fearon <Matthew.Fearon_at_nyahnyahspammersnyahnyah>
Date: Tue Jul 23 2013 - 21:57:17 MDT

Hi Mary,

Thanks for the examples you sent; "dim_gbits" and hdfeos example page. I'll take a look. In the meantime, I uploaded an hdf Calipso VFM, Vertical Feature Mask, to The file name is:


I'm trying to correctly unpack the variable 'Feature_Classification_Flags' which should be a one digit value. A discussion of the bit arrangement can be found here:

It would be great to add an example of this to the applications page. I believe it would help many users in the future.

thank you in advance,

From: Mary Haley []
Sent: Tuesday, July 23, 2013 8:45 PM
To: Matthew Fearon
Cc: H. Joe Lee;
Subject: Re: reading raw calipso data in NCL

Hi Matt (and Joe),

I didn't see this message before I sent you the other response.

I think you want to check out our "dim_gbits" function, which allows you to extract bits from an NCL data variable.

After reading the description below, maybe Joe will have a better idea of how to extract the bits that you need. We might be able to add some examples of this on our applications page.

Please look at example "hdf4eos_5.ncl" at:

This example shows how to extra the bits you want and generate a contour plot.

Here's the "dim_gbits" function documentation:

The dim_gbits function requires that you know how the bits are written.

If you do an ncl_filedump on the HDF file, you should see a description of how
the bits are laid out. The description looks something like this:

% ncl_filedump MOD05_L2.A2002161.1830.004.2003221153410.hdf | less

. . .

      byte Cloud_Mask_QA ( Cell_Along_Swath_1km_mod05, Cell_Across_Swath_1km_mod05 )
         long_name : MODIS Cloud Mask, First Byte
         unit : none
         scale_factor : 1
         add_offset : 0
         Parameter_Type : MODIS Input
         Cell_Along_Swath_Sampling : ( 1, 2030, 1 )
         Cell_Across_Swath_Sampling : ( 1, 1354, 1 )
         Geolocation_Pointer : External MODIS geolocation product
         description :

 bit field Description Key
 --------- ----------- ---

 0 Cloud Mask Flag 0 = not determined
                                             1 = determined

 1-2 Unobstructed FOV Quality Flag 00 = cloud
                                             01 = 66% prob.
                                             10 = 95% prob.
                                             11 = 99% prob.
 3 Day / Night Flag 0 = Night / 1 = Day
 4 Sunglint Flag 0 = Yes / 1 = No
 5 Snow / Ice Background Flag 0 = Yes / 1 = No
 6-7 Land / Water Flag 00=Water/01=Coastal
         valid_range : ( 0, -1 )
         _FillValue : 0
         hdf_name : Cloud_Mask_QA
. . .


On Jul 23, 2013, at 9:10 PM, Matthew Fearon <<>> wrote:

Hi, Joe
Thanks for your reply. At this time, I'm most interested in Calipso Vertical Feature Mask (VFM) and reading the associated variable 'Feature_Classification_Flags' from the hdf file, eg., CAL_LID_L2_VFM-ValStage1-V3-02.2011-12-31T23-18-11ZD.hdf . NCL reads this variable as an unsigned short. However, in order to extract the correct flag, which should be a single value, it appears the data need to be bit interpreted. I'm not sure how to do this correctly in NCL. If you have any luck unpacking and or plotting up the data in NCL, please let me know. Right now, I'm trying to setup a temporary workaround with Matlab, via the code released by NASA, to extract the data correctly -- not an ideal solution.

thanks again,

From: H. Joe Lee [<>]
Sent: Tuesday, July 23, 2013 7:13 PM
To: Matthew Fearon
Subject: Re: reading raw calipso data in NCL

Hi, Matt!

 I'm also interested in plotting HDF CALIPSO data and post it under
our website [1] but I'm wondering if you could provide the specific
NASA HDF product name (e.g.,
CAL_IIR_L1-Prov-V1-11.2008-08-20T01-40-12ZD.hdf) that you're mostly
interested in.



HDF: Software that Powers Science
On Mon, Jul 22, 2013 at 2:56 PM, Matthew Fearon <<>> wrote:
Dear NCL users:
Just curious if anyone has developed an NCL script to read raw Calipso data,
particularly vertical feature mask, in hdf format and make a plot? I see
there are a couple examples here: , but they are using a
processed form of the data. Any assistance would be much appreciated.
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:

ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Tue Jul 23 21:57:37 2013

This archive was generated by hypermail 2.1.8 : Wed Sep 04 2013 - 10:27:57 MDT