[AstroPy] Question about multiple WCS in FITS file

Evert Rol evert.rol at gmail.com
Thu Jul 7 20:31:56 EDT 2016


 Hi John,

Any chance you could make your FITS file, and the few lines of you use to read it, available somewhere for testing?

  Evert


> Hello,
> 
> I have created some FITS image files with multiple WCS systems in them, using the format of appending letters to the keywords like so (here is the output of fitsdump on the header):
> 
> # HDU 4 in fiducial_1to3_b1_hdf5_plt_cnt_0000_proj_z.fits:
> XTENSION= 'IMAGE   '           / Image extension                                
> BITPIX  =                  -64 / array data type                                
> NAXIS   =                    2 / number of array dimensions                     
> NAXIS1  =                 2048                                                  
> NAXIS2  =                 2048                                                  
> PCOUNT  =                    0 / number of parameters                           
> GCOUNT  =                    1 / number of groups                               
> EXTNAME = 'KT      '           / extension name                                 
> BTYPE   = 'kT      '                                                            
> BUNIT   = 'keV     '                                                            
> WCSAXES =                    2                                                  
> CRPIX1  =               1024.5                                                  
> CRPIX2  =               1024.5                                                  
> CDELT1  =     6.96261175585938                                                  
> CDELT2  =     6.96261175585938                                                  
> CUNIT1  = 'kpc     '                                                            
> CUNIT2  = 'kpc     '                                                            
> CTYPE1  = 'LINEAR  '                                                            
> CTYPE2  = 'LINEAR  '                                                            
> CRVAL1  =                  0.0                                                  
> CRVAL2  =                  0.0                                                  
> LATPOLE =                 90.0                                                  
> WCSNAME = 'yt      '                                                            
> WCSAXESA=                    2                                                  
> CRPIX1A =               1024.5                                                  
> CRPIX2A =               1024.5                                                  
> CDELT1A = -0.00200479940122947                                                  
> CDELT2A =  0.00200479940122947                                                  
> CUNIT1A = 'deg     '                                                            
> CUNIT2A = 'deg     '                                                            
> CTYPE1A = 'RA---TAN'                                                            
> CTYPE2A = 'DEC--TAN'                                                            
> CRVAL1A =                 30.0                                                  
> CRVAL2A =                 45.0                                                  
> LONPOLEA=                180.0                                                  
> LATPOLEA=                 45.0                                                  
> WCSNAMEA= 'celestial'                                                           
> RADESYSA= 'ICRS    '                                                            
> TIME    =                  0.0                                                  
> 
> So far, so good. However, if I try to access these keywords in Python, I cannot get at them:
> 
> In [7]: im.header
> Out[7]: 
> XTENSION= 'IMAGE   '           / Image extension                                
> BITPIX  =                  -64 / array data type                                
> NAXIS   =                    2 / number of array dimensions                     
> NAXIS1  =                 2048                                                  
> NAXIS2  =                 2048                                                  
> PCOUNT  =                    0 / number of parameters                           
> GCOUNT  =                    1 / number of groups                               
> EXTNAME = 'KT      '           / extension name                                 
> BTYPE   = 'kT      '                                                            
> BUNIT   = 'keV     '                                                            
> WCSAXES =                    2                                                  
> CRPIX1  =               1024.5                                                  
> CRPIX2  =               1024.5                                                  
> CDELT1  =      6.9626117558594                                                  
> CDELT2  =      6.9626117558594                                                  
> CUNIT1  = 'kpc     '                                                            
> CUNIT2  = 'kpc     '                                                            
> CTYPE1  = 'LINEAR  '                                                            
> CTYPE2  = 'LINEAR  '                                                            
> CRVAL1  =                  0.0                                                  
> CRVAL2  =                  0.0                                                  
> LATPOLE =                 90.0                                                  
> WCSNAME = 'yt      '                                                            
> 
> Querying for them in dict-like fashion doesn’t work either. What am I missing that would allow AstroPy to see these?
> 
> Best,
> 
> John Z
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> https://mail.scipy.org/mailman/listinfo/astropy




More information about the AstroPy mailing list