Computer Modeling Laboratory 4

Retrieving and Processing CloudSat and AIRS data using IDL

Today's lab will help you prepare for your class project by showing you how to go and get data and process it using IDL. We will also discuss data formats and address issues that are related to extracting specific quantities that we will need for our analysis.

We will work with data from two different satellite sensors

  1. CloudSat
  2. AIRS

In working with this date you will use the image below and try to reproduce it. For CloudSat refer to Task 1. For AIRS refer to Task 2.

Additionally, your data may come from your knowledge of a dust storm, heavy forest fire, or some other example of a perturbation to the atmospheric state. We will begin with an "a priori" knowledge of a deep convection event.

cpr

For your search window you need to reference the day October 22, 2006 and the time is approximately 17:14:19. The search area is N: -1.5, S: -8, E-63.0, W: -65.0

TASK 1

CloudSat
Instructions for Obtaining and Processing Data

  1. Go to http://www.cloudsat.cira.colostate.edu/
    Search for data based on the date and time. Your search result should return the following file 2006295171419_02583_CS_2B_GEOPROF_GRANULE_P_R04_E01.hdf
  2. Save this file in a directory that you can access from IDL. In IDL you can either process your file with a program or using command line statements. For learning purposes will use the command line.
    To open your data you will be using SDS (Scientific Data Sets). You may access information about the SDS @ http://idlastro.gsfc.nasa.gov/idl_html_help/Functional_List_of_IDL_Routines.html
    For now, open the file using,
    FID=eos_sw_open('filename',/read)
    swathname = '2B_GEOPROF'
    swathid=eos_sw_attach(FID, swathname)
    nfields = eos_sw_inqdatafields(swathid, fieldlist, rank, numbertype)
    ; this will return the list of all the data fields
    ; however some of the data we want is in the metadata for each swath
    ret=eos_sw_readfield(swathid, 'Latitude', Latitude)
    print, size(Latitude)
    ; now we have Latitude data stored as a variable,
    ; REPEAT above for Longitude
    
    CSat_file=HDF_SD_Start('Filename', /read)
    HDF_SD_FileInfo, CSat_file, num_datasets, num_attributes
    data1=HDF_SD_Select(CSat_file, 0)
    HDF_SD_GetInfo, data1, name=dataset_name, natts=num_attributes
    print, datset_name
    print, num_attributes
    HDF_SD_AttrInfo, data1, 0, name=attr_name1, data=attr_data1
    print, attr_data1
    

    Let's do this for Radar Reflectivity

    data1=HDF_SD_Select(CSat_file, 3)
    HDF_SD_GetData, data1, radar
    print, size(radar)
    

    Using the same commands as above, you will see that this data has 8 attribute

    att_index att_name att_value
    0 _FillValue 15360
    1 factor 100
    2 offset 0
        Radar Reflectivity
    3 long_name Factor
    4 Units dBZe
    5 valid_range -4000 to 5000'
    6 missing -8888
    7 missop =='
    New_Radar = Radar/100.0
    ; Let's find the data we want.
    lat1=-7.64
    lat2=-1.84
    lon1=-63.41
    lon2=-64.65
    i1=where(LATITUDE gt lat1-.01 and LATITUDE lt lat1+.01 and $
             LONGITUDE gt lon1-.01 and LONGITUDE lt lon1+.01)
    print, i1
    i2=where(LATITUDE gt lat2-.01 and LATITUDE lt lat2+.01 and $
             LONGITUDE gt lon2-.01 and LONGITUDE lt lon2+.01)
    print, i2
    subRadar=newradar[0:124,i1(0):i2(0)]
    Device, decomposed=0
    loadct,0
    CONTOUR, subRadar, /nodata, ystyle=1, xstyle=1, $
             color=255,background=255
    loadct, 40
    Contour,subRadar,nlevels=11,/follow,/fill,/overplot, $
          ystyle=1,xstyle=1, $
          levels=[-30,-24,-18,-12,-6,0,6,12,18,24,30],  $
          c_colors=[15, 39, 63, 87, 111, 135, 159, 183, 207, 231, 255]
    newsubRadar=TRANSPOSE(subRadar)
    ;Repeat contour command using newly defined array
    newsubRadar=REVERSE(newsubRadar)
    ;Repeat contour command using newly defined array
    loadct, 0
    Axis, yaxis=0,ystyle=1,yrange=[-4.9,29.], ytitle='Height (km)', $
          yticks=5, ytickv=[0,5,10,15,20,25], color=0
    Axis, xaxis=0,xstyle=1,xrange=[LATITUDE(i1(0)),LATITUDE(i2(0))],  $
          xticks=6, XTICKFORMAT='(F6.3)', xtitle='Latitude', color=0
    Axis,xaxis=1,xstyle=1,xrange=[LONGITUDE(i1(0)),LONGITUDE(i2(0))], $
         xticks=6,XTICKFORMAT='(f7.3)', xtitle='Longitude', color=0
    Axis, yaxis=1,ystyle=1,yrange=[-4.9,29.], ytitle='Height (km)', $
          yticks=5, ytickv=[0,5,10,15,20,25], color=0
    colorbar, ncolors = 50, bottom=3, divisions=10, range=[-40,40], $
           format='(i4)', position=[0.1,0.9,0.9,0.95]
    

    Please note that the code contained in these examples should be useful for you all to get started on your projects. Also, there are other options to process your data (e.g., using Matlab).

    In example 1, we have:

    1. covered concepts of xxx.hdf files
    2. retrieved our own data and opened it in IDL using eos_sw_open and hdf_sd_start
    3. we have learned about how to find the number of attributes and datasets
    4. learned about data and images in the terms of matrix notation
    5. how to search for data within a granule using the where function.
    6. how to scale data
    7. how to create an image of our data

TASK 2

AIRS
Instructions for Obtaining and Processing Data

  1. Go to http://disc.gsfc.nasa.gov/data/datapool/AIRS/Level2_V005/index.html
    Search for data based on the date and time Your search result should return the following file AIRS.2006.10.22.180.LIB.AIRS_Rad.v5.0.0.0.G07124191555.hdf
  2. Save this file in a directory that you can access from IDL. In IDL you can either process your file with a program or using command line statements.
    To open your data you will be using SDS (Scientific Data Sets). You may access information about the SDS @ http://idlastro.gsfc.nasa.gov/idl_html_help/Functional_List_of_IDL_Routines.html
    AIRS_file=HDF_SD_Start('Filename', /read)
    HDF_SD_FileInfo, AIRS_file, num_datasets, num_attributes
    data1=HDF_SD_Select(CSat_file, 0)
    HDF_SD_GetInfo, data1, name=dataset_name, natts=num_attributes
    HDF_SD_GetData, data1, Latitude
    ; Get datasets 0, 1, and 3
    ; CHECK THEIR ATTRIBUTES
    ; Let's look at the attributes of dataset 3
    ; there is only 1 fill value = -9999
    print, size(radiance)
    
    2378, 90, 135

    Let's subset all data associated with channel 5

    subset=radiance(4,0:89,0:134)
    

    You can use the other commands ie where function, from example 1 to search for data. These commands should be enough to get you all started on your projects

    Download colorbar.pro