16 bit integer representations

Skip PackSkip Pack Global Mapper UserPosts: 7
edited October 2012 in Technical Support
I am reading a hyperspectral Geotiff created by gdal_translate and converting it to a
multiband (containing only one band) .bil with the following .gms script in GM 13 (latest):

GLOBAL_MAPPER_SCRIPT VERSION=1.00
UNLOAD_ALL


IMPORT FILENAME="J:\neptec\profiling\Neon\test1\radgrid\test1_atm.tif" \
TYPE=GEOTIFF \
BAND_SETUP="1,1,1"


EXPORT_RASTER FILENAME="J:\neptec\profiling\Neon\test1\radgrid\atm1_b1.bil" \
TYPE=BIL \
GEN_WORLD_FILE=YES \
GEN_PROJ_FILE=YES \
PALETTE=MULTIBAND \
NUM_BANDS=1 \
BAND_BIT_DEPTH=16 \
BAND_EXPORT_SETUP=1?1?


UNLOAD_ALL

The data type in the ENVI .hdr file is 2, representing a signed 16 bit integer. My output from the
.bil file contains values from 32768 to 35462. This looks like it might have become a signed 16 bit
integer where what should be 0 (zero) is halfway up the range of the unsigned representation.
Can I dump and analyze the numeric representation of the pixel values in the input Geotiff to see
if the problem is on the gdal or GM side?

thanks,

Skip Pack

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited October 2012
    For raster layers Global Mapper always treats the samples for high bit depth values as unsigned 16-bit, so the signed 16-bit values in the original file would be converted to unsigned values, so anything negative would become positive values over 32768. Is there any way for you to shift the values into the positive-only spectrum (i.e. add 32768 if you have negative values to make the range 0 to 65535)?

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
  • Skip PackSkip Pack Global Mapper User Posts: 7
    edited October 2012
    Thanks, That's what I thought, but confirmation is a good thing.

    Skip
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited October 2012
    Skip,

    Actually I might want to go ahead and add support for these signed 16-bit samples. Do you have a sample file?

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
  • Skip PackSkip Pack Global Mapper User Posts: 7
    edited October 2012
    Mike,

    This is public data, so I can provide a file. This is ENVI format as I got it with a
    .bsq file of the hyperspectral data and an accompanying ENVI .hdr file. I then used
    gdal_translate to turn it into a geotiff. Perhaps GM can do this, but I couldn't find
    and obvious way. I then used GM to (via the GMS script to extract several of the
    224 bands from the geotiff. The .bs1 and geotiff are 1.3GB. I could put one or both
    on an ftp server. At the moment, at least, I don't have anything smaller.

    Skip
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited October 2012
    Skip,

    The size is fine. You can put them on an FTP server. If you don't have one you can FTP them to ftp.globalmapper.com with a username of 'upload@globalmapper.com' and a password of 'upload'.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
  • Skip PackSkip Pack Global Mapper User Posts: 7
    edited October 2012
    Mike,

    Which file(s) do you want -- The .bsq/.hdr combo, the geotiff, or all of them?

    Skip
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited October 2012
    Skip,

    Does the GeoTIFF have signed 16-bit samples? Definitely the .bsq/.hdr combo, but if the GeoTIFF also has signed 16-bit values that would be handy as well.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
Sign In or Register to comment.