Using GPT's WriteImage Operator to output GeoTIFF

Please enter here to ask a question about any NASA Science related topics!
OB SeaDAS - knowles
Subject Matter Expert
Subject Matter Expert
Posts: 221
Joined: Mon Apr 07, 2008 4:40 pm America/New_York

Using GPT's WriteImage Operator to output GeoTIFF

by OB SeaDAS - knowles » Tue Dec 05, 2017 8:28 am America/New_York

This may now be obvious, but to add to the response by gnwii, their is only one resultant product/band in your workflow and it is "sst".  The "band_1" you are seeing is "sst" and its misleading name is not referring to any source VIIRS bands or anything of that nature.
Danny

Tags:

simkins
Posts: 21
Joined: Wed Oct 18, 2017 10:25 pm America/New_York

Using GPT's WriteImage Operator to output GeoTIFF

by simkins » Tue Dec 05, 2017 2:08 pm America/New_York

Ah I see, thanks for the information. My next question then is this; if I'm not applying any masks on my own (though I think there are default masks that are applied), why are there such drastic differences between my L2 sst and the L3mapgen sst? Please see attached png's. My guess is that there is that the color gradient isn't working properly because there does appear to be data there. Any idea on how to fix this?

Thanks!


gnwiii
Posts: 605
Joined: Fri Jan 29, 2021 5:51 pm America/New_York
Answers: 1

Using GPT's WriteImage Operator to output GeoTIFF

by gnwiii » Tue Dec 05, 2017 5:54 pm America/New_York

When you look at level-2 SST you also need to consider the quality level.   The default for l2bin (qual_max  = maximum acceptable quality [default=2]) may not be appropriate for your "use case".

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

Using GPT's WriteImage Operator to output GeoTIFF

by OB SeaDAS - knowles » Wed Dec 06, 2017 11:08 am America/New_York

Note: Although VIIRS does contain 5 I-bands at 375m nadir spatial resolution, we are currently only supporting the 16 M-bands which are at 750m nadir spatial resolution.  (see instrument specs: https://ncc.nesdis.noaa.gov/documents/d ... a-v1.3.pdf)You do need to define many parameters correctly in order to best achieve your desired pixel retention and resolutions.I will put together a short case-study example FAQ on using the OCSSW processors to create a mapped VIIRS SST file from a source level-2 SST file and post a link to it here soon this week.Danny

simkins
Posts: 21
Joined: Wed Oct 18, 2017 10:25 pm America/New_York

Using GPT's WriteImage Operator to output GeoTIFF

by simkins » Wed Dec 06, 2017 2:07 pm America/New_York

Thanks! I had to run it with qual_max set to 4 for it to work. Now I'm trying to reproject and mosaic this using GPT. I've set the name argument in the xml to "band_1" as that is what l3mapgen renames the data in the TIFF to. Unfortunately, gpt can't seem to recognize that and I'm getting this error;

Missing data type for band band_1.

Attached is my xml. Thank you for your continued support!
attachment 1

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

Using GPT's WriteImage Operator to output GeoTIFF

by OB SeaDAS - knowles » Thu Dec 07, 2017 8:54 am America/New_York

It would be easier to use netCDF4 as the output of l3mapgen and then the input for gpt.

It isn't clear why you need the bandMaths node but it is incorrect and incomplete in your xml workflow file.  You are only defining a name for your new band, you also have to at least define <type> and <expression> when creating a new band.   Something of the nature:
<targetBand>
    <name>sst</name>
    <type>float64</type>
     <expression>band_1</expression>
     <noDataValue>NaN</noDataValue>
</targetBand>

Assuming of course that gpt recognizes "band_1"  in your tiff.  I have not tried this out.  Let us know if it works.

Danny

simkins
Posts: 21
Joined: Wed Oct 18, 2017 10:25 pm America/New_York

Using GPT's WriteImage Operator to output GeoTIFF

by simkins » Thu Dec 07, 2017 9:48 am America/New_York

Hi Danny,

So by adding that to my XML, it successfully ran! I was able to then run my mosaic XML where I was able to specify everything I needed. Unfortunately, the image wasn't what I was hoping (see mosaic.reprojected.tif). My motivation in doing this is to output a reprojected and mosaiced grayscale TIF. I realize that doing l2gen and reproject/mosaic via netCDF4 would be better , but I ran into the trouble of the WriteImage operator not being able to output to a TIF.

I've tried a few different methods, including using the Write Operator to output a TIFF...but the other trouble I ran into was not being able to open the TIF for viewing without the help of R...for whatever reason the output of the TIF I was creating was a big-endian TIF and Preview couldn't recognize it, which would make life easier. I need to use reproject and mosaic to remove the bowtie effect on my VIIRS imaging and to specify exact pixel sizing and domains.

Given all of this information, what would be the best course of action to go from l2 VIIRS files to reprojected, mosaiced TIFF in grayscale? Will I need to use R/Python to take the final step for the grayscale?

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

Using GPT's WriteImage Operator to output GeoTIFF

by OB SeaDAS - knowles » Thu Dec 07, 2017 11:41 am America/New_York

Regarding  "I need to use reproject and mosaic to remove the bowtie effect on my VIIRS imaging... ",
when you run l2bin, at that point the bowtie correction is applied, so your file output from l3mapgen is already bowtie corrected. 

Note: bowtie correction can only be applied when your source file is a level2 file, if you go to level3 then subsequently bowtie correction is not applied.

The program l3mapgen itself has tons of projections (including mercator) using the proj4 syntax and you can give l3mapgen a precise resolution of 750 or 375, etc., perhaps this will work?

When you mention "the output of the TIF I was creating was a big-endian TIF and Preview couldn't recognize it", are you referring to file output by l3mapgen?

As mentioned earlier in this thread: "In SeaDAS 7.5 (coming soon) the WriteImage operator will support GeoTIFF. "     

Danny

simkins
Posts: 21
Joined: Wed Oct 18, 2017 10:25 pm America/New_York

Using GPT's WriteImage Operator to output GeoTIFF

by simkins » Thu Dec 07, 2017 2:22 pm America/New_York

Thanks for the information. I will try and use l2bin and l3mapgen for everything now.

I need it to be 1100m x 1100m resolution. What should I be setting my l2bin resolution size to since I can't specify it to be 1100x1000m?

OB WebDev - norman
Subject Matter Expert
Subject Matter Expert
Posts: 136
Joined: Tue Feb 09, 2021 8:19 am America/New_York

Using GPT's WriteImage Operator to output GeoTIFF

by OB WebDev - norman » Thu Dec 07, 2017 4:26 pm America/New_York

Hi Simkins,

I've been following this thread and think it might be useful if you could
describe exactly what input products you are using and what end result
you are trying to achieve.  It sounds to me like you want to map level-2
SST data to some sort of equal-area projection having pixels that are
roughly 1.21 square kilometers in area. (Note that, for a larger area
like you show in your examples, it is impossible for a flat representation
of the round Earth to have all of it's pixels be 1100 by 1100 meter square
areas.)

It would also be helpful to know why you have the requirements that you do.
Are you trying to match an already existing map?  If so, it would be helpful
to know the projection of that map.

Usually, when I make images from level-2 data, I follow these steps.

1. Choose a projection.
2. Convert the lat/lon of each level-2 pixel to Cartesian coordinates using
   the chosen projection.
3. Grid the projected data using a nearest neighbor algorithm.
4. Scale the gridded pixel values to fall into a range that is suitable
   for showing the features that I am trying to highlight.
5. Convert the resulting raster into the desired image format (e.g.
   JPEG, PNG, TIFF, etc.).

I'm not a SeaDAS expert, so I tend to use other methods, but I suspect
that SeaDAS can probably do what you want. I think you just need to be more
specific about the exact result you are looking for.

Regards,
Norman

Post Reply