Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isis2std bittype=s16bit exports a tiff with Type=UInt16 #4897

Closed
ryodohemmi opened this issue Apr 12, 2022 · 0 comments · Fixed by #4983
Closed

isis2std bittype=s16bit exports a tiff with Type=UInt16 #4897

ryodohemmi opened this issue Apr 12, 2022 · 0 comments · Fixed by #4983
Assignees
Labels
bug Something isn't working

Comments

@ryodohemmi
Copy link

ryodohemmi commented Apr 12, 2022

ISIS version(s) affected: 5.0.1

Description
isis2std bittype=s16bit outputs UInt16 (16-bit unsigned integer) tif, not Int16 (signed) tif.

How to reproduce
Input: Int16 cube

$ gdalinfo h5851_0002_sr2.cal2.cub
Driver: ISIS3/USGS Astrogeology ISIS cube (Version 3)
Files: h5851_0002_sr2.cal2.cub
Size is 1008, 1018
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0, 1018.0)
Upper Right ( 1008.0,    0.0)
Lower Right ( 1008.0, 1018.0)
Center      (  504.0,  509.0)
Band 1 Block=1008x1018 Type=Int16, ColorInterp=Undefined
  NoData Value=-32768
  Mask Flags: 
  Metadata:
    BANDWIDTH=250.000000
    BANDWIDTH_UNIT=nm
    WAVELENGTH=600.000000
    WAVELENGTH_UNIT=nm

Running isis2std bittype=s16bit and its result

$ isis2std from=h5851_0002_sr2.cal2.cub to=h5851_0002_sr2.cal2.tif format=tiff bittype=s16bit
Group = Results
  OutputFileName = h5851_0002_sr2.cal2.tif
  InputMinimum   = 726.0
  InputMaximum   = 1602.0
End_Group

$ gdalinfo h5851_0002_sr2.cal2.tif
Driver: GTiff/GeoTIFF
Files: h5851_0002_sr2.cal2.tif
Size is 1008, 1018
Coordinate System is `'
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0, 1018.0)
Upper Right ( 1008.0,    0.0)
Lower Right ( 1008.0, 1018.0)
Center      (  504.0,  509.0)
Band 1 Block=1008x1 Type=UInt16, ColorInterp=Gray

Additional context
Running isis2std bittype=u16bit results in a UInt16 tif, which looks fine.

$ isis2std from=h5851_0002_sr2.cal2.cub to=h5851_0002_sr2.cal2.tif format=tiff bittype=u16bit
Group = Results
  OutputFileName = h5851_0002_sr2.cal2.tif
  InputMinimum   = 726.0
  InputMaximum   = 1602.0
End_Group

$ gdalinfo h5851_0002_sr2.cal2.tif
Driver: GTiff/GeoTIFF
Files: h5851_0002_sr2.cal2.tif
Size is 1008, 1018
Coordinate System is `'
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0, 1018.0)
Upper Right ( 1008.0,    0.0)
Lower Right ( 1008.0, 1018.0)
Center      (  504.0,  509.0)
Band 1 Block=1008x1 Type=UInt16, ColorInterp=Gray

The similar issue was reported in the past for both tiff and jpeg2000 formats: #1735
The signed 16 bit format is commented out in the source code:
https://github.com/USGS-Astrogeology/ISIS3/blob/7.0/isis/src/base/apps/isis2std/tsts/tiff/Makefile

@ryodohemmi ryodohemmi added the bug Something isn't working label Apr 12, 2022
@jessemapel jessemapel self-assigned this Jul 6, 2022
@jlaura jlaura moved this to Needs Review in FY22 Q4 Support Jul 8, 2022
Repository owner moved this from Needs Review to Done in FY22 Q4 Support Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants