pyspeckit / pyspeckit

Python Spectroscopic Toolkit
MIT License
103 stars 83 forks source link

Cropping a spectral cube drops the header #101

Open jpinedaf opened 9 years ago

jpinedaf commented 9 years ago

Following the example of the N2H+ cube I noticed that the header is dropped from the structure when cropping. Is this a feature or a bug?

In [18]: cube = pyspeckit.Cube(file_in)[:,158:366,199:373]

In [19]: cube2 = pyspeckit.Cube(file_in)

In [20]: cube.header
Out[20]: 

In [21]: cube2.header
Out[21]: 
SIMPLE  =                    T / conforms to FITS standard                      
BITPIX  =                  -32 / array data type                                
NAXIS   =                    3                                                  
NAXIS1  =                  512                                                  
NAXIS2  =                  512                                                  
NAXIS3  =                  327                                                  
BMAJ    =   4.686255256335E-04                                                  
BMIN    =   2.803802821371E-04                                                  
BPA     =   5.841445541382E+01                                                  
keflavich commented 9 years ago

Bug. For now, do cropping using spectral_cube, not pyspeckit.Cube.