Re: [netcdf-java] process swath data by netCDF

Hi again Yuanzheng,

Yuanzheng Shao wrote:
> Hi everyone,
> My aim is to extract the visible and infrared imagery
> from the DMSP/OLS 'smooth' data (with the format of OIS).
> Because the OIS belongs to swath data, I think the current
> GridDatatype is unsuitable to process this format. Definitely
> using the method "ucar.nc2.FileWriter.writeToFile", we can
> get the corresponding netCDF file and we can view the visible
> and infrared imagery of the netCDF file in NetCDF Tools.

You can open the OIS file directly in netCDF-Java ToolsUI and view it as
a grid. You are right that GridDatatype doesn't understand swath data.
However, it can interpret the OIS data as a geolocated grid with 2-D
latitude and longitude coordinate variables. It can do this because the
DMSP OIS IOSP calculates the latitude and longitude arrays (basically,
doing the calculations needed to convert the swath data into a grid).

> Then I want to write the geotiff with GeotiffWriter, but
> it failed because the the axis in this file is unequally
> spacing (lat, lon). That's why the GeotiffWriter throws an
> exception at GridCoordSystem.isRegularSpatial(), the exception
> info was "Must have 1D x and y axes for  infraredImagery".
> So it seems that I can not get the geotiff file from the
> generated netCDF file.

I believe that is correct and the problem is that the data isn't in a
known projection.

You could remap/resample the data but netCDF-Java doesn't support that
functionality.

> So I changed to use gadl_translate tools to generate geotiff
> file. The good news was I got the geotiff files and these
> files can be viewed correctly. The bad news was that when
> I path this geotiff file with gdalinfo, it displayed that
> this file was not a valid geotiff, without the Coordinate System.

I don't know much about GDAL. Can GDAL understand the 2-D latitude and
longitude coordinate variables?

> My question is how could extract different band from the swath
> data and write them to geotiff? Does netCDF can perform this
> task? If I can not achieve this aim only by netCDF, can anyone
> give me some suggestion?
> Maybe convert swath into grid is a effect method, but I have
> not found any tools could do this.

Sorry, I don't have any suggestion here.

Ethan

> The original OIS data is downloaded from the following FTP address:
> ftp://ftp.ngdc.noaa.gov/STP/DMSP/IBAMA
> 
> Any advices is appreciated.
> Many thanks.
> 
> Yuanzheng Shao
> CSISS, George Mason University
> 6301 Ivy Lane, Suite 620
> Greenbent, MD 20770

-- 
Ethan R. Davis                                Telephone: (303) 497-8155
Software Engineer                             Fax:       (303) 497-8690
UCAR Unidata Program Center                   E-mail:    edavis@xxxxxxxx
P.O. Box 3000
Boulder, CO  80307-3000                       http://www.unidata.ucar.edu/
---------------------------------------------------------------------------


  • 2009 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-java archives: