Ocean Color Forum - Not logged in
I'm trying to output L2 files to HDF format so I can read it in Matlab (in Windows). I would like to know if there is any way of including lat\lon and several chl algorithm outputs in the same HDF. In the graphical mode, this does not seem possible (either navigation or geophysical data, not both).
I use the outascii Seadas function in command mode and it works well but using several algorithm outputs generates too many files (and entropy!).
Also, if someone could print a HDF output example I would be very thankfull. I don't know what some inputs mean and my LInux language knowledge is very limited.
Actually SeaDAS GUI can help to create a generic HDF file which contains
multiple products and lat/lon info (all in one file) from several displayed
(1) display images (multiple products)
(2) Functions->Output->Data->Binary->File Type: HDF SD
Note: current Output Mode is New. Output Type is Image Data
Need remember the output filename for additional add-ons.
(3) To add lat/lon info:
Change Output Type to Navigation Data and change Output Mode
to Append. And add navigation info to the same output file.
(4) Similarly use Image Data and Append can keep adding multiple
products on the same output HDF file.
Thank you for the help, it does work in GUI mode. However, it is not very practical even when using only one file because everytime I choose a layer of information, the output name and type changes automatically and I have to do the same thing all over again.
Nevertheless I would like to know if it is possible to this operation in command mode in order to do this to a lot of files (each one has 4\5 layers, like lat\lon and different chl_a outputs).
One of many good features in SeaDAS is the ability of
If you have many L2 files in a directory (such as 'July2008')
, run below script will help to create many HDF files for every
files in the directory:
; Script for automatic HDF file creation
; Read in MODIS CHL and SST products for every input files
print,'No. of files to process:', n
for i=0, n-1 do begin & $
ifile = files(i) & $
base_fname = FILE_BASENAME(ifile, '.L2_LAC') & $
load,ifile,ftype='modis',prod_name=['chlor_a','sst'] & $
; Output the data in generic HDF format
outfile = base_fname + '.hdf' & $
out, /data, band=1, outfile, ftype='hdf', dfmt=1, /geo & $
out, /data, band=2, outfile, ftype='hdf', dfmt=1, /geo, append=1 & $
out, /nav, band=1, outfile, ftype='hdf', append=1 & $
clear_up & $
The use of ' & $ ' is for line continuation in For loop.
Thank you Long.
When navigation data is outputed to HDF format the Latitude and Longitude matrices refer to center pixel coordinate? Upper Left? Other?
Is center pixel. You can use zoom window
to check every pixel.