l2bin and l3mapgen issues

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
zhigang
Posts: 74
Joined: Tue Nov 10, 2020 8:03 pm America/New_York
Answers: 0

l2bin and l3mapgen issues

by zhigang » Mon May 07, 2018 12:45 pm America/New_York

Dear Danny,

I want to get a mapped file via l2bin and l3mapgen tool as you suggested, like what the Mosaic by gpt.sh did. However, I cannot deal with the l2bin and l3mapgen tool very well as I am not very clear with some parameters (such as prodtype in l2bin, produce_rgb and use_rgb in l3mapgen...).  I have posted issues of l2bin in the previous topic (https://oceancolor.gsfc.nasa.gov/forum/oceancolor/topic_show.pl?tid=8229), here is my specific steps.

Firstly, a l2 product file (rhos_nnn, Rrs_nnn) of MODIS was generated from l2gen with a subset option (south=31.2, north=31.75, west=117.25, east=117.9), the l2 filename was T2015001023000.L2_LAC_OC.

Secondly, the ONE file was binned by l2bin tool, resolve was ''H", l3bprod was "all" and prodtype was "day", other parameters were default. I think prodtype setting should have no effect on one image. Then an exception was thrown, the log file was same as the last topic.

However, when I set the flaguse to "NONE" and other field was same as previous setting, it worked and one file named "T2015001.L3b_DAY_OC" was generated. I don't know why default flaguse didn't work. This is my first question.

Then, I used the l3mapgen tool to map the l3b data from l2bin, the parameters were:
projection : smi, resolution : qkm, product: rhos_645,rhos_859,rhos_469,rhos_555,
north:   32.000, south:   31.000, east:  118.000, west:  117.000
and others were default.

The file did be produced, but the all data were NaN in SeaDAS. Because the data from l2bin cannot be opened in SeaDAS, I am not sure whether the problem was from l2bin, or, because the l3mapgen tool was set incorrectly. This is my second question.

I will uploaded regarding data(L2prod, L3b, L3m) to here: https://github.com/zgcao/SeaDAS-data, hope these were helpful for you. Please let me know if you need more details about this.

Best Regards,
Zhigang


Tags:

OB SeaDAS - dshea
Subject Matter Expert
Subject Matter Expert
Posts: 259
Joined: Thu Mar 05, 2009 10:25 am America/New_York
Answers: 0
Been thanked: 2 times

l2bin and l3mapgen issues

by OB SeaDAS - dshea » Mon May 07, 2018 1:11 pm America/New_York

Every pixel in your L2 file is invalid and flagged as HILT.  What params did you use to make the L2 file.

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

l2bin and l3mapgen issues

by OB SeaDAS - knowles » Mon May 07, 2018 1:55 pm America/New_York

Since you are trying to bin a scene and not binning based on time then set prodtype="regional".

Be aware that when you specify l3bprod="all" you are binning everything from the level2 file.  The way binning works is that for any one pixel, if any one product fails to bin for that pixel, then all products fail to bin for that pixel.  For example: if you want your rhos_nnn bands to bin over land you cannot also bin Rrs_nnn together with them because Rrs_nnn band do not contain values over land.

I just took a look at your actual file and your subset size.  I see you are doing a lake, so your region is not very many pixels.  Long story short there is no valid Rrs data in that file over that lake.  So even though you may have valid rhos data, it doesn't bin over the lake because of the non valid Rrs data.  You must bin the rhos data separately.

Regarding your use of high resolution you might want to refer to the MODIS specs to make sure this make sense (depends on what bands you are using).
https://modis.gsfc.nasa.gov/about/specifications.php

Also note that these spec resolutions are at nadir.  The pixels of your region for your particular file are at a high view angle so for these pixels the actual ground resolution is much lower than the spec resolution.

You didn't tell us at what resolution you ran l2gen so I'm assuming you used the default which is 1km.  If you want l2gen to create higher resolution files for MODIS then you must specify this when running l2gen.

If you bin at a higher resolution that your input level2 file then you will likely not get all your bins filled. 

The default flags in your file over the lake are triggered for all pixels over your lake.  Setting flaguse to "NONE" avoids this because you are using no flags.  But then the Rrs values are failing so the rhos also fails as mentioned above.

I would suggest first try to learn the l2bin and l3mapgen mechanism using a full level2 file (no subset).  Once you understand the bigger picture, how the binning and flagging are working, then apply and refine this understanding to lakes. 

Danny

zhigang
Posts: 74
Joined: Tue Nov 10, 2020 8:03 pm America/New_York
Answers: 0

l2bin and l3mapgen issues

by zhigang » Mon May 07, 2018 11:00 pm America/New_York

Dear Danny,

I appreciate that you give me so much explanations for these tools. I have tried to bin the rhos data separately, the results (i.e. rhos) of l3mapgen was normally presented in SeaDAS, this is what I want to get. The key point is : if any one product fails to bin for that pixel, then all products fail to bin for that pixel, as you suggested.

As for the lakes, I always generated the l2prod with 250 m via l2gen, therefore I can bin 250 m level-3 data by l2bin (resolve=H) and l3mapgen (resolution=qkm) tools.

Otherwise, I have downloaded some L2 data from Oceancolor Browser, to try bin all data for a full sence image, now it works well. For a list of files for different regions in same day, the prodtype was "regional", and if I want to get the monthly data, the prodtype should be "day". Indeed, these tools were very efficient to mosaicing and reproject.:grin:

Thanks again!

Regards,
Zhigang

zhigang
Posts: 74
Joined: Tue Nov 10, 2020 8:03 pm America/New_York
Answers: 0

l2bin and l3mapgen issues

by zhigang » Mon May 07, 2018 11:05 pm America/New_York

Dear Don,

For those pixels in turbid lakes, they are easily taken as cloud or sunglint, I think these caused the HILT. Now, I have solved the problem of l2bin with the help of Danny.

Regards,
Zhigang

Post Reply