Not logged inOcean Color Forum

The forum is locked.

The Ocean Color Forum has transitioned over to the Earthdata Forum (https://forum.earthdata.nasa.gov/). The information existing below will be retained for historical reference. Please sign into the Earthdata Forum for active user support.

Up Topic Frequently Asked Questions / Data Products & Algorithms FAQ / How do I geolocate (or navigate) the data? (locked)
- By Donna Date 2005-09-19 13:12 Edited 2006-05-16 12:44
How do I geolocate the MODIS and SeaWiFS data?

The Level-2 files for MODIS contain sufficient information for accurate
geolocation. No external geolocation file is required. SeaDAS can overlay
coastlines and grids, or reproject the files into any number of coordinate
frames.

The longitude and latitude information from the GEO file has been included in
the Level-2 file. The only difference is that it has been subsampled along scan
(every 8th pixel) to save space. The subsampled position is indicated by the
control-point SDS in the hdf file. A simple cubic spline interpolation can
accurately recover the full longitude and latitude arrays. The relevant SDSes
are:

Number of Scan Lines = 2030 ;
Number of Pixel Control Points = 170 ;
Pixels per Scan Line = 1354 ;
float longitude(Number of Scan Lines, Number of Pixel Control Points) ;
longitude:long_name = "Longitudes at control points" ;
longitude:valid_range = -180.f, 180.f ;
longitude:units = "degrees" ;
float latitude(Number of Scan Lines, Number of Pixel Control Points) ;
latitude:long_name = "Latitudes at control points" ;
latitude:valid_range = -90.f, 90.f ;
latitude:units = "degrees" ;
long cntl_pt_cols(Number of Pixel Control Points) ;
cntl_pt_cols:long_name = "Pixel control points" ;
cntl_pt_cols:units = "none" ;

This information gives longitude and latitude for every scan, at the pixel
control points. For each scanline, simply interpolate from the control-point
array to an array of 1...1354 for longitude and latitude, and you'll get the
full lon/lat arrays. This is what SeaDAS does.

Of course, if you have the GEO file it saves you some trouble, but you don't
need the GEO file to navigate the Level-2 data.

What is the difference between using the geolocation file versus the navigation
control points for mapping Level 2 data?


Comparing information from the geolocation file to what you get via
control-point interpolation demonstrates that there is little difference
between the two methods. There is no reason therefore to use the geolocation
file. Below is the demonstration using an IDL routine (l2_geo.pro):

IDL> file1 = 'A2004135100000.GEO'
IDL> file2 = 'A2004135100000.L2_LAC'
IDL> lon1 = rd_sds(file1,'Longitude')
IDL> lat1 = rd_sds(file1,'Latitude')
IDL> l2_geo,file2,lon2,lat2
IDL> help,lon1,lat1,lon2,lat2
LON1 FLOAT = Array[1354, 2030]
LAT1 FLOAT = Array[1354, 2030]
LON2 FLOAT = Array[1354, 2030]
LAT2 FLOAT = Array[1354, 2030]

IDL> print,max(abs(lon1-lon2)),max(abs(lat1-lat2))
0.000278473 4.57764e-05

IDL>print,max(abs(lon1(100:1254,*)-lon2(100:1254,*))),max(abs(lat1(100:1254,*)-lat2(100:1254,*)))
2.28882e-05 5.72205e-06

PRO l2_geo,file,lon,lat
sd_id = HDF_SD_START( file, /READ )
HDF_SD_ATTRINFO, sd_id, HDF_SD_ATTRFIND( sd_id, 'Pixels per Scan Line'), data=npix & npix = npix(0)
HDF_SD_ATTRINFO, sd_id, HDF_SD_ATTRFIND( sd_id, 'Number of Scan Lines'), data=nscan & nscan=nscan(0)
HDF_SD_GETDATA, HDF_SD_SELECT(sd_id, HDF_SD_NAMETOINDEX(sd_id,'longitude' )), ctllon
HDF_SD_GETDATA, HDF_SD_SELECT(sd_id, HDF_SD_NAMETOINDEX(sd_id,'latitude' )), ctllat
HDF_SD_GETDATA, HDF_SD_SELECT(sd_id, HDF_SD_NAMETOINDEX(sd_id,'cntl_pt_cols')), ctlpix
HDF_SD_END, sd_id
pix = lindgen(npix)+1
lon = fltarr(npix,nscan)
lat = fltarr(npix,nscan)
for j=0,nscan-1 do begin
lon(*,j) = spline(ctlpix,ctllon(*,j),pix)
lat(*,j) = spline(ctlpix,ctllat(*,j),pix)
endfor
return
end

The idl function rd_sds can be found here: http://oceancolor.gsfc.nasa.gov/cgi/idllibrary.cgi?dir=hdf

The demonstration shows differences as large as 0.0003 degrees (~0.03km at
equator). The largest differences occur near scan edge, where the pixels are
larger. Differences decrease by another order of magnitude if you ignore the
outer 100 pixels. These numbers are well within the uncertainty of the original
geolocation.
Up Topic Frequently Asked Questions / Data Products & Algorithms FAQ / How do I geolocate (or navigate) the data? (locked)

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill