grey layout spacer                                                 NEAR REAL-TIME       NOTIFICATIONS       PRODUCTS      
print page
 

Reading and plotting an HDF data file with IDL

The HDF data files can be read with IDL, for example with the routine so2hdfread.pro; this particular routine has been tested at IDL versions 6.0 and 6.3. Once the data has been read, it can be plotted (a simple example of that is provided), exported to other formats, etc.

When running the example routine with the HDF file of the 3-day composite of 19-21 March 2007 the output to the screen looks like this:


IDL> IDL> .run so2hdfread
IDL> so2hdfread

>>> Give the name of the HDF file to read
: data/so2cd2007031921.hdf

    Product: SO2 column densities [DU] -- 3-day composite
    No. of global attributes: 29
    No. of datasets: 9

      id  Global Attribute (first six)
     -----------------------------------
       0  Product
       1  Data_version
       2  Creation_date
       3  Product_status
       4  SO2_field_date_1
       5  SO2_field_date_2

    Details of the SO2_field_date_# attributes:

       SO2_field_date_1 is of type LONG; no. of values:  3
       SO2_field_date_2 is of type LONG; no. of values:  3

       SO2_field_date_1 values stored :  2007    3   19
       SO2_field_date_1 as a nice date: 19 March 2007

    Number of longitudes, latitudes:    1440     720

       Grid cell size (lon,lat):      0.250000     0.250000
       First longitude value   :     -179.875
       First latitude  value   :     -89.8750

    Reading  Iscd_field data set ...
    Skipping Iscd_error data set ...
    Skipping Ivcd_field_1 data set ...
    Skipping Ivcd_error_1 data set ...
    Reading  Ivcd_field_2 data set ...
    Skipping Ivcd_error_2 data set ...
    Skipping Ivcd_field_3 data set ...
    Skipping Ivcd_error_3 data set ...
    Reading  Iccf_field data set ...

>>> Give a "return" to continue
: 

    Part of the data as example:

     ilat  latitude  ilon  longitude   SCD [DU]  VCD [DU]  cloud frac.
    ------------------------------------------------------------------
      500    35.125   1176   114.125     4.817     2.312     0.154
      500    35.125   1177   114.375     4.761     2.316     0.139
      500    35.125   1178   114.625     4.487     2.192     0.131
      500    35.125   1179   114.875     3.551     1.771     0.104
      501    35.375   1176   114.125     5.748     2.649     0.201
      501    35.375   1177   114.375     6.321     2.843     0.220
      501    35.375   1178   114.625     6.676     2.942     0.242
      501    35.375   1179   114.875     4.835     2.284     0.151
      502    35.625   1176   114.125     5.730     2.604     0.202
      502    35.625   1177   114.375     8.064     3.359     0.330
      502    35.625   1178   114.625     8.058     3.332     0.346
      502    35.625   1179   114.875     6.255     2.781     0.227
      503    35.875   1176   114.125     4.937     2.294     0.183
      503    35.875   1177   114.375     7.240     2.968     0.365
      503    35.875   1178   114.625     7.762     3.105     0.412
      503    35.875   1179   114.875     7.013     2.940     0.322

>>> Extract the field value at a user-specified location
>>> Give the longitude, range: [-180:180] degrees;
    use 999 to end this extracting for values.
: -30
>>> Give the latitude, range: [-90:90] degrees
: 0

    Given coordinates fall in the grid cell with centre:
      longitude =  -30.125
      latitude  =   -0.125
    The SCD field value for this cell is:  0.455

>>> Extract the field value at a user-specified location
>>> Give the longitude, range: [-180:180] degrees;
    use 999 to end this extracting for values.
: 0
>>> Give the latitude, range: [-90:90] degrees
: 0

    Given coordinates fall in the grid cell with centre:
      longitude =   -0.125
      latitude  =   -0.125
    The SCD field value for this cell is -99, meaning that
    there is no data available for this grid cell

>>> Extract the field value at a user-specified location
>>> Give the longitude, range: [-180:180] degrees;
    use 999 to end this extracting for values.
: 0
>>> Give the latitude, range: [-90:90] degrees
: 30

    Given coordinates fall in the grid cell with centre:
      longitude =   -0.125
      latitude  =   29.875
    The SCD field value for this cell is:  1.353

>>> Extract the field value at a user-specified location
>>> Give the longitude, range: [-180:180] degrees;
    use 999 to end this extracting for values.
: 999

>>> Want to see a plot of the SO2 slant column field?
    Give "1" (one) for "yes" and something else for "no"
: 1

--- Plotting the SO2 slant column field, which takes a while ...
    The colour scale runs from 0.5 DU to 3 DU.

IDL> 
 
The picture plotted by the routine is shown on the right. It uses a standard IDL colour table and is not ornamented with title, axis labels, etc.; it is merely meant as an example.

The part of the data set shown by the routine is right in the middle of a patch of large SO2 values in the Air Quality SO2 Service region "46. China"; see the highlight page for an example of a close-up view.

Example IDL plot
 
Link naar de website van het Federaal Wetenschapsbeleid      grey layout spacer Link naar de Federale Portaalsite
 
TEMIS Home Page  PROMOTE Home Page  O3M SAF Home Page Last update on 18 Aug 2011