Not logged inOcean Color Forum

The forum is locked.

The Ocean Color Forum has transitioned over to the Earthdata Forum ( The information existing below will be retained for historical reference. Please sign into the Earthdata Forum for active user support.

Up Topic SeaDAS / SeaDAS - General Questions / Creating a 250m MODIS-A quasi true colour cropped image
- By madjidh Date 2021-01-06 10:39

I would like to create a 250m quasi true colour image from MODIS. I like the output from l1mapgen, the colors / bands used are what I am looking for. I like the plate carrée projection. When I make an RGB product myself, it is not looking good compared to the output from l1mapgen.
I would like to crop the data to display only a small part of the MODIS image, to finally have a quasi true colour image, at the highest resolution possible.

I am a bit lost. How can I refine the area before applying l1mapgen ?

- By knowles Date 2021-01-07 15:59 Edited 2021-01-07 16:14
To create a quasi true color plate carrée mapped image for a ROI (region of interest) within a MODIS file the following GUI steps can be done:

Example file:
Region of interest: north=39.0, south=37.0, west=-78.0, east=-75.0

1. Create level-1A extract file:
   Menu > OCSSW > extractor ..
           infile = A2010283180500.L1A_LAC, and fill in geo coordinate fields with ROI, (pixel fields will auto-fill)
           ofile = A2010283180500.L1A_LAC.sub

2. Create GEO file for extract:
    Menu > OCSSW > modis_GEO
           file = A2010283180500.L1A_LAC
           output = A2010283180500.GEO.sub

3. Create level-1B for extract:
   Menu > OCSSW > modis_L1B
           ifile = A2010283180500.L1A_LAC
           geofile = A2010283180500.GEO.sub
           Note: ofile is auto-named (in this case A2010283180500.L1B_LAC.sub)

4. Create mapped image for extract:
    Menu > OCSSW > l1mapgen
           ifile = A2010283180500.L1B_LAC.sub
           ofile = A2010283180500.sub.png
           resolution = (choose 1000, 500, 250, -1)   *-1 is a default 
           oformat = (choose ppm, png, etc.)
           width = 1000 (this field may need adjustment depending of desired resolution and image size)
           Note: leave geofields = -999 (disabled).  These fields may be used directly on the non-extracted level-1B file however in this case
                    (at least currently) the resultant image is cropped but not mapped

Attached is the output image at 250m resolution.
- By madjidh Date 2021-01-08 11:28
Hi Daniel thanks for the answer, however when I specify the box coordinates in the extractor tool, the pixels information are not automatically filled, and then I got an error :

execution exception: l1aextract_modis failed with exit code 1.
Check log for more details.
This is version 0.76 of l1aextract_modis (compiled on Aug 16 2019 12:46:17)
Usage: l1aextract_modis infile spixl epixl sline eline outfile
  infile   - input MODIS L1A datafile
  spixl    - start pixel number (1-based)
  epixl    - end pixel number (1-based)
  sline    - start line (1-based)
  eline    - end line (1-based)
  outfile  - output file name
Note: Enter line number NOT scan number!

Am I doing something wrong ?
Attachment: Error.png (217k)
- By knowles Date 2021-01-08 15:45
After entering the final lat/lon textfield, try clicking on another textfield to trigger the autofill ... do the pixel textfields autofill if you do this?  The pixels values get autofilled via the "Run" button action, however you won't see it because the GUI closes and runs, so we need to know whether autofill is working for you.

Also what version of SeaDAS are you using and have you updated the OCSSW processors lately?  You might try updating OCSSW just in case, it's quick for updates and will rule out any issues there.

- By madjidh Date 2021-01-11 10:53 Edited 2021-01-11 11:45
I am using Seadas 7.5.1. The pixel textfields never autofill, no matter where I click.
I did udate the OCSSW processor but the problem is still present, no autofill.

Can I get the pixel values elsewhere and fill it myself to avoid the problem maybe ?
Edit : I meant that the extractor seems to work and produce a sub file when I fill the pixel textfields, I just don't know what numbers to write
- By knowles Date 2021-01-11 13:47
Updating to SeaDAS 7.5.3 will fix your GUI problem regarding autofill of the extractor GUI.

Alternatively, you can run this at the command line to retrieve the pixel values (using the example previously mentioned in this post).  Note in this case you will need to first generate GEO and L1B non-extracted files and then use them as input files to this command to determine the pixel coordinates.  Then you can do the steps previously mentioned in this post:

lonlat2pixline  A2010283180500.L1B_LAC A2010283180500.GEO -78.0 37.0 -75.0 39.0
# 701 985 1023 1289


- By madjidh Date 2021-01-11 14:55
It works well thanks for the answer Danny !
Up Topic SeaDAS / SeaDAS - General Questions / Creating a 250m MODIS-A quasi true colour cropped image

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill