spacetelescope / imexam

imexam is a python tool for simple image examination, and plotting, with similar functionality to IRAF's imexamine
http://imexam.readthedocs.io
BSD 3-Clause "New" or "Revised" License
75 stars 45 forks source link

added cube support for view method in ds9 #102

Closed sosey closed 7 years ago

sosey commented 7 years ago

cube arrays can now be loaded using the view() method in DS9. If there are 3 dimensions, the cube dialog will open automatically in DS9.

import numpy as np
import imexam
rancube = np.ones([50, 50, 50]) * np.random.rand(50)
a=imexam.connect()
a.view(rancube)
a.zoom()
a.close()

It could be made more general. Right now it support 2 and 3 dimensional arrays, need to figure out the better way to support (y,x,z,n) arrays like this:

Filename: test_cube.fits
No.    Name         Type      Cards   Dimensions   Format
0    PRIMARY     PrimaryHDU     215   ()
1    SCI         ImageHDU        13   (1032, 1024, 35, 5)   int16
2    REFOUT      ImageHDU        13   (258, 1024, 35, 5)   int16
sosey commented 7 years ago

@stscieisenhamer pull it down and give it go!

stscieisenhamer commented 7 years ago

Chooses the wrong axis, at least compared to fits_load. Data is located in:

/grp/jwst/ssb/eisenhamer/miriteam/cube.fits

And I tried loading the data both using datamodels.open and astropy.io.fits with the same results.

stscieisenhamer commented 7 years ago

👍

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.1%) to 26.344% when pulling b7df1d66767f78292ea140d88ea7442d5b489864 on sosey:cubes into 2be6a09f55824e02dbd8ce4b2d733527aa9c9ea1 on spacetelescope:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.1%) to 26.344% when pulling b7df1d66767f78292ea140d88ea7442d5b489864 on sosey:cubes into 2be6a09f55824e02dbd8ce4b2d733527aa9c9ea1 on spacetelescope:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.02%) to 26.355% when pulling aea9722e40f1fef327da5027adab537d4b268930 on sosey:cubes into 8384ede5f7ca0adcebb6a642a0e6fc748c2948ab on spacetelescope:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.02%) to 26.355% when pulling 3a822eed117db159a1ecb45e892b0083c82d2431 on sosey:cubes into 8384ede5f7ca0adcebb6a642a0e6fc748c2948ab on spacetelescope:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.02%) to 26.355% when pulling fd6d2e6300a39fdb7bb048970d51dc83d008633b on sosey:cubes into 8384ede5f7ca0adcebb6a642a0e6fc748c2948ab on spacetelescope:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.02%) to 26.355% when pulling 274074f6621874572aa737147de183f888689243 on sosey:cubes into 8384ede5f7ca0adcebb6a642a0e6fc748c2948ab on spacetelescope:master.