radio-astro-tools / spectral-cube

Library for reading and analyzing astrophysical spectral data cubes
http://spectral-cube.rtfd.org
BSD 3-Clause "New" or "Revised" License
95 stars 61 forks source link

Velocity coordinate of world object being malformed #38

Closed low-sky closed 10 years ago

low-sky commented 10 years ago

WCS objects are returning the correct velocity for a header but when called via SpectralCube, the coordinate is offset by a large number of pixels.

input_file = '/Users/erosolo/code/noodle/m33.co32.fits'
cube = read(input_file,format='fits')
wcs = WCS(input_file)

cube.world[0,0,0]
[<Quantity -180455.057 m / s>,
 <Quantity 30.448590581045757 deg>,
 <Quantity 24.047305426601568 deg>]

wcs.all_pix2world(0,0,0,0)
[array(24.047305426601568),
 array(30.448590581045757),
 array(-299455.05700000003)]
ChrisBeaumont commented 10 years ago

taking a look

low-sky commented 10 years ago

hdr

Out[74]:

SIMPLE  =                    T / file does conform to FITS standard             
BITPIX  =                  -32 / number of bits per data pixel                  
NAXIS   =                    3 / number of data axes                            
NAXIS1  =                  382 / length of data axis 1                          
NAXIS2  =                  382 / length of data axis 2                          
NAXIS3  =                  350 / length of data axis 3                          
EXTEND  =                    T / FITS dataset may contain extensions            
COMMENT   FITS (Flexible Image Transport System) format is defined in 'Astronomy
COMMENT   and Astrophysics', volume 376, page 359; bibcode: 2001A&A...376..359H 
LBOUND1 =                 -189 / Pixel origin along axis 1                      
LBOUND2 =                 -190 / Pixel origin along axis 2                      
LBOUND3 =                 -175 / Pixel origin along axis 3                      
LABEL   = 'T%s60+%v30+A%^50+%<20+*%+   corrected antenna temperature'/ Label of 
DATE    = '2012-03-09T23:19:06'/ file creation date (YYYY-MM-DDThh:mm:ss UT)    
ORIGIN  = 'Joint Astronomy Centre, Hilo'/ Origin of file                        
BSCALE  =                  1.0 / True_value = BSCALE * FITS_value + BZERO       
BZERO   =                  0.0 / True_value = BSCALE * FITS_value + BZERO       
HDUCLAS1= 'NDF     '           / Starlink NDF (hierarchical n-dim format)       
HDUCLAS2= 'DATA    '           / Array component subclass                       
HDSTYPE = 'NDF     '           / HDS data type of the component                 
TELESCOP= 'JCMT    '           / Name of Telescope                              

        ---- x,y,z triplet for JCMT relative to centre of earth ----            
ALT-OBS =               4120.0 / [m] Height of observatory above sea level      
LAT-OBS =          19.82283891 / [deg] Latitude of Observatory                  
LONG-OBS=         -155.4770278 / [deg] East longitude of observatory            

        ---- WCS info and axis descriptions ----                                

        ---- OMP and ORAC-DR Specific ----                                      
PROJECT = 'M09BN04 '           / PATT number                                    
RECIPE  = 'REDUCE_SCIENCE_GRADIENT'/ ORAC-DR recipe                             
DRGROUP =                      / Data Reduction group ID                        
SURVEY  =                      / Survey Name                                    
RMTAGENT=                      / Name of Remote Agent                           
AGENTID =                      / Unique identifier for remote agent             

        ---- Obs Id, Date, Pointing Info ----                                   
OBJECT  = 'M33     '           / Object of interest                             
STANDARD=                    F / True if the spectral line is a standard        
DATE-OBS= '2009-08-06T12:29:21.044'/ Date of observation                        
CRPIX1  =                191.0 / Reference pixel on axis 1                      
CRPIX2  =                192.0 / Reference pixel on axis 2                      
CRPIX3  =                176.0 / Reference pixel on axis 3                      
CRVAL1  =              23.4625 / Value at ref. pixel on axis 1                  
CRVAL2  =          30.66027778 / Value at ref. pixel on axis 2                  
CRVAL3  =          -124.455057 / Value at ref. pixel on axis 3                  
CTYPE1  = 'RA---TAN'           / Type of co-ordinate on axis 1                  
CTYPE2  = 'DEC--TAN'           / Type of co-ordinate on axis 2                  
CTYPE3  = 'VRAD    '           / Type of co-ordinate on axis 3                  
CDELT1  =      -0.002027777831 / Pixel size on axis 1                           
CDELT2  =       0.002027777831 / Pixel size on axis 2                           
CDELT3  =                  1.0 / Pixel size on axis 3                           
PC1_1   =         0.9238795325 / Transformation matrix element                  
PC1_2   =         0.3826834324 / Transformation matrix element                  
PC2_1   =        -0.3826834324 / Transformation matrix element                  
PC2_2   =         0.9238795325 / Transformation matrix element                  
CUNIT3  = 'km/s    '           / Units for axis 3                               
MJD-OBS =          55049.52038 / Modified Julian Date of observation            
RADESYS = 'FK5     '           / Reference frame for RA/DEC values              
EQUINOX =               2000.0 / [yr] Epoch of reference equinox                
SPECSYS = 'LSRK    '           / Standard of rest for spectral axis             
SSYSSRC = 'LSRK    '           / Standard of rest for source redshift           
ZSOURCE =      -6.000550891E-4 / [] Redshift of source                          
VELOSYS =         -26774.13703 / [m/s] Topo. apparent velocity of rest frame    
RESTFRQ =      3.457959899E+11 / [Hz] Rest frequency                            
IMAGFREQ=      3.358028759E+11 / [Hz] Image frequency                           
OBSGEO-X=         -5461060.909 / [m] Observatory geocentric X                   
OBSGEO-Y=         -2491393.621 / [m] Observatory geocentric Y                   
OBSGEO-Z=          2149257.916 / [m] Observatory geocentric Z                   
DATE-END= '2010-01-02T09:28:22'/ UTC Datetime of end of observation             
DUT1    =       2.679966243E-6 / [d] UT1-UTC correction                         
INSTAP  =                      / Receptor at tracking centre (if any)           
INSTAP_X=                  0.0 / [arcsec] Aperture X off. rel. to instr centre  
INSTAP_Y=                  0.0 / [arcsec] Aperture Y off. rel. to instr centre  
AMSTART =          1.221228386 / Airmass at start of obervation                 
AMEND   =           1.92543952 / Airmass at end of obervation                   
AZSTART =          424.6529774 / [deg] Azimuth at obs. start - mount sys.       
AZEND   =          294.6111973 / [deg] Azimuth at obs. end - mount sys.         
ELSTART =          54.97852433 / [deg] Elevation at obs. start - mount sys.     
ELEND   =          31.07970495 / [deg] Elevation at obs. end - mount sys.       
TRACKSYS= 'J2000   '           / TCS Tracking coordinate system                 
BASEC1  =              23.4625 / [deg] TCS BASE position (longitude) in TRACKSYS
BASEC2  =          30.66019444 / [deg] TCS BASE position (latitude) in TRACKSYS 
HSTSTART= '2009-08-06T02:28:47'/ HST at start of observation                    
HSTEND  = '2010-01-01T23:28:22'/ HST at end of observation                      
LSTSTART= '23:07:35.6228'      / LST at start of observation                    
LSTEND  = '05:54:07.3116'      / LST at end of observation                      

        ---- Integration time related -----                                     

        ---- ACSIS Specific ----                                                
BACKEND = 'ACSIS   '           / Name of the backend                            
MOLECULE= 'CO      '           / Target molecular species                       
TRANSITI= '3  - 2  '           / Target transition for MOLECULE                 
DRRECIPE= 'scan_pssw_dr_recipe.ent'/ ACSIS-DR recipe name                       
BWMODE  = '1000MHzx2048'       / ACSIS total bandwidth set up                   
SUBSYSNR=                    1 / Sub-system number                              
SUBBANDS= '1000MHzx2048'       / ACSIS sub-band set up                          
NSUBBAND=                    1 / Number of subbands                             
SUBREFP1=               1024.0 / Reference channel for subband1                 
SUBREFP2=                      / Reference channel for subband2                 
NCHNSUBS=                 2048 / No. of channels in this sub-system             
REFCHAN =               1024.0 / Reference IF channel No.                       
IFCHANSP=            488281.25 / [Hz] TOPO IF channel spacing (signed)          
FFT_WIN = 'truncate'           / Type of window used for FFT                    
BEDEGFAC=                 1.23 / Backend degradation factor                     
MSROOT  = 'raw_raster'         / Root name of raw measurement sets              

        ---- FE Specific ----                                                   
INSTRUME= 'HARP    '           / Front-end receiver                             
SB_MODE = 'SSB     '           / Sideband mode                                  
IFFREQ  =                  5.0 / [GHz] IF Frequency                             
OBS_SB  = 'USB     '           / The observed sideband                          
LOFREQS =          341.0344962 / [GHz] LO Frequency at start of obs.            
LOFREQE =          340.9718724 / [GHz] LO Frequency at end of obs.              
REFRECEP= 'H05     '           / Receptor with unit sensitivity                 
TEMPSCAL= 'TA*     '           / Temperature scale in use                       
DOPPLER = 'radio   '           / Doppler velocity definition                    
SSYSOBS = 'TOPOCENT'           / Spectral ref. frame during observation         
NFREQSW =                      / Number of frequency switches                   
FREQ_THR=                      / [MHz] The throw used in the frequency switch   
TSPSTART=          286.2226197 / [K] Temperature of the building at start of obs
TSPEND  =          283.5162463 / [K] Temperature of the building at end of obser

        ---- Environmental Data ----                                            
ATSTART =                  4.4 / [degC] Air temp at start                       
ATEND   =                  3.0 / [degC] Air temp at end                         
HUMSTART=                 15.6 / Rel. Humidity at start                         
HUMEND  =                  4.5 / Rel. Humidity at end                           
BPSTART =          625.2000122 / [mbar] Pressure at start                       
BPEND   =          623.4000244 / [mbar] Pressure at end                         
TAU225ST=                0.077 / Tau at 225 GHz from CSO at start               
TAU225EN=                0.091 / Tau at 225 GHz from CSO at end                 
TAUDATST= '2009-08-06T12:20:00'/ Time of TAU225ST observation                   
TAUDATEN= '2010-01-02T09:10:00'/ Time of TAU225EN observation                   
WVMTAUST=         0.1174788326 / 186GHz Tau from JCMT WVM at start              
WVMTAUEN=         0.1368054599 / 186GHz Tau from JCMT WVM at end                
WVMDATST= '2009-08-06T12:28:24'/ Time of WVMTAUST                               
WVMDATEN= '2010-01-02T09:28:11'/ Time of WVMTAUEN                               
SEEINGST=                      / [arcsec] SAO atmospheric seeing (start)        
SEEINGEN=                      / [arcsec] SAO atmospheric seeing (end)          
SEEDATST=                      / Date/Time of SEEINGST                          
SEEDATEN=                      / Date/Time of SEEINGEN                          
FRLEGTST=             7.888568 / [degC] Mean Front leg temperature - Start      
FRLEGTEN=            4.5167045 / [degC] Mean Front Leg temperature -End         
BKLEGTST=          8.617524333 / [degC] Mean back leg temperature -Start        
BKLEGTEN=          5.156598667 / [degC] Mean back leg temperature -End          

        ---- Switching and Map setup for the observation ----                   
SAM_MODE= 'scan    '           / Sampling Mode                                  
SW_MODE = 'pssw    '           / Switch Mode: CHOP, PSSW, NONE, etc             
INBEAM  =                      / Hardware in the beam                           
SKYREFX = '[OFFSET] 1100 [J2000]'/ X co-ord of Reference Position               
SKYREFY = '[OFFSET] -450 [J2000]'/ Y co-ord of Reference Position               
OBS_TYPE= 'science '           / Type of observation                            
CHOP_CRD=                      / Chopping co-ordinate system                    
CHOP_FRQ=                      / [Hz] Chop frequency                            
CHOP_PA =                      / [deg] Chop PA; 0=in lat, 90=in long            
CHOP_THR=                      / [arcsec] Chop throw                            
JIGL_CNT=                      / Number of offsets in jiggle pattern            
JIGL_NAM=                      / File containing the jiggle offsets             
JIG_PA  =                      / [deg] Jiggling PA; 0=in lat, 90=in long        
JIG_CRD =                      / Jiggling co-ordinate system                    
JIG_SCAL=                      / [arcsec] Scale of jiggle pattern               
MAP_HGHT=               1200.0 / [arcsec] Requested height of map               
MAP_PA  =                 22.5 / [deg] Requested PA of map                      
MAP_WDTH=               1200.0 / [arcsec] Requested width of map                
LOCL_CRD= 'TRACKING'           / Local offset/map PA co-ordinate system         
MAP_X   =                  0.0 / [arcsec] Requested map offset from tel centre  
SCAN_CRD= 'TRACKING'           / Co-ordinate system for scanning direction      
SCAN_VEL=          48.50733333 / [arcsec/sec] Scan velocity along scan axis     
SCAN_DY =              29.1043 / [arcsec] Scan spacing perp. to scan axis       
SCAN_PAT= 'DISCRETE_BOUSTROPHEDON'/ Scan pattern name                           

        ---- SMU ----                                                           

        ---- JOS parameters ----                                                
STEPTIME=                 0.15 / RTS step time during an RTS sequence           
NUM_CYC =                    1 / Number of times to repeat entire recipe        
JOS_MULT=                      / MULT from JOS used in total steps calculation  
JOS_MIN =                    1 / MIN from JOS used in total steps calculation   
NUM_NODS=                      / Number of times to repeat nod set              
NCALSTEP=                   33 / Number of RTS steps for each CAL (if any)      
STBETREF=                  200 / Target number of RTS steps between refs        
STBETCAL=                12000 / Target number of RTS steps between cals        
FOCAXIS =                      / Focus Axis to move (X, Y, Z)                   
NFOCSTEP=                      / Number of focal position steps (odd number)    
FOCSTEP =                      / Distance between focus steps                   

        ---- Miscellaneous ----                                                 
SIM_CORR=                    F / True if any CORRTASK is simulated              
SIM_IF  =                    F / True if IF data is simulated                   
SIM_SMU =                    F / True if SMU data is simulated                  
SIM_TCS =                    F / True if TCS data is simulated                  
SIM_RTS =                    F / True if RTS data is simulated                  
SIM_POL =                    F / True if polarization data is simulated         
SIMULATE=                    F / True if any data are simulated                 
STATUS  = 'NORMAL  '           / Status of end of obervation                    

        ---- Polarimeter Specific ----                                          
POL_MODE=                      / Step-and-integrate (STOP_START) or Spin (CONSTA
ROTAFREQ=                      / [Hz] Spin frequency (if spinning) of polarimete
POL_CRD =                      / Coordinate system of polarimeter               
POL_FAXS=                      / Frequency dependency of waveplate offset of pol

        ---- K-mirror Specific ----                                             
ROT_CRD = 'TRACKING'           / K-mirror coordinate system                     

        ---- Metadata Fixups ----                                               
DHSVER  = 'MOD     '           / Data Handling Version                          

        ---- Data Processing ----                                               
MEDTSYS =          296.8218689 / [K] Median MAKECUBE system temperature         
EXP_TIME=          175.5339813 / [s] Median MAKECUBE exposure time              
EFF_TIME=          25.26644897 / [s] Median MAKECUBE effective integration time 
NUMTILES=                    1 / No. of tiles covering the field                
TILENUM =                    1 / Index of this tile (1->NUMTILES)        
ChrisBeaumont commented 10 years ago

Can you also copy in

wcs.wcs

and

cube._wcs.wcs

?

low-sky commented 10 years ago

wcs.wcs:

 flag: 137
      naxis: 3
      crpix: 0x105e64e40
               191          192          176       
         pc: 0x105e9aeb0
    pc[0][]:   0.92388      0.38268      0         
    pc[1][]:  -0.38268      0.92388      0         
    pc[2][]:   0            0            1         
      cdelt: 0x11a59f3f0
              -0.0020278    0.0020278    1000      
      crval: 0x11a59f410
               23.462       30.66       -1.2446e+05
      cunit: 0x105e99780
             "deg"
             "deg"
             "m/s"
      ctype: 0x103f11a30
             "RA---TAN"
             "DEC--TAN"
             "VRAD"
    lonpole: 180.000000
    latpole: 30.660278
    restfrq: 345795989900.000000
    restwav: 0.000000
        npv: 0
     npvmax: 0
         pv: 0x0
        nps: 0
     npsmax: 0
         ps: 0x0
         cd: 0x11a5a3c70
    cd[0][]:   0            0            0         
    cd[1][]:   0            0            0         
    cd[2][]:   0            0            0         
      crota: 0x103f11b10
               0            0            0         
     altlin: 1
     velref: 0
        alt: ' '
     colnum: 0
      colax: 0x105e99860
                 0      0      0
    wcsname: UNDEFINED
      cname: 0x105e55e30
             UNDEFINED
             UNDEFINED
             UNDEFINED
      crder: 0x105e55f10
             UNDEFINED     UNDEFINED     UNDEFINED   
      csyer: 0x11a58fe00
             UNDEFINED     UNDEFINED     UNDEFINED   
    radesys: "FK5"
    equinox: 2000.000000
    specsys: "LSRK"
    ssysobs: "TOPOCENT"
    velosys: -26774.137030
    ssyssrc: "LSRK"
    zsource: -0.000600
     obsgeo: -5.4611e+06  -2.4914e+06   2.1493e+06  
    dateobs: "2009-08-06T12:29:21.044"
    dateavg: UNDEFINED
     mjdobs: 55049.520380
     mjdavg: UNDEFINED
       ntab: 0
        tab: 0x0
       nwtb: 0
        wtb: 0x0
      types: 0x119822390
            2200 2201 3000
     lngtyp: "RA"
     lattyp: "DEC"
        lng: 0
        lat: 1
       spec: 2
   cubeface: -1
        err: 0x0
        lin: (see below)
        cel: (see below)
        spc: (see below)
     m_flag: 137
    m_naxis: 3
    m_crpix: 0x105e64e40  (= crpix)
       m_pc: 0x105e9aeb0  (= pc)
    m_cdelt: 0x11a59f3f0  (= cdelt)
    m_crval: 0x11a59f410  (= crval)
    m_cunit: 0x105e99780  (= cunit)
    m_ctype: 0x103f11a30  (= ctype)
       m_pv: 0x0  (= pv)
       m_ps: 0x0  (= ps)
       m_cd: 0x11a5a3c70  (= cd)
    m_crota: 0x103f11b10  (= crota)

    m_colax: 0x105e99860  (= colax)
    m_cname: 0x105e55e30  (= cname)
    m_crder: 0x105e55f10  (= crder)
    m_csyer: 0x11a58fe00  (= csyer)
      m_tab: 0x0  (= tab)
      m_wtb: 0x0  (= wtb)

   lin.*
       flag: 137
      naxis: 3
      crpix: 0x105e64e40
               191          192          176       
         pc: 0x105e9aeb0
    pc[0][]:   0.92388      0.38268      0         
    pc[1][]:  -0.38268      0.92388      0         
    pc[2][]:   0            0            1         
      cdelt: 0x11a59f3f0
              -0.0020278    0.0020278    1000      
      unity: 0
        err: 0x0
piximg[0][]:  -0.0018734   -0.000776    -0         
piximg[1][]:  -0.000776     0.0018734    0         
piximg[2][]:   0            0            1000      
imgpix[0][]:  -455.61      -188.72      -0         
imgpix[1][]:  -188.72       455.61       0         
imgpix[2][]:   0            0            0.001     
     m_flag: 0
    m_naxis: 0
    m_crpix: 0x0
       m_pc: 0x0
    m_cdelt: 0x0

   cel.*
      flag: 137
     offset: 0
       phi0:  0.000000
     theta0: 90.000000
       ref:   23.462       30.66        180          30.66     
       prj: (see below)
     euler:   23.462       59.34        180          0.50995      0.86021   
    latpreq: 0 (not required)
     isolat: 0
        err: 0x0

   prj.*
       flag: 103
       code: "TAN"
         r0: 57.295780
         pv: (not used)
       phi0:  0.000000
     theta0: 90.000000
     bounds: 1

       name: "gnomonic"
   category: 1 (zenithal)
    pvrange: 0
  simplezen: 1
  equiareal: 0
  conformal: 0
     global: 0
  divergent: 1
         x0: 0.000000
         y0: 0.000000
        err: 0x0
        w[]:   0            0            0            0            0         
               0            0            0            0            0         
          m: 0
          n: 0
     prjx2s: 0x01048dec50
     prjs2x: 0x01048de6b0

   spc.*
       flag: 0
       type: "    "
       code: "   "
      crval: UNDEFINED
    restfrq: 0.000000
    restwav: 0.000000
         pv: (not used)
          w:   0            0            0           (remainder unused)
    isGrism: 0
        err: 0x0
     spxX2P: 0x0
     spxP2S: 0x0
     spxS2P: 0x0
     spxP2X: 0x0
low-sky commented 10 years ago

cube._wcs.wcs

    flag: 137
      naxis: 3
      crpix: 0x10684e1e0
               191          192          57        
         pc: 0x105957c90
    pc[0][]:   0.92388      0.38268      0         
    pc[1][]:  -0.38268      0.92388      0         
    pc[2][]:   0            0            1         
      cdelt: 0x10684e200
              -0.0020278    0.0020278    1000      
      crval: 0x11a14e2f0
               23.462       30.66       -1.2446e+05
      cunit: 0x106a39f10
             "deg"
             "deg"
             "m s-1"
      ctype: 0x106a4c1d0
             "RA---TAN"
             "DEC--TAN"
             "VRAD"
    lonpole: 180.000000
    latpole: 30.660278
    restfrq: 345795989900.000000
    restwav: 0.000000
        npv: 0
     npvmax: 64
         pv: 0x100eb3200
        nps: 0
     npsmax: 8
         ps: 0x106870480
         cd: 0x1059df730
    cd[0][]:   0            0            0         
    cd[1][]:   0            0            0         
    cd[2][]:   0            0            0         
      crota: 0x1068074d0
               0            0            0         
     altlin: 1
     velref: 0
        alt: ' '
     colnum: 0
      colax: 0x1068074f0
                 0      0      0
    wcsname: UNDEFINED
      cname: 0x10680a4e0
             UNDEFINED
             UNDEFINED
             UNDEFINED
      crder: 0x119322d90
             UNDEFINED     UNDEFINED     UNDEFINED   
      csyer: 0x119322db0
             UNDEFINED     UNDEFINED     UNDEFINED   
    radesys: "FK5"
    equinox: 2000.000000
    specsys: "LSRK"
    ssysobs: "TOPOCENT"
    velosys: -26774.137030
    ssyssrc: "LSRK"
    zsource: -0.000600
     obsgeo: -5.4611e+06  -2.4914e+06   2.1493e+06  
    dateobs: "2009-08-06T12:29:21.044"
    dateavg: UNDEFINED
     mjdobs: 55049.520380
     mjdavg: UNDEFINED
       ntab: 0
        tab: 0x0
       nwtb: 0
        wtb: 0x0
      types: 0x105e9ae50
            2200 2201 3000
     lngtyp: "RA"
     lattyp: "DEC"
        lng: 0
        lat: 1
       spec: 2
   cubeface: -1
        err: 0x0
        lin: (see below)
        cel: (see below)
        spc: (see below)
     m_flag: 137
    m_naxis: 3
    m_crpix: 0x10684e1e0  (= crpix)
       m_pc: 0x105957c90  (= pc)
    m_cdelt: 0x10684e200  (= cdelt)
    m_crval: 0x11a14e2f0  (= crval)
    m_cunit: 0x106a39f10  (= cunit)
    m_ctype: 0x106a4c1d0  (= ctype)
       m_pv: 0x100eb3200  (= pv)
       m_ps: 0x106870480  (= ps)
       m_cd: 0x1059df730  (= cd)
    m_crota: 0x1068074d0  (= crota)

    m_colax: 0x1068074f0  (= colax)
    m_cname: 0x10680a4e0  (= cname)
    m_crder: 0x119322d90  (= crder)
    m_csyer: 0x119322db0  (= csyer)
      m_tab: 0x0  (= tab)
      m_wtb: 0x0  (= wtb)

   lin.*
       flag: 137
      naxis: 3
      crpix: 0x10684e1e0
               191          192          57        
         pc: 0x105957c90
    pc[0][]:   0.92388      0.38268      0         
    pc[1][]:  -0.38268      0.92388      0         
    pc[2][]:   0            0            1         
      cdelt: 0x10684e200
              -0.0020278    0.0020278    1000      
      unity: 0
        err: 0x0
piximg[0][]:  -0.0018734   -0.000776    -0         
piximg[1][]:  -0.000776     0.0018734    0         
piximg[2][]:   0            0            1000      
imgpix[0][]:  -455.61      -188.72      -0         
imgpix[1][]:  -188.72       455.61       0         
imgpix[2][]:   0            0            0.001     
     m_flag: 0
    m_naxis: 0
    m_crpix: 0x0
       m_pc: 0x0
    m_cdelt: 0x0

   cel.*
      flag: 137
     offset: 0
       phi0:  0.000000
     theta0: 90.000000
       ref:   23.462       30.66        180          30.66     
       prj: (see below)
     euler:   23.462       59.34        180          0.50995      0.86021   
    latpreq: 0 (not required)
     isolat: 0
        err: 0x0

   prj.*
       flag: 103
       code: "TAN"
         r0: 57.295780
         pv: (not used)
       phi0:  0.000000
     theta0: 90.000000
     bounds: 1

       name: "gnomonic"
   category: 1 (zenithal)
    pvrange: 0
  simplezen: 1
  equiareal: 0
  conformal: 0
     global: 0
  divergent: 1
         x0: 0.000000
         y0: 0.000000
        err: 0x0
        w[]:   0            0            0            0            0         
               0            0            0            0            0         
          m: 0
          n: 0
     prjx2s: 0x01048dec50
     prjs2x: 0x01048de6b0

   spc.*
       flag: 0
       type: "    "
       code: "   "
      crval: UNDEFINED
    restfrq: 0.000000
    restwav: 0.000000
         pv: (not used)
          w:   0            0            0           (remainder unused)
    isGrism: 0
        err: 0x0
     spxX2P: 0x0
     spxP2S: 0x0
     spxS2P: 0x0
     spxP2X: 0x0
ChrisBeaumont commented 10 years ago

Yep crpix has changed

ChrisBeaumont commented 10 years ago

Hmm I can't reproduce this, even when making a dummy fits file with the above header

low-sky commented 10 years ago

Issue resolved though I can't recall how. I think it was a versioning drift.

ChrisBeaumont commented 10 years ago

Yes, WCS.crpix was being clobbered within spectral_slab