Creating a 250m MODIS-A quasi true colour cropped image

Please enter here to ask a question about any NASA Science related topics!
Post Reply
madjidh
Posts: 25
Joined: Wed Feb 27, 2019 10:05 am America/New_York

Creating a 250m MODIS-A quasi true colour cropped image

by madjidh » Wed Jan 06, 2021 5:39 am America/New_York

Hello,

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 ?

Cheers

Tags:

OB SeaDAS - knowles
Subject Matter Expert
Subject Matter Expert
Posts: 221
Joined: Mon Apr 07, 2008 4:40 pm America/New_York

Creating a 250m MODIS-A quasi true colour cropped image

by OB SeaDAS - knowles » Thu Jan 07, 2021 10:59 am America/New_York

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: https://oceandata.sci.gsfc.nasa.gov/ob/getfile/A2010283180500.L1A_LAC.bz2
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.
          
Danny

madjidh
Posts: 25
Joined: Wed Feb 27, 2019 10:05 am America/New_York

Creating a 250m MODIS-A quasi true colour cropped image

by madjidh » Fri Jan 08, 2021 6:28 am America/New_York

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: java.io.IOException: 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
   where:
  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 ?

OB SeaDAS - knowles
Subject Matter Expert
Subject Matter Expert
Posts: 221
Joined: Mon Apr 07, 2008 4:40 pm America/New_York

Creating a 250m MODIS-A quasi true colour cropped image

by OB SeaDAS - knowles » Fri Jan 08, 2021 10:45 am America/New_York

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.

Danny

madjidh
Posts: 25
Joined: Wed Feb 27, 2019 10:05 am America/New_York

Creating a 250m MODIS-A quasi true colour cropped image

by madjidh » Mon Jan 11, 2021 5:53 am America/New_York

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

OB SeaDAS - knowles
Subject Matter Expert
Subject Matter Expert
Posts: 221
Joined: Mon Apr 07, 2008 4:40 pm America/New_York

Creating a 250m MODIS-A quasi true colour cropped image

by OB SeaDAS - knowles » Mon Jan 11, 2021 8:47 am America/New_York

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
sline=1023
eline=1289
spixl=701
epixl=985


Danny

Danny

madjidh
Posts: 25
Joined: Wed Feb 27, 2019 10:05 am America/New_York

Creating a 250m MODIS-A quasi true colour cropped image

by madjidh » Mon Jan 11, 2021 9:55 am America/New_York

It works well thanks for the answer Danny !

Post Reply