planetarypy / planetaryimage

Python PDS and Isis Cube file parser.
BSD 3-Clause "New" or "Revised" License
40 stars 20 forks source link

Merging Trevor's code reorganization #50

Closed godber closed 8 years ago

godber commented 8 years ago

This reorganizes the code a bit and in the process changes the interface to the data!!! The changes include the following:

godber commented 8 years ago

I will be pushing updates to the docs soon. pdsview will need to be updated to handle the new data interface.

godber commented 8 years ago

Broke the build, embarrassed, remember, before you push:

make test
make test-all
make lint
godber commented 8 years ago

Nevermind, I am not fixing the docs for this. It would be much easier just to write the convenience interfaces that make working with the images practical.

Nesting dstack and hstack to do this was more than I could handle:

plt.imshow(np.hstack([
       mcam1.data[700:1100, 600:1000, 0],
       mcam1.data[700:1100, 600:1000, 1],
       mcam1.data[700:1100, 600:1000, 2],
   ]), cmap='gray')
wtolson commented 8 years ago

That looks broken above, did it read in the file (line, sample, band) instead of (band, line, sample)?

godber commented 8 years ago

Ugh, this doctest is still failing, now because its running headless. :(

godber commented 8 years ago

Ignore that code snippet with hstack that was how PDS3Image used to work before your changes.

I have introduced a new property image which is basically data reorganized so that it is in the order expected by PIL and the entire ecosystem of python image processing tools (line, sample, band). I have updated the docs to show how to use it with this interface:

https://github.com/godber/planetaryimage/blob/wtolson-dev-merge/docs/usage.rst

So basically we have:

I'd be interested to eventually see some documentation that shows uses how to use the .data interface.