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

Support MER 16 bit decompanded 8 bit images. #12

Open
godber opened this issue Jan 12, 2013 · 2 comments
Open

Support MER 16 bit decompanded 8 bit images. #12

godber opened this issue Jan 12, 2013 · 2 comments

Comments

@godber
Copy link
Contributor

godber commented Jan 12, 2013

A special case of 16 bit images is a decompanded 8 bit image as in this case:

http://pds-imaging.jpl.nasa.gov/data/mer/spirit/mer2po_0xxx/data/sol0770/edr/2p194722334esfapbcp2592r1m1.img

Which was provided as an example for Issue #11 .

The specific image provided in this sample is indeed a 16 bit storage format but the data itself is still 8 bit. This is indicated by the SAMPLE_BIT_MASK '2#0000000011111111#' and if you hexdump the image you'll confirm this when you see the data is entirely '0099 009A 0097 ...'. To properly display this image you would need to expand or "DECOMPAND" this image back to its original 12 bits (again stored in 16 bits) using LUT3 as indicated by the label: SAMPLE_BIT_MODE_ID = "LUT3" and then linearly scale it back to 8 bits.

The LUTs are publicly available at ftp://pdsimage2.wr.usgs.gov/cdroms/Mars_Exploration_Rover/Spirit/mer2mw_0xxx/document/pancam_users_guide.pdf

@godber
Copy link
Contributor Author

godber commented Jan 12, 2013

I have this fix in progress and have already extracted the LUTs into CSV.

@RyanBalfanz
Copy link
Owner

@godber, cool. If you can submit a pull request I'll happily take a look at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants