Closed godber closed 8 years ago
I will be pushing updates to the docs soon. pdsview
will need to be updated to handle the new data
interface.
Broke the build, embarrassed, remember, before you push:
make test
make test-all
make lint
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')
That looks broken above, did it read in the file (line, sample, band)
instead of (band, line, sample)
?
Ugh, this doctest is still failing, now because its running headless. :(
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:
.data
- disk layout, (band, line, sample)
.image
- PIL layouy (line, sample, band)
I'd be interested to eventually see some documentation that shows uses how to use the .data
interface.
This reorganizes the code a bit and in the process changes the interface to the data!!! The changes include the following:
(1024, 1024)
to(1, 1024, 1024)
. This is so all bands are accessed in the same way regardless of whether its a 1, 2, 3 or N band image.