Cropp and reproject problems with output format

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
cortivo
Posts: 21
Joined: Thu Mar 20, 2014 9:42 am America/New_York
Answers: 0

Cropp and reproject problems with output format

by cortivo » Wed Mar 07, 2018 9:24 am America/New_York

Hi.

The problem is with the netCDF4-CF.

Source file: A2015042183000.L2_LAC_OC.nc

If I reproject the file first and than cropp (the reprojected file) there is no problem. These are the two command lines.

reproject
gpt.sh reproject.xml -Ssource=A2015042183000.L2_LAC_OC.nc -t A2015042183000.L2_LAC_OC_reprojected.nc -f netCDF4-CF

cropp
gpt.sh subset.xml -Ssource=A2015042183000.L2_LAC_OC_reprojected.nc -t A2015042183000.L2_LAC_OC_cropp.nc -f netCDF4-CF

Note that I'm using netCDF4-CF

However, if I cropp first and than reproject, I get an error when I will try to open the reprojected file. See attached figure.

cropp
gpt.sh subset.xml -Ssource=A2015042183000.L2_LAC_OC.nc  -t A2015042183000.L2_LAC_OC_cropp.nc -f netCDF4-CF

reproject
gpt.sh reproject.xml -Ssource=A2015042183000.L2_LAC_OC_cropp.nc -t A2015042183000.L2_LAC_OC_reprojected.nc -f netCDF4-CF

In the other hand, if I use netCDF-CF the error desappear.

cropp
gpt.sh subset.xml -Ssource=A2015042183000.L2_LAC_OC.nc  -t A2015042183000.L2_LAC_OC_cropp.nc -f netCDF-CF

reproject
gpt.sh reproject.xml -Ssource=A2015042183000.L2_LAC_OC_cropp.nc -t A2015042183000.L2_LAC_OC_reprojected.nc -f netCDF-CF

This problem occours also with SST L2 files.

I prefer to use netCDF4-CF than netCDF-CF because the final size of the netCDF4-CF files is smaller than the other one format.

What could be happening?

attachment 2

attachment 3

Filters:

OB SeaDAS - knowles
Subject Matter Expert
Subject Matter Expert
Posts: 306
Joined: Mon Apr 07, 2008 4:40 pm America/New_York
Answers: 0
Been thanked: 3 times

Cropp and reproject problems with output format

by OB SeaDAS - knowles » Wed Mar 07, 2018 1:20 pm America/New_York

My concern regarding using the crop tool on a level-2 file is that the output file is no longer a level-2 file.  So then using this output file as input to the reproject tool results in no bow-effect tie corrections being applied.  The (non-OCSSW) GPT/GUI tools work well on level-3 and mapped files.  But level-2 files are not mapped, and the pixels are not necessarily sensibility aligned in the raster data, each pixel being geo-coded independent of the adjacent pixels. 

Your best bet (if on Windows) is too first reproject the level-2 file and then crop.  The opposite direction is not advised.

There are many better and quicker routes to do this (but they are not yet supported by Windows).  Are you using Windows?  If you are restricted to Windows then SeaDAS 7.5 (soon to be released) will be supporting OCSSW.

The 2 best OCSSW routes are:
1. lonlat2pixline  then  l2extract  then  Reproject tool
2. l2bin  then  l3mapgen (then Reproject tool if needed)

Danny

cortivo
Posts: 21
Joined: Thu Mar 20, 2014 9:42 am America/New_York
Answers: 0

Cropp and reproject problems with output format

by cortivo » Wed Mar 07, 2018 2:02 pm America/New_York

I use only Linux.

OK.
But why if I consider netCDF-CF format I'm able to crop than to reproject? I'm trying to do it from  this way because I'm working with the full mission of data(2002-present). So, if I can crop and than reproject I will not spend to much time.

Fabio.

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

Cropp and reproject problems with output format

by zhigang » Thu Mar 08, 2018 2:25 am America/New_York

As Danny said, the reprojection can only identify the file generated by l2gen, you cannot use the cropping file to make reprojection. Actually, the reprojection is slow for an entire image than a cropping file. I suggested that you can generated a regional file of L2_LAC_OC.nc via adapting the subset parameters in l2gen GUI, and then reprojection is fast. :)

Best,
Zhigang

cortivo
Posts: 21
Joined: Thu Mar 20, 2014 9:42 am America/New_York
Answers: 0

Cropp and reproject problems with output format

by cortivo » Thu Mar 08, 2018 1:32 pm America/New_York

Hi.

I think I could not express myself in a right way.

The problem is about the output format of the file: netCDF-CF and netCDF4-CF.

If I ask to Seadas to save the output files (the cropped and reprojected files) as a netCDF-CF format (remember gpt.sh ......... -f netCDF-CF) I'm able to crop first and then reproject. The reprojected files can be open by seadas gui without any error.

On the other hand, if I ask to Seadas to save the output files (the cropped and reprojected files) as a netCDF4-CF format (gpt.sh .... -f netcdf4-CF) the cropped file can be open by Seadas GUI but the reprojected file cannot. If I try to do it (open the reprojected file) I get an error message from Seadas as I explained in the first post.

Whats the difference between netCDF-CF and netCDF4-CF and why if the output format is netCDF-CF I can crop and then reproject?

Fabio.

OB SeaDAS - knowles
Subject Matter Expert
Subject Matter Expert
Posts: 306
Joined: Mon Apr 07, 2008 4:40 pm America/New_York
Answers: 0
Been thanked: 3 times

Cropp and reproject problems with output format

by OB SeaDAS - knowles » Fri Mar 09, 2018 9:43 am America/New_York

As I explained in my first post, you cannot crop a level-2 file and then reproject.  Sure you can do it and it may appear to work in one format and fail in other, but the result is NOT going to be correct for pixels at higher sensor view angles (no bow tie correction is applied).  Level-2 files are a special case scenario of unmapped data and need to be dealt with in a particular way.  Any form of remapping using the non OCSSW tools (Reproject, Mosaic, ...) MUST occur directly on the level-2 file.

Regarding your specific question: the netCDF4-CF format failure is because it invokes a file reader that apparently understands there is a formatting issue, the netCDF-CF format is generic and does not detect the problem.  But that doesn't mean there isn't a problem and there is no guarantee that using the netCDF4-CF format will detect the problem.  Again don't use Crop followed Reproject when the source is a level2 file.

You have Linux, so you can use the OCSSW tools.  Essentially, for doing a whole mission you will want to do these steps:
0. lonlat2pixline then l2extract on each level2 file to create level2 extract files.  (optional step)*
1. l2bin on each day (input is multiple level2 files or level2 extract files) to create daily bin files. 
2. l3bin to combine all the daily bin files into a mission composite bin file.
3. l3mapgen to create a mission composite map from the mission composite bin file. 
Note: step 0 may decrease the level3 bin file sizes and/or may decrease total processing time depending on the extents of your specified region.

An additional note:  there is a mechanism for ordering custom extracted level2 files via the level-2 browser https://oceancolor.gsfc.nasa.gov/cgi/browse.pl .  But for the whole mission this may take a quite while before you receive all the extracted files.  The extracted l2file could then be used by either the Reproject tool or the OCSSW tools.

A summary note: running l2extract on a level2 file creates a cropped file which is a level2 file.  However, running gpt/GUI Subset tool on a level2 file creates a cropped file which is not a level2 file.

Danny

Post Reply