Difference between revisions of "Example CF-NetCDF for Satellite"

From Earth Science Information Partners (ESIP)
Line 7: Line 7:
 
This data has been collected by three different satellites from 1979 to present. It is downloadable in text files, linear rectangular 288 * 180 grid.  
 
This data has been collected by three different satellites from 1979 to present. It is downloadable in text files, linear rectangular 288 * 180 grid.  
  
[ftp://toms.gsfc.nasa.gov/pub/omi/data/aerosol/ Nimbus satellite data] [ftp://toms.gsfc.nasa.gov/pub/nimbus7/data/aerosol/Y1978/L3_aersl_n7t_19781101.txt First 1978-11-01] [ftp://toms.gsfc.nasa.gov/pub/nimbus7/data/aerosol/Y1993/L3_aersl_n7t_19930506.txt Last 1993-05-06]
+
Nimbus satellite data download site. ftp://toms.gsfc.nasa.gov/pub/omi/data/aerosol/
  
 +
First 1978-11-01: ftp://toms.gsfc.nasa.gov/pub/nimbus7/data/aerosol/Y1978/L3_aersl_n7t_19781101.txt
  
#first nimbus data
+
Last 1993-05-06: ftp://toms.gsfc.nasa.gov/pub/nimbus7/data/aerosol/Y1993/L3_aersl_n7t_19930506.txt
#last nimbus data ftp://toms.gsfc.nasa.gov/pub/nimbus7/data/aerosol/Y1993/L3_aersl_n7t_19930506.txt
 
template_path_nimbus = "/pub/nimbus7/data/aerosol/Y%Y/L3_aersl_n7t_%Y%m%d.txt"
 
first_nimbus_datetime = datetime.datetime(1979, 1, 3)
 
last_nimbus_datetime = datetime.datetime(1993, 5, 6)
 
  
#last eptoms data ftp://toms.gsfc.nasa.gov/pub/eptoms/data/aerosol/Y2005/L3_aersl_ept_20051231.txt
+
[ftp://toms.gsfc.nasa.gov/pub/eptoms/data/aerosol/ EPTOMS satellite data download site] [ftp://toms.gsfc.nasa.gov/pub/eptoms/data/aerosol/Y1996/L3_aersl_ept_19960722.txt First 1996-07-22] [ftp://toms.gsfc.nasa.gov/pub/eptoms/data/aerosol/Y2005/L3_aersl_ept_20051231.txt Last 2007-12-31]
template_path_eptoms = "/pub/eptoms/data/aerosol/Y%Y/L3_aersl_ept_%Y%m%d.txt"
 
first_eptoms_datetime = datetime.datetime(1996, 7, 25)
 
  
#ftp://toms.gsfc.nasa.gov/pub/omi/data/aerosol/Y2004/L3_aersl_omi_20040906.txt
+
[ftp://toms.gsfc.nasa.gov/pub/omi/data/aerosol/ OMI satellite data download site] [ftp://toms.gsfc.nasa.gov/pub/omi/data/aerosol/Y2004/L3_aersl_omi_20041001.txt First 2004-10-01] [ftp://toms.gsfc.nasa.gov/pub/omi/data/aerosol/Y2011 Year 2011, growing]
template_path_omi = "/pub/omi/data/aerosol/Y%Y/L3_aersl_omi_%Y%m%d.txt"
 
first_omi_datetime = datetime.datetime(2004, 9, 6)
 
  
 +
As you can see, there is a gap between 1993-05-06 and 1996-07-22.
  
 +
Using this information, the daily url can be
  
ftp, url templates, file format
 
  
 
== Creating Empty CF-NetCDF File ==
 
== Creating Empty CF-NetCDF File ==

Revision as of 11:49, July 6, 2011

Back to WCS Access to netCDF Files

A Real life example how to download and store satellite data.

Total Ozone Mapping Spectrometer (TOMS) satellite

This data has been collected by three different satellites from 1979 to present. It is downloadable in text files, linear rectangular 288 * 180 grid.

Nimbus satellite data download site. ftp://toms.gsfc.nasa.gov/pub/omi/data/aerosol/

First 1978-11-01: ftp://toms.gsfc.nasa.gov/pub/nimbus7/data/aerosol/Y1978/L3_aersl_n7t_19781101.txt

Last 1993-05-06: ftp://toms.gsfc.nasa.gov/pub/nimbus7/data/aerosol/Y1993/L3_aersl_n7t_19930506.txt

EPTOMS satellite data download site First 1996-07-22 Last 2007-12-31

OMI satellite data download site First 2004-10-01 Year 2011, growing

As you can see, there is a gap between 1993-05-06 and 1996-07-22.

Using this information, the daily url can be


Creating Empty CF-NetCDF File

NCML

   <netcdf xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2">
       <explicit />
       <attribute name="title" type="string" value="NASA TOMS Project" />
       <attribute name="comment" type="string" value="NASA Total Ozone Mapping Spectrometer Project" />
       <attribute name="Conventions" type="string" value="CF-1.0" />
       <dimension name="time" length="0" isUnlimited="true" />
       <dimension name="lat" length="180" />
       <dimension name="lon" length="288" />
       <variable name="time" type="int" shape="time">
           <attribute name="standard_name" type="string" value="time" />
           <attribute name="long_name" type="string" value="time" />
           <attribute name="units" type="string" value="days since 1979-01-01" />
           <attribute name="axis" type="string" value="T" />
       </variable>
       <variable name="lat" type="double" shape="lat">
           <attribute name="standard_name" type="string" value="latitude" />
           <attribute name="long_name" type="string" value="latitude" />
           <attribute name="units" type="string" value="degrees_north" />
           <attribute name="axis" type="string" value="Y" />
           <values start="-89.5" increment="1" />
       </variable>
       <variable name="lon" type="double" shape="lon">
           <attribute name="standard_name" type="string" value="longitude" />
           <attribute name="long_name" type="string" value="longitude" />
           <attribute name="units" type="string" value="degrees_east" />
           <attribute name="axis" type="string" value="X" />
           <values start="-179.375" increment="1.25" />
       </variable>
       <variable name="AI" type="float" shape="time lat lon">
           <attribute name="long_name" type="string" value="Aerosol Index" />
           <attribute name="units" type="string" value="fraction" />
           <attribute name="_FillValue" type="float" value="NaN" />
           <attribute name="missing_value" type="float" value="NaN" />
       </variable>
   </netcdf>

Create Script AI_create.py

   from datafed import cf1
   
   def create():
       cf1.create_ncml22('AerosolIndex.nc', 'AerosolIndex.ncml', '64bitoffset')
   
   if __name__ == "__main__":
       create()

Download Procedure

Make URL from the Template

Download the Text File

Compile the Text File into an rectangular array

Append the time slice