Gmljp2 output seems empty/broken.

Description

On my OS-X dev system, when I issue this BES command:

I get a geotiff file that's understood by UDig and I can make a picture of the geotiss on my screen (attached).

But when I issue this BES command:

I get back a jpeg2000 image (attached) that appears to be a uniform grey rectangle.

Environment

None

Activity

Show:
Nathan Potter
December 26, 2012, 7:48 PM

Attachment coads_climatology-1.nc.geotiff.tiff has been added with description: Geotiff returned by http://localhost:8080/opendap/data/nc/coads_climatology.nc.geotiff?SST[5][][]

Nathan Potter
December 26, 2012, 7:49 PM

Attachment coads_climatology.nc.gmljp2.jp2 has been added with description: jpeg2000 file returned by http://localhost:8080/opendap/data/nc/coads_climatology.nc.gmljp2?SST[5][][]

James Gallagher
January 9, 2018, 3:14 PM

Slav, Please take a look at this and see if it's old and should be closed or still a problem and should be investigated. Don't let this derail your current work - I just didn't want it to be lost when it came up in my search. (I noticed that you were not a 'Developer' on this 'Project,' so you might not have seen it in your searches.)

Thanks,
James

James Gallagher
February 25, 2019, 11:29 PM
Edited

Take a look at the two screen shots I added today (2019-02-25). These are from geotiff data - so they are NOT jp2k files. However, they show somethign interesting about rendering these 'science data' files. The missing data are often indicated by very large or very small values (e.g., 9999) and rendering code often doesn't know this. Since JP2k is a JPEG file, it's 'rendered' and if it assumes the data are between -16 and 9999 we'll get a picture, with most of the variation between -16 and 16 lost. When I reset the range from the automatically chosen values to -16 to 16, all the sudden we get a much better picture. Maybe that's what was happening with the JP2k response?

One way to fix this would be to have the fileout_gdal code look for missing values and then set the data range to be something that does not include that. We might have to write a function that finds the min & max values for an array and (optionally) excludes a value (e.g. the missing data value) from that computation.

Slav Korolev
March 13, 2019, 1:11 PM

Output GeoTiff and Jpeg2000 files are valid and visually can be improved without changing code as following:
1. Open image with Preview.app in MacOS. Click Tools ->Adjust Color... -> Auto Level. In this case we get black and wight image.
2. Use gdal_translate:
gdal_translate -scale in.tif out.tif
gdal_translate -scale in.jp2 in.jp2
In this case we get grey levels.

Assignee

Slav Korolev

Reporter

Nathan Potter

Labels

None

Fix versions

None

Time remaining

0m

Story Points

5

Priority

Medium
Configure