########################################################
# Started Logging At: 2020-10-22 09:53:25
########################################################
########################################################
# # Started Logging At: 2020-10-22 09:53:27
########################################################
get_ipython().run_line_magic('ls', 'GTC2-20AFLO')
get_ipython().run_line_magic('ls', 'GTC2-20AFLO/OB0001/')
get_ipython().run_line_magic('ls', 'GTC2-20AFLO/OB0001/object')
files = get_ipython().getoutput('ls GTC2-20AFLO/OB0001/object')
files[0]
#[Out]# '0002613543-20200712-EMIR-STARE_IMAGE.fits'
from astropy.io import fits
filehandle = fits.open(files[0])
GTC2-20AFLO/OB0001/object
get_ipython().run_line_magic('cd', 'GTC2-20AFLO/OB0001/object')
files = get_ipython().getoutput('ls *fits')
files[0]
#[Out]# '0002613543-20200712-EMIR-STARE_IMAGE.fits'
from astropy.io import fits
filehandle = fits.open(files[0])
filehandle
#[Out]# [<astropy.io.fits.hdu.image.PrimaryHDU object at 0x2b60fcd80320>]
filehandle[0].header
#[Out]# SIMPLE  =                    T / file does conform to FITS standard             
#[Out]# BITPIX  =                   16 / number of bits per data pixel                  
#[Out]# NAXIS   =                    2 / number of data axes                            
#[Out]# NAXIS1  =                 2048 / length of data axis 1                          
#[Out]# NAXIS2  =                 2048 / length of data axis 2                          
#[Out]# EXTEND  =                    T / FITS dataset may contain extensions            
#[Out]# COMMENT   FITS (Flexible Image Transport System) format is defined in 'Astronomy
#[Out]# COMMENT   and Astrophysics', volume 376, page 359; bibcode: 2001A&A...376..359H 
#[Out]# BZERO   =                32768 / offset data range to that of unsigned short    
#[Out]# BSCALE  =                    1 / default scaling factor                         
#[Out]# DETVER  = 'SCI     '           / 401 Detector used: science or engineering      
#[Out]# NSEC    =                    1 / 402 Number of sequences executed at detector   
#[Out]# NRST    =                    1 / 403 Number of resets                           
#[Out]# OPTRST  =                    3 / 404 Type of reset                              
#[Out]# NIMGRST =                    1 / 405 Number of reset images                     
#[Out]# NRDBL_ND=                    0 / 406 Number of non-productive reads before loop 
#[Out]# NRDBL   =                    0 / 407 Number of productive reads before loop     
#[Out]# NLOOP   =                    1 / 408 Exposure Number                            
#[Out]# TOPER   =                  559 / [ms] 409 Time period in the detector sequence f
#[Out]# NRDIL_ND=                    8 / 410 Number of non-productibe reads per loop ite
#[Out]# NRDIL   =                    1 / 411 Number of productive reads per loop iterati
#[Out]# Y_SIZE  =                 1024 / 412 Offset in pixels for window mode           
#[Out]# Y_SIZE_B=                    0 / 413 Number of readable columns (1024 - Y_SIZE) 
#[Out]# NPARAM_X=                    0 / 414 Number of dummy readouts of a line         
#[Out]# GAIN    =                  3.3 / 416 Gain, in e-/ADU                            
#[Out]# RON     =                  6.2 / 417 Read-out noise, in ADU                     
#[Out]# VOFFSET =                   0. / 418 Voff                                       
#[Out]# VRESET  =                   0. / 419 Vreset                                     
#[Out]# WINMODE =                    0 / 420 Window mode: full, 128px                   
#[Out]# BIASGATE=                   0. / 421 Biasgate                                   
#[Out]# FIRMVER = '20023   '           / 422 Controller firmware version                
#[Out]# NFRSEC  =                    2 / 423 Frames produced per detector exposure      
#[Out]# FRSEC   =                    0 / 424 Counter of the frame sequence              
#[Out]# NEXP    =                    1 / 425 Number of detector exposures               
#[Out]# EXP     =                    1 / 426 Detector exposures counter                 
#[Out]# TSTAMP  =           1594612398 / [s] Time stamp in UTC                          
#[Out]# READMODN=                    1 / E00 Readout (numerico) mode used for the observ
#[Out]# TSUTC1  =      1594612397.6684 / [s] E01 Time stamp before read detector (UTC)  
#[Out]# TSUTC2  =     1594612408.77522 / [s] E02 Time stamp after read detector (UTC)   
#[Out]# TSUTCD  =     11.1068141460419 / [s] E03 Diff. between TSUTC2 and TSUTC1        
#[Out]# ITER_NUM=                    1 / E04 frame counter                              
#[Out]# FRSTAT  =                    2 / E05 status 0=START,1=RUN,2=END,3=ABR,4=ERR     
#[Out]# APPNAME = '/work/gcsop/etc/config/emir/lods/33-18_SDSU2_MUX_v20_UNIX.lod' / E06 
#[Out]# WINDCOV =                    1 / Window blind status (OPEN/CLOSE)               
#[Out]# WINDOW  =                    1 / Window status (OPEN/CLOSE)                     
#[Out]# XDTU_C  =      -999.9990234375 / X Absolute position commanded to DTU. If not -9
#[Out]# YDTU_C  =      -999.9990234375 / Y Absolute position commanded to DTU. If not -9
#[Out]# ZDTU_C  =      -999.9990234375 / Z Absolute position commanded to DTU. If not -9
#[Out]# XDTU_F  =             0.922918 / DTU-X Scale Factor                             
#[Out]# YDTU_F  =             0.971815 / DTU-Y Scale Factor                             
#[Out]# ZDTU_F  =                   1. / DTU-Z Scale Factor                             
#[Out]# CSUP1   =    0.488999992609024 / CSU current position                           
#[Out]# CSUP2   =    0.492000013589859 / CSU current position                           
#[Out]# CSUP3   =    0.495000004768372 / CSU current position                           
#[Out]# CSUP4   =    0.493999987840652 / CSU current position                           
#[Out]# CSUP5   =    0.493000000715256 / CSU current position                           
#[Out]# CSUP6   =    0.493000000715256 / CSU current position                           
#[Out]# CSUP7   =    0.492000013589859 / CSU current position                           
#[Out]# CSUP8   =    0.495999991893768 / CSU current position                           
#[Out]# CSUP9   =     0.49099999666214 / CSU current position                           
#[Out]# CSUP10  =    0.495000004768372 / CSU current position                           
#[Out]# CSUP11  =    0.492000013589859 / CSU current position                           
#[Out]# CSUP12  =    0.508000016212463 / CSU current position                           
#[Out]# CSUP13  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP14  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP15  =    0.490000009536743 / CSU current position                           
#[Out]# CSUP16  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP17  =    0.497000008821487 / CSU current position                           
#[Out]# CSUP18  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP19  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP20  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP21  =     0.49099999666214 / CSU current position                           
#[Out]# CSUP22  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP23  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP24  =    0.492000013589859 / CSU current position                           
#[Out]# CSUP25  =     0.49099999666214 / CSU current position                           
#[Out]# CSUP26  =     0.49099999666214 / CSU current position                           
#[Out]# CSUP27  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP28  =    0.493999987840652 / CSU current position                           
#[Out]# CSUP29  =    0.492000013589859 / CSU current position                           
#[Out]# CSUP30  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP31  =     0.49099999666214 / CSU current position                           
#[Out]# CSUP32  =    0.495000004768372 / CSU current position                           
#[Out]# CSUP33  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP34  =    0.493999987840652 / CSU current position                           
#[Out]# CSUP35  =     0.49099999666214 / CSU current position                           
#[Out]# CSUP36  =     0.49099999666214 / CSU current position                           
#[Out]# CSUP37  =    0.492000013589859 / CSU current position                           
#[Out]# CSUP38  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP39  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP40  =     0.49099999666214 / CSU current position                           
#[Out]# CSUP41  =     0.49099999666214 / CSU current position                           
#[Out]# CSUP42  =    0.493999987840652 / CSU current position                           
#[Out]# CSUP43  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP44  =    0.493999987840652 / CSU current position                           
#[Out]# CSUP45  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP46  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP47  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP48  =    0.497000008821487 / CSU current position                           
#[Out]# CSUP49  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP50  =    0.493999987840652 / CSU current position                           
#[Out]# CSUP51  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP52  =    0.492000013589859 / CSU current position                           
#[Out]# CSUP53  =    0.493999987840652 / CSU current position                           
#[Out]# CSUP54  =    0.493999987840652 / CSU current position                           
#[Out]# CSUP55  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP56  =     0.49099999666214 / CSU current position                           
#[Out]# CSUP57  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP58  =    0.492000013589859 / CSU current position                           
#[Out]# CSUP59  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP60  =    0.492000013589859 / CSU current position                           
#[Out]# CSUP61  =    0.493999987840652 / CSU current position                           
#[Out]# CSUP62  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP63  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP64  =    0.492000013589859 / CSU current position                           
#[Out]# CSUP65  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP66  =    0.492000013589859 / CSU current position                           
#[Out]# CSUP67  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP68  =    0.488999992609024 / CSU current position                           
#[Out]# CSUP69  =    0.507000029087067 / CSU current position                           
#[Out]# CSUP70  =    0.490000009536743 / CSU current position                           
#[Out]# CSUP71  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP72  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP73  =    0.492000013589859 / CSU current position                           
#[Out]# CSUP74  =    0.488999992609024 / CSU current position                           
#[Out]# CSUP75  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP76  =    0.490000009536743 / CSU current position                           
#[Out]# CSUP77  =    0.495999991893768 / CSU current position                           
#[Out]# CSUP78  =     0.49099999666214 / CSU current position                           
#[Out]# CSUP79  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP80  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP81  =    0.495000004768372 / CSU current position                           
#[Out]# CSUP82  =    0.488000005483627 / CSU current position                           
#[Out]# CSUP83  =    0.493999987840652 / CSU current position                           
#[Out]# CSUP84  =    0.492000013589859 / CSU current position                           
#[Out]# CSUP85  =     0.50900000333786 / CSU current position                           
#[Out]# CSUP86  =     0.49099999666214 / CSU current position                           
#[Out]# CSUP87  =    0.495999991893768 / CSU current position                           
#[Out]# CSUP88  =    0.492000013589859 / CSU current position                           
#[Out]# CSUP89  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP90  =    0.488999992609024 / CSU current position                           
#[Out]# CSUP91  =    0.493999987840652 / CSU current position                           
#[Out]# CSUP92  =    0.488999992609024 / CSU current position                           
#[Out]# CSUP93  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP94  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP95  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP96  =    0.492000013589859 / CSU current position                           
#[Out]# CSUP97  =    0.497000008821487 / CSU current position                           
#[Out]# CSUP98  =    0.492000013589859 / CSU current position                           
#[Out]# CSUP99  =    0.493999987840652 / CSU current position                           
#[Out]# CSUP100 =    0.490000009536743 / CSU current position                           
#[Out]# CSUP101 =    0.493999987840652 / CSU current position                           
#[Out]# CSUP102 =    0.490000009536743 / CSU current position                           
#[Out]# CSUP103 =    0.493999987840652 / CSU current position                           
#[Out]# CSUP104 =    0.492000013589859 / CSU current position                           
#[Out]# CSUP105 =    0.495000004768372 / CSU current position                           
#[Out]# CSUP106 =    0.493000000715256 / CSU current position                           
#[Out]# CSUP107 =    0.492000013589859 / CSU current position                           
#[Out]# CSUP108 =    0.492000013589859 / CSU current position                           
#[Out]# CSUP109 =    0.493000000715256 / CSU current position                           
#[Out]# CSUP110 =    0.490000009536743 / CSU current position                           
#[Out]# CS_0    =               10000. / CSU bars sensors                               
#[Out]# CS_1    =               10000. / CSU bars sensors                               
#[Out]# CS_2    =               10000. / CSU bars sensors                               
#[Out]# CS_3    =               10000. / CSU bars sensors                               
#[Out]# CS_4    =               10000. / CSU bars sensors                               
#[Out]# CS_5    =               10000. / CSU bars sensors                               
#[Out]# CS_6    =               10000. / CSU bars sensors                               
#[Out]# CS_7    =               10000. / CSU bars sensors                               
#[Out]# CS_8    =               10000. / CSU bars sensors                               
#[Out]# CS_9    =               10000. / CSU bars sensors                               
#[Out]# CS_10   =               10000. / CSU bars sensors                               
#[Out]# CS_11   =               10000. / CSU bars sensors                               
#[Out]# CS_12   =               10000. / CSU bars sensors                               
#[Out]# CS_13   =               10000. / CSU bars sensors                               
#[Out]# CS_14   =               10000. / CSU bars sensors                               
#[Out]# CS_15   =               10000. / CSU bars sensors                               
#[Out]# CS_16   =               10000. / CSU bars sensors                               
#[Out]# CS_17   =               10000. / CSU bars sensors                               
#[Out]# CS_18   =               10000. / CSU bars sensors                               
#[Out]# CS_19   =               10000. / CSU bars sensors                               
#[Out]# CS_20   =               10000. / CSU bars sensors                               
#[Out]# CS_21   =               10000. / CSU bars sensors                               
#[Out]# CS_22   =               10000. / CSU bars sensors                               
#[Out]# CS_23   =               10000. / CSU bars sensors                               
#[Out]# CS_24   =               10000. / CSU bars sensors                               
#[Out]# CS_25   =               10000. / CSU bars sensors                               
#[Out]# CS_26   =               10000. / CSU bars sensors                               
#[Out]# CS_27   =               10000. / CSU bars sensors                               
#[Out]# CS_28   =               10000. / CSU bars sensors                               
#[Out]# CS_29   =               10000. / CSU bars sensors                               
#[Out]# CS_30   =               10000. / CSU bars sensors                               
#[Out]# CS_31   =               10000. / CSU bars sensors                               
#[Out]# CS_32   =               10000. / CSU bars sensors                               
#[Out]# CS_33   =               10000. / CSU bars sensors                               
#[Out]# CS_34   =               10000. / CSU bars sensors                               
#[Out]# CS_35   =               10000. / CSU bars sensors                               
#[Out]# CS_36   =               10000. / CSU bars sensors                               
#[Out]# CS_37   =               10000. / CSU bars sensors                               
#[Out]# CS_38   =               10000. / CSU bars sensors                               
#[Out]# CS_39   =               10000. / CSU bars sensors                               
#[Out]# CS_40   =               10000. / CSU bars sensors                               
#[Out]# CS_41   =               10000. / CSU bars sensors                               
#[Out]# CS_42   =               10000. / CSU bars sensors                               
#[Out]# CS_43   =               10000. / CSU bars sensors                               
#[Out]# CS_44   =               10000. / CSU bars sensors                               
#[Out]# CS_45   =               10000. / CSU bars sensors                               
#[Out]# CS_46   =               10000. / CSU bars sensors                               
#[Out]# CS_47   =               10000. / CSU bars sensors                               
#[Out]# CS_48   =               10000. / CSU bars sensors                               
#[Out]# CS_49   =               10000. / CSU bars sensors                               
#[Out]# CS_50   =               10000. / CSU bars sensors                               
#[Out]# CS_51   =               10000. / CSU bars sensors                               
#[Out]# CS_52   =               10000. / CSU bars sensors                               
#[Out]# CS_53   =               10000. / CSU bars sensors                               
#[Out]# CS_54   =               10000. / CSU bars sensors                               
#[Out]# CS_55   =               10000. / CSU bars sensors                               
#[Out]# CS_56   =               10000. / CSU bars sensors                               
#[Out]# CS_57   =               10000. / CSU bars sensors                               
#[Out]# CS_58   =               10000. / CSU bars sensors                               
#[Out]# CS_59   =               10000. / CSU bars sensors                               
#[Out]# CS_60   =               10000. / CSU bars sensors                               
#[Out]# CS_61   =               10000. / CSU bars sensors                               
#[Out]# CS_62   =               10000. / CSU bars sensors                               
#[Out]# CS_63   =               10000. / CSU bars sensors                               
#[Out]# CS_64   =               10000. / CSU bars sensors                               
#[Out]# CS_65   =               10000. / CSU bars sensors                               
#[Out]# CS_66   =               10000. / CSU bars sensors                               
#[Out]# CS_67   =               10000. / CSU bars sensors                               
#[Out]# CS_68   =               10000. / CSU bars sensors                               
#[Out]# CS_69   =               10000. / CSU bars sensors                               
#[Out]# CS_70   =               10000. / CSU bars sensors                               
#[Out]# CS_71   =               10000. / CSU bars sensors                               
#[Out]# CS_72   =               10000. / CSU bars sensors                               
#[Out]# CS_73   =               10000. / CSU bars sensors                               
#[Out]# CS_74   =               10000. / CSU bars sensors                               
#[Out]# CS_75   =               10000. / CSU bars sensors                               
#[Out]# CS_76   =               10000. / CSU bars sensors                               
#[Out]# CS_77   =               10000. / CSU bars sensors                               
#[Out]# CS_78   =               10000. / CSU bars sensors                               
#[Out]# CS_79   =               10000. / CSU bars sensors                               
#[Out]# CS_80   =               10000. / CSU bars sensors                               
#[Out]# CS_81   =               10000. / CSU bars sensors                               
#[Out]# CS_82   =               10000. / CSU bars sensors                               
#[Out]# CS_83   =               10000. / CSU bars sensors                               
#[Out]# CS_84   =               10000. / CSU bars sensors                               
#[Out]# CS_85   =               10000. / CSU bars sensors                               
#[Out]# CS_86   =               10000. / CSU bars sensors                               
#[Out]# CS_87   =               10000. / CSU bars sensors                               
#[Out]# CS_88   =               10000. / CSU bars sensors                               
#[Out]# CS_89   =               10000. / CSU bars sensors                               
#[Out]# CS_90   =               10000. / CSU bars sensors                               
#[Out]# CS_91   =               10000. / CSU bars sensors                               
#[Out]# CS_92   =               10000. / CSU bars sensors                               
#[Out]# CS_93   =               10000. / CSU bars sensors                               
#[Out]# CS_94   =               10000. / CSU bars sensors                               
#[Out]# CS_95   =               10000. / CSU bars sensors                               
#[Out]# CS_96   =               10000. / CSU bars sensors                               
#[Out]# CS_97   =               10000. / CSU bars sensors                               
#[Out]# CS_98   =               10000. / CSU bars sensors                               
#[Out]# CS_99   =               10000. / CSU bars sensors                               
#[Out]# CS_100  =               10000. / CSU bars sensors                               
#[Out]# CS_101  =               10000. / CSU bars sensors                               
#[Out]# CS_102  =               10000. / CSU bars sensors                               
#[Out]# CS_103  =               10000. / CSU bars sensors                               
#[Out]# CS_104  =               10000. / CSU bars sensors                               
#[Out]# CS_105  =               10000. / CSU bars sensors                               
#[Out]# CS_106  =               10000. / CSU bars sensors                               
#[Out]# CS_107  =               10000. / CSU bars sensors                               
#[Out]# CS_108  =               10000. / CSU bars sensors                               
#[Out]# CS_109  =               10000. / CSU bars sensors                               
#[Out]# CS_110  =               10000. / CSU bars sensors                               
#[Out]# CS_111  =               10000. / CSU bars sensors                               
#[Out]# CS_112  =               10000. / CSU bars sensors                               
#[Out]# CS_113  =               10000. / CSU bars sensors                               
#[Out]# CS_114  =               10000. / CSU bars sensors                               
#[Out]# CS_115  =               10000. / CSU bars sensors                               
#[Out]# CS_116  =               10000. / CSU bars sensors                               
#[Out]# CS_117  =               10000. / CSU bars sensors                               
#[Out]# CS_118  =               10000. / CSU bars sensors                               
#[Out]# CS_119  =               10000. / CSU bars sensors                               
#[Out]# CS_120  =               10000. / CSU bars sensors                               
#[Out]# CS_121  =               10000. / CSU bars sensors                               
#[Out]# CS_122  =               10000. / CSU bars sensors                               
#[Out]# CS_123  =               10000. / CSU bars sensors                               
#[Out]# CS_124  =               10000. / CSU bars sensors                               
#[Out]# CS_125  =               10000. / CSU bars sensors                               
#[Out]# CS_126  =               10000. / CSU bars sensors                               
#[Out]# CS_127  =               10000. / CSU bars sensors                               
#[Out]# CS_128  =               10000. / CSU bars sensors                               
#[Out]# CS_129  =               10000. / CSU bars sensors                               
#[Out]# CS_130  =               10000. / CSU bars sensors                               
#[Out]# CS_131  =               10000. / CSU bars sensors                               
#[Out]# CS_132  =               10000. / CSU bars sensors                               
#[Out]# CS_133  =               10000. / CSU bars sensors                               
#[Out]# CS_134  =               10000. / CSU bars sensors                               
#[Out]# CS_135  =               10000. / CSU bars sensors                               
#[Out]# CS_136  =               10000. / CSU bars sensors                               
#[Out]# CS_137  =               10000. / CSU bars sensors                               
#[Out]# CS_138  =               10000. / CSU bars sensors                               
#[Out]# CS_139  =               10000. / CSU bars sensors                               
#[Out]# CS_140  =               10000. / CSU bars sensors                               
#[Out]# CS_141  =               10000. / CSU bars sensors                               
#[Out]# CS_142  =               10000. / CSU bars sensors                               
#[Out]# CS_143  =               10000. / CSU bars sensors                               
#[Out]# CS_144  =               10000. / CSU bars sensors                               
#[Out]# CS_145  =               10000. / CSU bars sensors                               
#[Out]# CS_146  =               10000. / CSU bars sensors                               
#[Out]# CS_147  =               10000. / CSU bars sensors                               
#[Out]# CS_148  =               10000. / CSU bars sensors                               
#[Out]# CS_149  =               10000. / CSU bars sensors                               
#[Out]# CS_150  =               10000. / CSU bars sensors                               
#[Out]# CS_151  =               10000. / CSU bars sensors                               
#[Out]# CS_152  =               10000. / CSU bars sensors                               
#[Out]# CS_153  =               10000. / CSU bars sensors                               
#[Out]# CS_154  =               10000. / CSU bars sensors                               
#[Out]# CS_155  =               10000. / CSU bars sensors                               
#[Out]# CS_156  =               10000. / CSU bars sensors                               
#[Out]# CS_157  =               10000. / CSU bars sensors                               
#[Out]# CS_158  =               10000. / CSU bars sensors                               
#[Out]# CS_159  =               10000. / CSU bars sensors                               
#[Out]# CS_160  =               10000. / CSU bars sensors                               
#[Out]# CS_161  =               10000. / CSU bars sensors                               
#[Out]# CS_162  =               10000. / CSU bars sensors                               
#[Out]# CS_163  =               10000. / CSU bars sensors                               
#[Out]# CS_164  =               10000. / CSU bars sensors                               
#[Out]# CS_165  =               10000. / CSU bars sensors                               
#[Out]# CS_166  =               10000. / CSU bars sensors                               
#[Out]# CS_167  =               10000. / CSU bars sensors                               
#[Out]# CS_168  =               10000. / CSU bars sensors                               
#[Out]# CS_169  =               10000. / CSU bars sensors                               
#[Out]# CS_170  =               10000. / CSU bars sensors                               
#[Out]# CS_171  =               10000. / CSU bars sensors                               
#[Out]# CS_172  =               10000. / CSU bars sensors                               
#[Out]# CS_173  =               10000. / CSU bars sensors                               
#[Out]# CS_174  =               10000. / CSU bars sensors                               
#[Out]# CS_175  =               10000. / CSU bars sensors                               
#[Out]# CS_176  =               10000. / CSU bars sensors                               
#[Out]# CS_177  =               10000. / CSU bars sensors                               
#[Out]# CS_178  =               10000. / CSU bars sensors                               
#[Out]# CS_179  =               10000. / CSU bars sensors                               
#[Out]# CS_180  =               10000. / CSU bars sensors                               
#[Out]# CS_181  =               10000. / CSU bars sensors                               
#[Out]# CS_182  =               10000. / CSU bars sensors                               
#[Out]# CS_183  =               10000. / CSU bars sensors                               
#[Out]# CS_184  =               10000. / CSU bars sensors                               
#[Out]# CS_185  =               10000. / CSU bars sensors                               
#[Out]# CS_186  =               10000. / CSU bars sensors                               
#[Out]# CS_187  =               10000. / CSU bars sensors                               
#[Out]# CS_188  =               10000. / CSU bars sensors                               
#[Out]# CS_189  =               10000. / CSU bars sensors                               
#[Out]# CS_190  =               10000. / CSU bars sensors                               
#[Out]# CS_191  =               10000. / CSU bars sensors                               
#[Out]# CS_192  =               10000. / CSU bars sensors                               
#[Out]# CS_193  =               10000. / CSU bars sensors                               
#[Out]# CS_194  =               10000. / CSU bars sensors                               
#[Out]# CS_195  =               10000. / CSU bars sensors                               
#[Out]# CS_196  =               10000. / CSU bars sensors                               
#[Out]# CS_197  =               10000. / CSU bars sensors                               
#[Out]# CS_198  =               10000. / CSU bars sensors                               
#[Out]# CS_199  =               10000. / CSU bars sensors                               
#[Out]# CS_200  =               10000. / CSU bars sensors                               
#[Out]# CS_201  =               10000. / CSU bars sensors                               
#[Out]# CS_202  =               10000. / CSU bars sensors                               
#[Out]# CS_203  =               10000. / CSU bars sensors                               
#[Out]# CS_204  =               10000. / CSU bars sensors                               
#[Out]# CS_205  =               10000. / CSU bars sensors                               
#[Out]# CS_206  =               10000. / CSU bars sensors                               
#[Out]# CS_207  =               10000. / CSU bars sensors                               
#[Out]# CS_208  =               10000. / CSU bars sensors                               
#[Out]# CS_209  =               10000. / CSU bars sensors                               
#[Out]# CS_210  =               10000. / CSU bars sensors                               
#[Out]# CS_211  =               10000. / CSU bars sensors                               
#[Out]# CS_212  =               10000. / CSU bars sensors                               
#[Out]# CS_213  =               10000. / CSU bars sensors                               
#[Out]# CS_214  =               10000. / CSU bars sensors                               
#[Out]# CS_215  =               10000. / CSU bars sensors                               
#[Out]# CS_216  =               10000. / CSU bars sensors                               
#[Out]# CS_217  =               10000. / CSU bars sensors                               
#[Out]# CS_218  =               10000. / CSU bars sensors                               
#[Out]# CS_219  =               10000. / CSU bars sensors                               
#[Out]# CS_220  =               10000. / CSU bars sensors                               
#[Out]# CS_221  =               10000. / CSU bars sensors                               
#[Out]# CS_222  =               10000. / CSU bars sensors                               
#[Out]# CS_223  =               10000. / CSU bars sensors                               
#[Out]# CS_224  =               10000. / CSU bars sensors                               
#[Out]# CS_225  =               10000. / CSU bars sensors                               
#[Out]# CS_226  =               10000. / CSU bars sensors                               
#[Out]# CS_227  =               10000. / CSU bars sensors                               
#[Out]# CS_228  =               10000. / CSU bars sensors                               
#[Out]# CS_229  =               10000. / CSU bars sensors                               
#[Out]# CS_230  =               10000. / CSU bars sensors                               
#[Out]# CS_231  =               10000. / CSU bars sensors                               
#[Out]# CS_232  =               10000. / CSU bars sensors                               
#[Out]# CS_233  =               10000. / CSU bars sensors                               
#[Out]# CS_234  =               10000. / CSU bars sensors                               
#[Out]# CS_235  =               10000. / CSU bars sensors                               
#[Out]# CS_236  =               10000. / CSU bars sensors                               
#[Out]# CS_237  =               10000. / CSU bars sensors                               
#[Out]# CS_238  =               10000. / CSU bars sensors                               
#[Out]# CS_239  =               10000. / CSU bars sensors                               
#[Out]# CS_240  =               10000. / CSU bars sensors                               
#[Out]# CS_241  =               10000. / CSU bars sensors                               
#[Out]# CS_242  =               10000. / CSU bars sensors                               
#[Out]# CS_243  =               10000. / CSU bars sensors                               
#[Out]# CS_244  =               10000. / CSU bars sensors                               
#[Out]# CS_245  =               10000. / CSU bars sensors                               
#[Out]# CS_246  =               10000. / CSU bars sensors                               
#[Out]# CS_247  =               10000. / CSU bars sensors                               
#[Out]# CS_248  =               10000. / CSU bars sensors                               
#[Out]# CS_249  =               10000. / CSU bars sensors                               
#[Out]# CS_250  =               10000. / CSU bars sensors                               
#[Out]# CS_251  =               10000. / CSU bars sensors                               
#[Out]# CS_252  =               10000. / CSU bars sensors                               
#[Out]# CS_253  =               10000. / CSU bars sensors                               
#[Out]# CS_254  =               10000. / CSU bars sensors                               
#[Out]# CS_255  =               10000. / CSU bars sensors                               
#[Out]# CS_256  =               10000. / CSU bars sensors                               
#[Out]# CS_257  =               10000. / CSU bars sensors                               
#[Out]# CS_258  =               10000. / CSU bars sensors                               
#[Out]# CS_259  =               10000. / CSU bars sensors                               
#[Out]# CS_260  =               10000. / CSU bars sensors                               
#[Out]# CS_261  =               10000. / CSU bars sensors                               
#[Out]# CS_262  =               10000. / CSU bars sensors                               
#[Out]# CS_263  =               10000. / CSU bars sensors                               
#[Out]# CS_264  =               10000. / CSU bars sensors                               
#[Out]# CS_265  =               10000. / CSU bars sensors                               
#[Out]# CS_266  =               10000. / CSU bars sensors                               
#[Out]# CS_267  =               10000. / CSU bars sensors                               
#[Out]# CS_268  =               10000. / CSU bars sensors                               
#[Out]# CS_269  =               10000. / CSU bars sensors                               
#[Out]# CS_270  =               10000. / CSU bars sensors                               
#[Out]# CS_271  =               10000. / CSU bars sensors                               
#[Out]# CS_272  =               10000. / CSU bars sensors                               
#[Out]# CS_273  =               10000. / CSU bars sensors                               
#[Out]# CS_274  =               10000. / CSU bars sensors                               
#[Out]# CS_275  =               10000. / CSU bars sensors                               
#[Out]# CS_276  =               10000. / CSU bars sensors                               
#[Out]# CS_277  =               10000. / CSU bars sensors                               
#[Out]# CS_278  =               10000. / CSU bars sensors                               
#[Out]# CS_279  =               10000. / CSU bars sensors                               
#[Out]# CS_280  =               10000. / CSU bars sensors                               
#[Out]# CS_281  =               10000. / CSU bars sensors                               
#[Out]# CS_282  =               10000. / CSU bars sensors                               
#[Out]# CS_283  =               10000. / CSU bars sensors                               
#[Out]# CS_284  =               10000. / CSU bars sensors                               
#[Out]# CS_285  =               10000. / CSU bars sensors                               
#[Out]# CS_286  =               10000. / CSU bars sensors                               
#[Out]# CS_287  =               10000. / CSU bars sensors                               
#[Out]# CS_288  =               10000. / CSU bars sensors                               
#[Out]# CS_289  =               10000. / CSU bars sensors                               
#[Out]# CS_290  =               10000. / CSU bars sensors                               
#[Out]# CS_291  =               10000. / CSU bars sensors                               
#[Out]# CS_292  =               10000. / CSU bars sensors                               
#[Out]# CS_293  =               10000. / CSU bars sensors                               
#[Out]# CS_294  =               10000. / CSU bars sensors                               
#[Out]# CS_295  =               10000. / CSU bars sensors                               
#[Out]# CS_296  =               10000. / CSU bars sensors                               
#[Out]# CS_297  =               10000. / CSU bars sensors                               
#[Out]# CS_298  =               10000. / CSU bars sensors                               
#[Out]# CS_299  =               10000. / CSU bars sensors                               
#[Out]# CS_300  =               10000. / CSU bars sensors                               
#[Out]# CS_301  =               10000. / CSU bars sensors                               
#[Out]# CS_302  =               10000. / CSU bars sensors                               
#[Out]# CS_303  =               10000. / CSU bars sensors                               
#[Out]# CS_304  =               10000. / CSU bars sensors                               
#[Out]# CS_305  =               10000. / CSU bars sensors                               
#[Out]# CS_306  =               10000. / CSU bars sensors                               
#[Out]# CS_307  =               10000. / CSU bars sensors                               
#[Out]# CS_308  =               10000. / CSU bars sensors                               
#[Out]# CS_309  =               10000. / CSU bars sensors                               
#[Out]# CS_310  =               10000. / CSU bars sensors                               
#[Out]# CS_311  =               10000. / CSU bars sensors                               
#[Out]# CS_312  =               10000. / CSU bars sensors                               
#[Out]# CS_313  =               10000. / CSU bars sensors                               
#[Out]# CS_314  =               10000. / CSU bars sensors                               
#[Out]# CS_315  =               10000. / CSU bars sensors                               
#[Out]# CS_316  =               10000. / CSU bars sensors                               
#[Out]# CS_317  =               10000. / CSU bars sensors                               
#[Out]# CS_318  =               10000. / CSU bars sensors                               
#[Out]# CS_319  =               10000. / CSU bars sensors                               
#[Out]# CS_320  =               10000. / CSU bars sensors                               
#[Out]# CS_321  =               10000. / CSU bars sensors                               
#[Out]# CS_322  =               10000. / CSU bars sensors                               
#[Out]# CS_323  =               10000. / CSU bars sensors                               
#[Out]# CS_324  =               10000. / CSU bars sensors                               
#[Out]# CS_325  =               10000. / CSU bars sensors                               
#[Out]# CS_326  =               10000. / CSU bars sensors                               
#[Out]# CS_327  =               10000. / CSU bars sensors                               
#[Out]# CS_328  =               10000. / CSU bars sensors                               
#[Out]# CS_329  =               10000. / CSU bars sensors                               
#[Out]# CS_330  =               10000. / CSU bars sensors                               
#[Out]# CS_331  =               10000. / CSU bars sensors                               
#[Out]# CS_332  =               10000. / CSU bars sensors                               
#[Out]# CS_333  =               10000. / CSU bars sensors                               
#[Out]# CS_334  =               10000. / CSU bars sensors                               
#[Out]# CS_335  =               10000. / CSU bars sensors                               
#[Out]# CS_336  =               10000. / CSU bars sensors                               
#[Out]# CS_337  =               10000. / CSU bars sensors                               
#[Out]# CS_338  =               10000. / CSU bars sensors                               
#[Out]# CS_339  =               10000. / CSU bars sensors                               
#[Out]# CS_340  =               10000. / CSU bars sensors                               
#[Out]# CS_341  =               10000. / CSU bars sensors                               
#[Out]# CS_342  =               10000. / CSU bars sensors                               
#[Out]# CS_343  =               10000. / CSU bars sensors                               
#[Out]# CS_344  =               10000. / CSU bars sensors                               
#[Out]# CS_345  =               10000. / CSU bars sensors                               
#[Out]# CS_346  =               10000. / CSU bars sensors                               
#[Out]# CS_347  =               10000. / CSU bars sensors                               
#[Out]# CS_348  =               10000. / CSU bars sensors                               
#[Out]# CS_349  =               10000. / CSU bars sensors                               
#[Out]# CS_350  =               10000. / CSU bars sensors                               
#[Out]# CS_351  =               10000. / CSU bars sensors                               
#[Out]# CS_352  =               10000. / CSU bars sensors                               
#[Out]# CS_353  =               10000. / CSU bars sensors                               
#[Out]# CS_354  =               10000. / CSU bars sensors                               
#[Out]# CS_355  =               10000. / CSU bars sensors                               
#[Out]# CS_356  =               10000. / CSU bars sensors                               
#[Out]# CS_357  =               10000. / CSU bars sensors                               
#[Out]# CS_358  =               10000. / CSU bars sensors                               
#[Out]# CS_359  =               10000. / CSU bars sensors                               
#[Out]# CS_360  =               10000. / CSU bars sensors                               
#[Out]# CS_361  =               10000. / CSU bars sensors                               
#[Out]# CS_362  =               10000. / CSU bars sensors                               
#[Out]# CS_363  =               10000. / CSU bars sensors                               
#[Out]# CS_364  =               10000. / CSU bars sensors                               
#[Out]# CS_365  =               10000. / CSU bars sensors                               
#[Out]# CS_366  =               10000. / CSU bars sensors                               
#[Out]# CS_367  =               10000. / CSU bars sensors                               
#[Out]# CS_368  =               10000. / CSU bars sensors                               
#[Out]# CS_369  =               10000. / CSU bars sensors                               
#[Out]# CS_370  =               10000. / CSU bars sensors                               
#[Out]# CS_371  =               10000. / CSU bars sensors                               
#[Out]# CS_372  =               10000. / CSU bars sensors                               
#[Out]# CS_373  =               10000. / CSU bars sensors                               
#[Out]# CS_374  =               10000. / CSU bars sensors                               
#[Out]# CS_375  =               10000. / CSU bars sensors                               
#[Out]# CS_376  =               10000. / CSU bars sensors                               
#[Out]# CS_377  =               10000. / CSU bars sensors                               
#[Out]# CS_378  =               10000. / CSU bars sensors                               
#[Out]# CS_379  =               10000. / CSU bars sensors                               
#[Out]# CS_380  =               10000. / CSU bars sensors                               
#[Out]# CS_381  =               10000. / CSU bars sensors                               
#[Out]# CS_382  =               10000. / CSU bars sensors                               
#[Out]# CS_383  =               10000. / CSU bars sensors                               
#[Out]# CS_384  =               10000. / CSU bars sensors                               
#[Out]# CS_385  =               10000. / CSU bars sensors                               
#[Out]# CS_386  =               10000. / CSU bars sensors                               
#[Out]# CS_387  =               10000. / CSU bars sensors                               
#[Out]# CS_388  =               10000. / CSU bars sensors                               
#[Out]# CS_389  =               10000. / CSU bars sensors                               
#[Out]# CS_390  =               10000. / CSU bars sensors                               
#[Out]# CS_391  =               10000. / CSU bars sensors                               
#[Out]# CS_392  =               10000. / CSU bars sensors                               
#[Out]# CS_393  =               10000. / CSU bars sensors                               
#[Out]# CS_394  =               10000. / CSU bars sensors                               
#[Out]# CS_395  =               10000. / CSU bars sensors                               
#[Out]# CS_396  =               10000. / CSU bars sensors                               
#[Out]# CS_397  =               10000. / CSU bars sensors                               
#[Out]# CS_398  =               10000. / CSU bars sensors                               
#[Out]# CS_399  =               10000. / CSU bars sensors                               
#[Out]# CS_400  =               10000. / CSU bars sensors                               
#[Out]# CS_401  =               10000. / CSU bars sensors                               
#[Out]# CS_402  =               10000. / CSU bars sensors                               
#[Out]# CS_403  =               10000. / CSU bars sensors                               
#[Out]# CS_404  =               10000. / CSU bars sensors                               
#[Out]# CS_405  =               10000. / CSU bars sensors                               
#[Out]# CS_406  =               10000. / CSU bars sensors                               
#[Out]# CS_407  =               10000. / CSU bars sensors                               
#[Out]# CS_408  =               10000. / CSU bars sensors                               
#[Out]# CS_409  =               10000. / CSU bars sensors                               
#[Out]# CS_410  =               10000. / CSU bars sensors                               
#[Out]# CS_411  =               10000. / CSU bars sensors                               
#[Out]# CS_412  =               10000. / CSU bars sensors                               
#[Out]# CS_413  =               10000. / CSU bars sensors                               
#[Out]# CS_414  =               10000. / CSU bars sensors                               
#[Out]# CS_415  =               10000. / CSU bars sensors                               
#[Out]# CS_416  =               10000. / CSU bars sensors                               
#[Out]# CS_417  =               10000. / CSU bars sensors                               
#[Out]# CS_418  =               10000. / CSU bars sensors                               
#[Out]# CS_419  =               10000. / CSU bars sensors                               
#[Out]# CS_420  =               10000. / CSU bars sensors                               
#[Out]# CS_421  =               10000. / CSU bars sensors                               
#[Out]# CS_422  =               10000. / CSU bars sensors                               
#[Out]# CS_423  =               10000. / CSU bars sensors                               
#[Out]# CS_424  =               10000. / CSU bars sensors                               
#[Out]# CS_425  =               10000. / CSU bars sensors                               
#[Out]# CS_426  =               10000. / CSU bars sensors                               
#[Out]# CS_427  =               10000. / CSU bars sensors                               
#[Out]# CS_428  =               10000. / CSU bars sensors                               
#[Out]# CS_429  =               10000. / CSU bars sensors                               
#[Out]# CS_430  =               10000. / CSU bars sensors                               
#[Out]# CS_431  =               10000. / CSU bars sensors                               
#[Out]# CS_432  =               10000. / CSU bars sensors                               
#[Out]# CS_433  =               10000. / CSU bars sensors                               
#[Out]# CS_434  =               10000. / CSU bars sensors                               
#[Out]# CS_435  =               10000. / CSU bars sensors                               
#[Out]# CS_436  =               10000. / CSU bars sensors                               
#[Out]# CS_437  =               10000. / CSU bars sensors                               
#[Out]# CS_438  =               10000. / CSU bars sensors                               
#[Out]# CS_439  =               10000. / CSU bars sensors                               
#[Out]# SLIFL1  =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL2  =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL3  =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL4  =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL5  =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL6  =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL7  =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL8  =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL9  =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL10 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL11 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL12 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL13 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL14 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL15 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL16 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL17 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL18 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL19 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL20 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL21 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL22 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL23 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL24 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL25 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL26 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL27 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL28 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL29 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL30 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL31 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL32 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL33 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL34 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL35 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL36 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL37 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL38 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL39 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL40 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL41 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL42 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL43 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL44 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL45 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL46 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL47 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL48 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL49 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL50 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL51 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL52 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL53 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL54 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL55 =                    0 / Slit flag for assigned or reference slits      
#[Out]# XVSLI1  =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI2  =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI3  =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI4  =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI5  =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI6  =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI7  =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI8  =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI9  =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI10 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI11 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI12 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI13 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI14 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI15 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI16 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI17 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI18 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI19 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI20 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI21 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI22 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI23 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI24 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI25 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI26 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI27 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI28 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI29 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI30 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI31 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI32 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI33 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI34 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI35 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI36 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI37 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI38 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI39 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI40 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI41 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI42 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI43 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI44 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI45 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI46 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI47 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI48 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI49 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI50 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI51 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI52 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI53 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI54 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI55 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI1  =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI2  =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI3  =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI4  =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI5  =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI6  =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI7  =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI8  =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI9  =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI10 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI11 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI12 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI13 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI14 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI15 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI16 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI17 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI18 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI19 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI20 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI21 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI22 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI23 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI24 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI25 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI26 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI27 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI28 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI29 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI30 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI31 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI32 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI33 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI34 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI35 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI36 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI37 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI38 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI39 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI40 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI41 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI42 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI43 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI44 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI45 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI46 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI47 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI48 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI49 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI50 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI51 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI52 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI53 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI54 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI55 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# XRSLI1  =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI2  =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI3  =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI4  =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI5  =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI6  =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI7  =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI8  =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI9  =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI10 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI11 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI12 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI13 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI14 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI15 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI16 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI17 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI18 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI19 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI20 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI21 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI22 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI23 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI24 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI25 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI26 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI27 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI28 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI29 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI30 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI31 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI32 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI33 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI34 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI35 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI36 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI37 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI38 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI39 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI40 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI41 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI42 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI43 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI44 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI45 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI46 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI47 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI48 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI49 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI50 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI51 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI52 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI53 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI54 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI55 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI1  =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI2  =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI3  =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI4  =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI5  =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI6  =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI7  =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI8  =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI9  =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI10 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI11 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI12 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI13 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI14 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI15 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI16 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI17 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI18 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI19 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI20 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI21 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI22 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI23 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI24 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI25 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI26 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI27 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI28 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI29 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI30 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI31 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI32 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI33 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI34 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI35 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI36 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI37 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI38 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI39 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI40 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI41 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI42 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI43 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI44 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI45 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI46 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI47 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI48 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI49 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI50 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI51 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI52 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI53 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI54 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI55 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# TEMPDET =     69.9599990844727 / Temperature at place                           
#[Out]# PRESEMIR= 2.65633985918612E-07 / Pressure at place                              
#[Out]# WCTEMP  =     16.8999996185303 / Temperature in Celsius at EMIR Window          
#[Out]# WCHUM   =                  14. / Humidity in percentage at EMIR Window          
#[Out]# WCDWP   =    -10.6999998092651 / DewPoint in Celsius at EMIR window             
#[Out]# IPA     =     90.0500000000004 / Instrument position angle in degrees  (degrees)
#[Out]# AIRMASS =     1.30835942623114 / AIRMASS                                        
#[Out]# AIRPRESS=             781.8377 / Mean atmospheric pressure during the RA        
#[Out]# RA      = '19:23:41.411'       / Telescope right ascension (HH:MM:SS)  (h:m:s)  
#[Out]# DEC     = '14:30:18.825'       / Telescope declination (DD:PP:SS) (d:m:s)       
#[Out]# RADEG   =     290.922547408529 / Telescope right ascension in decimal degrees. (
#[Out]# DECDEG  =     14.5052292777092 / Telescope declination in degrees (degrees)     
#[Out]# OESTATE =                    2 / Observing State (OFF/SLEWING/TRACKING/GUIDING) 
#[Out]# AZIMUTH =     259.498906824101 / Tel. azimuth at start time (degrees)           
#[Out]# ELEVAT  =     49.7979634711328 / Elevation at start of observation (degrees)    
#[Out]# ROTANG  =     157.738519685649 / Rotator position angle in degrees.             
#[Out]# TURNTBL1=    -40.0022601744186 / Turntable1 position in degrees                 
#[Out]# ARMROT1 =           29.9986125 / ArmRotator1 position in degrees                
#[Out]# TURNTBL2=    -39.9987961785368 / Turntable2 position in degrees                 
#[Out]# ARMROT2 =          -50.0000625 / ArmRotator2 position in degrees                
#[Out]# DEWPOINT=             -10.1454 / Ambient dew point in Celsius degrees           
#[Out]# HUMIDITY=                13.81 / Ambient humidity in percent.                   
#[Out]# PRESSURE=             781.8377 / Ambient atmospheric pressure (hPascal)         
#[Out]# TAMBIENT=               18.687 / Ambient temperature in Celsius degrees         
#[Out]# WINDDIRE=                 331. / Wind direction (from) in degrees from N to E   
#[Out]# WINDSPEE=     3.18673333333391 / Wind speed in m/s                              
#[Out]# DOMETEMP=     18.7537777777778 / Temperature inside the dome                    
#[Out]# M2UX    =      1.9619699716568 / GTC secondary mirror UX position               
#[Out]# M2UY    =      2.3966600894928 / GTC secondary mirror UY position               
#[Out]# M2UZ    =    -2.50573992729187 / GTC secondary mirror UZ position               
#[Out]# M2RX    = 0.000615641998592764 / GTC secondary mirror RX position               
#[Out]# M2RY    = -0.000510331010445952 / GTC secondary mirror RY position              
#[Out]# LAMPXE1 =                    0 / GTC Xe1 spectral lamp                          
#[Out]# LAMPNE1 =                    0 / GTC Ne1 spectral lamp                          
#[Out]# LAMPHG1 =                    0 / GTC Hg(Ar)1 spectral lamp                      
#[Out]# LAMPXE2 =                    0 / GTC Hg(Ar)2 spectral lamp                      
#[Out]# LAMPNE2 =                    0 / GTC Ne2 spectral lamp                          
#[Out]# LAMPHG2 =                    0 / GTC Hg(Ar)2 spectral lamp                      
#[Out]# LAMPINCD=                    0 / GTC incandescent lamp                          
#[Out]# LAMPINTN=                   0. / GTC incandescent lamp intensity                
#[Out]# OBJECT  = 'W51A    '           / Object name                                    
#[Out]# INSMODE = '        '           / Instrument Mode                                
#[Out]# OBSTYPE = 'OBJECT  '           / Observation Type                               
#[Out]# PI      = 'aginsburg'          / Principal Investigator                         
#[Out]# OBSERVER= 'SA      '           / Observer Name (SA = support astronomer)        
#[Out]# GTCPRGID= 'GTC2-20AFLO'        / Program Identifier                             
#[Out]# GTCOBID = '0001    '           / Observation Block ID                           
#[Out]# TELESCOP= 'GTC     '           / Telescope id.                                  
#[Out]# OBSMODE = 'STARE_IMAGE'        / Observation Mode                               
#[Out]# ORIGIN  = 'GRANTECAN'          / FITS file originator                           
#[Out]# OBSERVAT= 'ORM     '           / Name of observatory (IRAF style)               
#[Out]# LATITUDE= '+28:45:43.2'        / Telescope latitude (degrees), +28:45:43.2      
#[Out]# LONGITUD= '+17:52:39.5'        / Telescope longitude (degrees), +17:52:39.5     
#[Out]# HEIGHT  =                 2348 / Telescope height above sea level (m)           
#[Out]# CTYPE1  = 'RA---ZPN'           / R.A. in tangent plane projection               
#[Out]# CTYPE2  = 'DEC--ZPN'           / DEC. in tangent plane projection               
#[Out]# RADESYS = 'FK5     '           / Equatorial coordinate system                   
#[Out]# EQUINOX =                2000. / Epoch of the mean equinox for WCS              
#[Out]# CRVAL1  =     290.922547408529 / RA at Ref pix in decimal degrees               
#[Out]# CRVAL2  =     14.5052292777092 / DEC at Ref pix in decimal degrees              
#[Out]# CRPIX1  =      1022.4864072389 / Ref pix of axis 1                              
#[Out]# CRPIX2  =     1016.55651287301 / Ref pix of axis 2                              
#[Out]# CD1_1   = -5.41620904877093E-05 / WCS matrix element 1,1                        
#[Out]# CD1_2   = -4.72653524372305E-08 / WCS matrix element 1,2                        
#[Out]# CD2_1   = 4.72653524372305E-08 / WCS matrix element 2,1                         
#[Out]# CD2_2   = -5.41620904877093E-05 / WCS matrix element 2,2                        
#[Out]# PV2_1   =                   1.                                                  
#[Out]# PV2_2   =                   0.                                                  
#[Out]# PV2_3   =              14584.8                                                  
#[Out]# PV2_4   =                   0.                                                  
#[Out]# PV2_5   =         1755295542.4                                                  
#[Out]# PCD1_1  = -3.58179062439342E-17 / WCS matrix element 1,1                        
#[Out]# PCD1_2  =            0.1949836 / WCS matrix element 1,2                         
#[Out]# PCD2_1  =           -0.1949836 / WCS matrix element 2,1                         
#[Out]# PCD2_2  = -3.58179062439342E-17 / WCS matrix element 2,2                        
#[Out]# PCRPIX1 =              1022.49 / Reference pixel for coordinate transformation  
#[Out]# PCRPIX2 =              1016.56 / Reference pixel for coordinate transformation  
#[Out]# BUNIT   = 'ADU     '           / Data Units; adu for raw; adu/s preproc         
#[Out]# INSTRUME= 'EMIR    '           / EMIR                                           
#[Out]# COMMENT ***OBSERVATION BLOCK****                                                
#[Out]# DATE-OBS= '2020-07-13T03:53:27.71' / Date of observation (start) in Y2K complian
#[Out]# UTC     = '03:53:27.719928'    / Coordinate UT of the observation (start)       
#[Out]# DETPA   =                   0. / Detector position angle [deg] wrt FP           
#[Out]# DTUPA   =           2.35797393 / DTU position angle [deg] wrt FP                
#[Out]# FPPA    =                 270. / Focal Plane position angle [deg] wrt nominal FO
#[Out]# PSCFP   =               1.1746 / Plate scale at the focal plane                 
#[Out]# PXSZCSU =                0.166 / Projected pixel size at the focal plane (CSU)  
#[Out]# PXSZDET =                  18. / Pixel size at the detector                     
#[Out]# ROTOFF  =                90.05 / Rotator offset                                 
#[Out]# COMMENT ***INSTRUMENT CONF. BLOCK***                                            
#[Out]# TELPOS  = 'SOURCE  '           / TELPOS (SKY/SOURCE/SKYFLAT/DOMEFLAT/NOD_A/NOD_B
#[Out]# FILTPOS =                    2 / Filter wheel position                          
#[Out]# GRISMPOS=                    6 / Grism wheel position                           
#[Out]# FILTER  = 'J       '           / Filter name                                    
#[Out]# GRISM   = 'OPEN    '           / Grism name                                     
#[Out]# XDTU    =    -221.300003051758 / Actual DTU-X position                          
#[Out]# YDTU    =    -36.6703987121582 / Actual DTU-Y position                          
#[Out]# ZDTU    =    -534.966979980469 / Actual DTU-Z position                          
#[Out]# XDTU_0  =    -220.880996704102 / DTU-X which centres the detector in FOV        
#[Out]# YDTU_0  =    -36.6697998046875 / DTU-Y which centres the detector in FOV        
#[Out]# ZDTU_0  =     -535.02099609375 / DTU-Z which best focus the det.                
#[Out]# CSUCONFF= 'UNKNOWN '           / CSU Configuration File                         
#[Out]# MASKID  = '        '           / Mask identifier                                
#[Out]# OBJSL1  = '        '           / Objects assigned to slit                       
#[Out]# COMSL1  = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL2  = '        '           / Objects assigned to slit                       
#[Out]# COMSL2  = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL3  = '        '           / Objects assigned to slit                       
#[Out]# COMSL3  = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL4  = '        '           / Objects assigned to slit                       
#[Out]# COMSL4  = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL5  = '        '           / Objects assigned to slit                       
#[Out]# COMSL5  = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL6  = '        '           / Objects assigned to slit                       
#[Out]# COMSL6  = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL7  = '        '           / Objects assigned to slit                       
#[Out]# COMSL7  = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL8  = '        '           / Objects assigned to slit                       
#[Out]# COMSL8  = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL9  = '        '           / Objects assigned to slit                       
#[Out]# COMSL9  = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL10 = '        '           / Objects assigned to slit                       
#[Out]# COMSL10 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL11 = '        '           / Objects assigned to slit                       
#[Out]# COMSL11 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL12 = '        '           / Objects assigned to slit                       
#[Out]# COMSL12 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL13 = '        '           / Objects assigned to slit                       
#[Out]# COMSL13 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL14 = '        '           / Objects assigned to slit                       
#[Out]# COMSL14 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL15 = '        '           / Objects assigned to slit                       
#[Out]# COMSL15 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL16 = '        '           / Objects assigned to slit                       
#[Out]# COMSL16 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL17 = '        '           / Objects assigned to slit                       
#[Out]# COMSL17 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL18 = '        '           / Objects assigned to slit                       
#[Out]# COMSL18 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL19 = '        '           / Objects assigned to slit                       
#[Out]# COMSL19 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL20 = '        '           / Objects assigned to slit                       
#[Out]# COMSL20 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL21 = '        '           / Objects assigned to slit                       
#[Out]# COMSL21 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL22 = '        '           / Objects assigned to slit                       
#[Out]# COMSL22 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL23 = '        '           / Objects assigned to slit                       
#[Out]# COMSL23 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL24 = '        '           / Objects assigned to slit                       
#[Out]# COMSL24 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL25 = '        '           / Objects assigned to slit                       
#[Out]# COMSL25 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL26 = '        '           / Objects assigned to slit                       
#[Out]# COMSL26 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL27 = '        '           / Objects assigned to slit                       
#[Out]# COMSL27 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL28 = '        '           / Objects assigned to slit                       
#[Out]# COMSL28 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL29 = '        '           / Objects assigned to slit                       
#[Out]# COMSL29 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL30 = '        '           / Objects assigned to slit                       
#[Out]# COMSL30 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL31 = '        '           / Objects assigned to slit                       
#[Out]# COMSL31 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL32 = '        '           / Objects assigned to slit                       
#[Out]# COMSL32 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL33 = '        '           / Objects assigned to slit                       
#[Out]# COMSL33 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL34 = '        '           / Objects assigned to slit                       
#[Out]# COMSL34 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL35 = '        '           / Objects assigned to slit                       
#[Out]# COMSL35 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL36 = '        '           / Objects assigned to slit                       
#[Out]# COMSL36 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL37 = '        '           / Objects assigned to slit                       
#[Out]# COMSL37 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL38 = '        '           / Objects assigned to slit                       
#[Out]# COMSL38 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL39 = '        '           / Objects assigned to slit                       
#[Out]# COMSL39 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL40 = '        '           / Objects assigned to slit                       
#[Out]# COMSL40 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL41 = '        '           / Objects assigned to slit                       
#[Out]# COMSL41 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL42 = '        '           / Objects assigned to slit                       
#[Out]# COMSL42 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL43 = '        '           / Objects assigned to slit                       
#[Out]# COMSL43 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL44 = '        '           / Objects assigned to slit                       
#[Out]# COMSL44 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL45 = '        '           / Objects assigned to slit                       
#[Out]# COMSL45 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL46 = '        '           / Objects assigned to slit                       
#[Out]# COMSL46 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL47 = '        '           / Objects assigned to slit                       
#[Out]# COMSL47 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL48 = '        '           / Objects assigned to slit                       
#[Out]# COMSL48 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL49 = '        '           / Objects assigned to slit                       
#[Out]# COMSL49 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL50 = '        '           / Objects assigned to slit                       
#[Out]# COMSL50 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL51 = '        '           / Objects assigned to slit                       
#[Out]# COMSL51 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL52 = '        '           / Objects assigned to slit                       
#[Out]# COMSL52 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL53 = '        '           / Objects assigned to slit                       
#[Out]# COMSL53 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL54 = '        '           / Objects assigned to slit                       
#[Out]# COMSL54 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL55 = '        '           / Objects assigned to slit                       
#[Out]# COMSL55 = '        '           / Object comment in the user catalogue.          
#[Out]# COMMENT *****EXPOSURE BLOCK*****                                                
#[Out]# READMODE= 'CDS     '           / Detector readout mode in string                
#[Out]# EXPTIME =             9.999657 / [s] Exposure time                              
#[Out]# SECTIME =            11.054887 / [s] Total time per sequence                    
#[Out]# NOBSBLCK=                   13 / Requested blocks in the obs. sequence          
#[Out]# OBSBLOCK=                    1 / Counter of the block sequence                  
#[Out]# NIMGOBBL=                    7 / Requested number of images per obs. block      
#[Out]# IMGOBBL =                    1 / Counter of the image sequence                  
#[Out]# COMMENT *****DETECTOR BLOCK*****                                                
#[Out]# DRIFTCOR=                    T / Correction applied                             
#[Out]# COMMENT  *****INSTRUMENT STATUS BLOCK*****                                      
#[Out]# CYCLENUM= 'II      '           / Number of temperature cycle                    
#[Out]# SKYADD  =                    F / Sky observed                                   
#[Out]# OBJRADIO=                  30. / Nodd throw radius for the dither pattern.      
#[Out]# COMMENT *****TELESCOPE BLOCK*****                                               
#[Out]# COMMENT *****PROCESSING BLOCK*****                                              
ww = WCS(filehandle[0].header)
from astropy.wcs import WCS
ww = WCS(filehandle[0].header)
get_ipython().run_line_magic('matplotlib', 'nbagg')
import pylab as pl
from astropy import visualization
matplotlib.matplotlib_fname()
import matplotlib
matplotlib.matplotlib_fname()
#[Out]# '/orange/adamginsburg/miniconda3/lib/python3.7/site-packages/matplotlib/mpl-data/matplotlibrc'
pl.subplot(projection=ww)
pl.imshow(filehandle[0].data)
#[Out]# <matplotlib.image.AxesImage at 0x2b610eb92b00>
get_ipython().run_line_magic('matplotlib', 'inline')
import pylab as pl
from astropy import visualization
pl.subplot(projection=ww)
pl.imshow(filehandle[0].data)
#[Out]# <matplotlib.image.AxesImage at 0x2b610ef54048>
get_ipython().run_line_magic('matplotlib', 'inline')
import pylab as pl
from astropy import visualization
pl.styles.use('dark_background')
get_ipython().run_line_magic('matplotlib', 'inline')
import pylab as pl
from astropy import visualization
pl.style.use('dark_background')
pl.subplot(projection=ww)
pl.imshow(filehandle[0].data)
#[Out]# <matplotlib.image.AxesImage at 0x2b6111090c18>
pl.figure(figsize=(12,12))
pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99))
#[Out]# <matplotlib.image.AxesImage at 0x2b611115ffd0>
from astroquery.vizier import Vizier
cy, cx = filehandle[0].data.shape / 2
center = ww.wcs_pix2world(cx, cy, 0)
cy, cx = (x/2 for x in filehandle[0].data.shape)
center = ww.wcs_pix2world(cx, cy, 0)
cy, cx = (x/2 for x in filehandle[0].data.shape)
center = ww.wcs_pix2world(cx, cy, 0)
center
#[Out]# [array(290.92240637), array(14.50477208)]
from astroquery.vizier import Vizier
from astropy import coordinates, units as u
cy, cx = (x/2 for x in filehandle[0].data.shape)
center = coordinates.SkyCoord(*ww.wcs_pix2world(cx, cy, 0)*u.deg, frame='fk5')
center
#[Out]# <SkyCoord (FK5: equinox=J2000.000): (ra, dec) in deg
#[Out]#     (290.92240637, 14.50477208)>
Vizier.query_region(center, radius=5*u.arcmin, catalog='2MASS')
#[Out]# TableList with 2 tables:
#[Out]# 	'0:II/246/out' with 15 column(s) and 50 row(s) 
#[Out]# 	'1:VII/233/xsc' with 13 column(s) and 12 row(s) 
Vizier(row_limit=10000).query_region(center, radius=5*u.arcmin, catalog='2MASS')
#[Out]# TableList with 2 tables:
#[Out]# 	'0:II/246/out' with 15 column(s) and 1716 row(s) 
#[Out]# 	'1:VII/233/xsc' with 13 column(s) and 12 row(s) 
tables = Vizier(row_limit=10000).query_region(center, radius=5*u.arcmin, catalog='2MASS')
table = tables[0]
table
#[Out]# <Table length=1716>
#[Out]#  RAJ2000    DEJ2000        _2MASS        Jmag   e_Jmag ... Bflg Cflg  Xflg  Aflg
#[Out]#    deg        deg                        mag     mag   ...                      
#[Out]#  float64    float64        str17       float32 float32 ... str3 str3 uint8 uint8
#[Out]# ---------- ---------- ---------------- ------- ------- ... ---- ---- ----- -----
#[Out]# 290.874978  14.435305 19232999+1426070  14.476   0.036 ...  111  00c     0     0
#[Out]# 290.911328  14.430030 19233871+1425481  15.728   0.078 ...  111  000     0     0
#[Out]# 290.910689  14.434605 19233856+1426045  15.396   0.076 ...  111  ccc     0     0
#[Out]# 290.911945  14.427302 19233886+1425382  13.687   0.031 ...  111  000     0     0
#[Out]# 290.909739  14.426192 19233833+1425342  15.914   0.131 ...  111  c00     0     0
#[Out]# 290.911764  14.424986 19233882+1425299  13.565   0.032 ...  111  000     0     0
#[Out]# 290.912462  14.432902 19233899+1425584  15.786   0.076 ...  111  000     0     0
#[Out]# 290.909358  14.423078 19233824+1425230  14.609   0.035 ...  121  0cc     0     0
#[Out]# 290.909538  14.424500 19233828+1425282  15.417      -- ...  021  0c0     0     0
#[Out]#        ...        ...              ...     ...     ... ...  ...  ...   ...   ...
#[Out]# 290.950200  14.565629 19234804+1433562  16.001   0.115 ...  110  000     2     0
#[Out]# 290.949962  14.564198 19234799+1433511  16.505   0.141 ...  100  000     2     0
#[Out]# 290.963596  14.576619 19235126+1434358  14.674      -- ...  022  0cc     0     0
#[Out]# 290.951234  14.577243 19234829+1434380  16.328      -- ...  001  000     0     0
#[Out]# 290.951408  14.580699 19234833+1434505  15.585   0.087 ...  111  000     0     0
#[Out]# 290.946172  14.580816 19234708+1434509  14.777   0.054 ...  111  000     0     0
#[Out]# 290.977730  14.562895 19235465+1433464  16.854      -- ...  001  000     2     0
#[Out]# 290.948752  14.581684 19234770+1434540  16.948      -- ...  011  000     0     0
#[Out]# 290.977786  14.565290 19235466+1433550  15.644      -- ...  011  0c0     2     0
#[Out]# 290.948769  14.582990 19234770+1434587  16.347   0.123 ...  100  000     0     0
table_coordinates = coordinates.SkyCoord(table['RAJ2000'], table['DEJ2000'], frame='fk5')
pl.figure(figsize=(12,12))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99))
pl.plot(table_coordinates.ra, table_coordinates.dec, transform=ax.get_transform('world'))
#[Out]# [<matplotlib.lines.Line2D at 0x2b6112674320>]
pl.figure(figsize=(12,12))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99))
pl.plot(table_coordinates.ra, table_coordinates.dec, transform=ax.get_transform('world'), marker='wx')
pl.figure(figsize=(12,12))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99))
pl.plot(table_coordinates.ra, table_coordinates.dec, transform=ax.get_transform('world'), marker='x', color='w')
#[Out]# [<matplotlib.lines.Line2D at 0x2b61129d36d8>]
pl.figure(figsize=(12,12))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99))
pl.plot(table_coordinates.ra, table_coordinates.dec, transform=ax.get_transform('world'), marker='x', color='w', linestyle='none')
#[Out]# [<matplotlib.lines.Line2D at 0x2b6112a68780>]
pl.figure(figsize=(12,12))
ax = pl.subplot(projection=ww)
axlims = ax.axis()
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99))
pl.plot(table_coordinates.ra, table_coordinates.dec, transform=ax.get_transform('world'), marker='x', color='w', linestyle='none')
ax.axis(axlims)
#[Out]# (0.0, 1.0, 0.0, 1.0)
pl.figure(figsize=(12,12))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99))
axlims = ax.axis()
pl.plot(table_coordinates.ra, table_coordinates.dec, transform=ax.get_transform('world'), marker='x', color='w', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
brightstars = table['Kmag'] < 10
pl.figure(figsize=(12,12))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99))
axlims = ax.axis()
pl.plot(table_coordinates.ra[brightstars], table_coordinates.dec[brightstars], transform=ax.get_transform('world'), marker='x', color='w', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
pl.figure(figsize=(12,12))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
axlims = ax.axis()
pl.plot(table_coordinates.ra[brightstars], table_coordinates.dec[brightstars], transform=ax.get_transform('world'), marker='x', color='w', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
from photutils import DAOStarFinder
std = filehandle[0].data.std() # crummy guess!!
daofind = DAOStarFinder(fwhm=3.0, threshold=5.*std)
starcat = daofind(filehandle[0].data - np.median(filehandle[0].data)) 
starcat
#[Out]# <Table length=258>
#[Out]#   id      xcentroid      ...        flux                 mag         
#[Out]# int64      float64       ...      float64              float64       
#[Out]# ----- ------------------ ... ------------------ ---------------------
#[Out]#     1  287.9700850298652 ...  5.166097034800846   -1.7829063981679578
#[Out]#     2  1304.852235218743 ...  1.654808948514731   -0.5468696517818874
#[Out]#     3  697.4116669665292 ... 1.9048347039793152   -0.6996432370838013
#[Out]#     4 1633.1442249028848 ... 1.1502752755029957   -0.1520044624618978
#[Out]#     5 1054.3503310555595 ... 2.3718053740052456   -0.9376976218660549
#[Out]#     6 1659.5769719916764 ...  2.541534385035888   -1.0127399743849508
#[Out]#     7 1665.9293754741275 ...  5.351397890710092   -1.8211681078203779
#[Out]#     8 1568.3300173689129 ... 3.2157891870242086   -1.2682189264402546
#[Out]#     9 1279.8452151362637 ... 1.1713922493576279  -0.17175586536364737
#[Out]#    10 1840.0230189800131 ... 1.0769662827824311  -0.08050526699436303
#[Out]#   ...                ... ...                ...                   ...
#[Out]#   249 1545.6013598426484 ...  5.022044625554629   -1.7522014187648494
#[Out]#   250 1917.8647117743872 ...   5.10273133042265   -1.7695067560321198
#[Out]#   251  693.2974170967494 ... 1.9043478372539704   -0.6993656925829771
#[Out]#   252  65.63278618915696 ... 1.8314866512568613   -0.6570093941699704
#[Out]#   253  833.0293607623491 ...  2.365648448118481   -0.9348755147342993
#[Out]#   254  65.94338658143386 ...  4.269323383601497   -1.5758976301549352
#[Out]#   255  2006.256010558064 ... 1.0445644071035258  -0.04733805858230442
#[Out]#   256 1783.3036370430382 ... 5.1739943330785705    -1.784564871777532
#[Out]#   257 1338.5532616480493 ...  5.800416081031218   -1.9086478697757026
#[Out]#   258 1920.6323306541221 ...  1.038588058617489 -0.041108312241218005
pl.figure(figsize=(12,12))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
pl.plot(starcat['xcentroid'], starcat['ycentroid'], 'wx')
#[Out]# [<matplotlib.lines.Line2D at 0x2b6112c0e780>]
get_ipython().run_line_magic('', 'pip install tweakwcs')
get_ipython().run_line_magic('pip', 'install tweakwcs')
get_ipython().run_line_magic('pip', 'install stsci.stimage')
get_ipython().system('module load gcc')
get_ipython().run_line_magic('pip', 'install stsci.stimage')
import stsci.stimage
import stsci.stimage
import stsci.stimage
stsci.stimage.xyxymatch
#[Out]# <function stsci.stimage.xyxymatch(input, ref, origin=(0.0, 0.0), mag=(1.0, 1.0), rotation=(0.0, 0.0), ref_origin=(0.0, 0.0), algorithm='tolerance', tolerance=1.0, separation=9.0, nmatch=30, maxratio=10.0, nreject=10)>
get_ipython().run_line_magic('pinfo', 'stsci.stimage.xyxymatch')
coords_in = np.array([starcat['xcentroid'], starcat['ycentroid']])
coords_ref = np.array([table_coordinates.ra.value, table_coordinates.dec.value])
stsci.stimage.xyxymatch(coords_in, coords_ref)
########################################################
# Started Logging At: 2020-10-22 12:42:19
########################################################
########################################################
# # Started Logging At: 2020-10-22 12:42:20
########################################################
########################################################
# Started Logging At: 2020-10-22 12:42:25
########################################################
########################################################
# # Started Logging At: 2020-10-22 12:42:25
########################################################
get_ipython().run_line_magic('cd', 'GTC2-20AFLO/OB0001/object')
files = get_ipython().getoutput('ls *fits')
files[0]
#[Out]# '0002613543-20200712-EMIR-STARE_IMAGE.fits'
from astropy.io import fits
filehandle = fits.open(files[0])
filehandle
#[Out]# [<astropy.io.fits.hdu.image.PrimaryHDU object at 0x2b6e0cf8c400>]
from astropy.wcs import WCS
ww = WCS(filehandle[0].header)
get_ipython().run_line_magic('matplotlib', 'inline')
import pylab as pl
from astropy import visualization
pl.style.use('dark_background')
pl.figure(figsize=(12,12))
pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99))
#[Out]# <matplotlib.image.AxesImage at 0x2b6e121550f0>
from astroquery.vizier import Vizier
from astropy import coordinates, units as u
cy, cx = (x/2 for x in filehandle[0].data.shape)
center = coordinates.SkyCoord(*ww.wcs_pix2world(cx, cy, 0)*u.deg, frame='fk5')
center
#[Out]# <SkyCoord (FK5: equinox=J2000.000): (ra, dec) in deg
#[Out]#     (290.92240637, 14.50477208)>
tables = Vizier(row_limit=10000).query_region(center, radius=5*u.arcmin, catalog='2MASS')
table = tables[0]
table
#[Out]# <Table length=1716>
#[Out]#  RAJ2000    DEJ2000        _2MASS        Jmag   e_Jmag ... Bflg Cflg  Xflg  Aflg
#[Out]#    deg        deg                        mag     mag   ...                      
#[Out]#  float64    float64        str17       float32 float32 ... str3 str3 uint8 uint8
#[Out]# ---------- ---------- ---------------- ------- ------- ... ---- ---- ----- -----
#[Out]# 290.874978  14.435305 19232999+1426070  14.476   0.036 ...  111  00c     0     0
#[Out]# 290.911328  14.430030 19233871+1425481  15.728   0.078 ...  111  000     0     0
#[Out]# 290.910689  14.434605 19233856+1426045  15.396   0.076 ...  111  ccc     0     0
#[Out]# 290.911945  14.427302 19233886+1425382  13.687   0.031 ...  111  000     0     0
#[Out]# 290.909739  14.426192 19233833+1425342  15.914   0.131 ...  111  c00     0     0
#[Out]# 290.911764  14.424986 19233882+1425299  13.565   0.032 ...  111  000     0     0
#[Out]# 290.912462  14.432902 19233899+1425584  15.786   0.076 ...  111  000     0     0
#[Out]# 290.909358  14.423078 19233824+1425230  14.609   0.035 ...  121  0cc     0     0
#[Out]# 290.909538  14.424500 19233828+1425282  15.417      -- ...  021  0c0     0     0
#[Out]#        ...        ...              ...     ...     ... ...  ...  ...   ...   ...
#[Out]# 290.950200  14.565629 19234804+1433562  16.001   0.115 ...  110  000     2     0
#[Out]# 290.949962  14.564198 19234799+1433511  16.505   0.141 ...  100  000     2     0
#[Out]# 290.963596  14.576619 19235126+1434358  14.674      -- ...  022  0cc     0     0
#[Out]# 290.951234  14.577243 19234829+1434380  16.328      -- ...  001  000     0     0
#[Out]# 290.951408  14.580699 19234833+1434505  15.585   0.087 ...  111  000     0     0
#[Out]# 290.946172  14.580816 19234708+1434509  14.777   0.054 ...  111  000     0     0
#[Out]# 290.977730  14.562895 19235465+1433464  16.854      -- ...  001  000     2     0
#[Out]# 290.948752  14.581684 19234770+1434540  16.948      -- ...  011  000     0     0
#[Out]# 290.977786  14.565290 19235466+1433550  15.644      -- ...  011  0c0     2     0
#[Out]# 290.948769  14.582990 19234770+1434587  16.347   0.123 ...  100  000     0     0
table_coordinates = coordinates.SkyCoord(table['RAJ2000'], table['DEJ2000'], frame='fk5')
pl.figure(figsize=(12,12))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99))
pl.plot(table_coordinates.ra, table_coordinates.dec, transform=ax.get_transform('world'), marker='x', color='w', linestyle='none')
#[Out]# [<matplotlib.lines.Line2D at 0x2b6e182ad908>]
pl.figure(figsize=(12,12))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99))
axlims = ax.axis()
pl.plot(table_coordinates.ra, table_coordinates.dec, transform=ax.get_transform('world'), marker='x', color='w', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
brightstars = table['Kmag'] < 10
pl.figure(figsize=(12,12))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
axlims = ax.axis()
pl.plot(table_coordinates.ra[brightstars], table_coordinates.dec[brightstars], transform=ax.get_transform('world'), marker='x', color='w', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
from photutils import DAOStarFinder
std = filehandle[0].data.std() # crummy guess!!
daofind = DAOStarFinder(fwhm=3.0, threshold=5.*std)
starcat = daofind(filehandle[0].data - np.median(filehandle[0].data)) 
starcat
#[Out]# <Table length=258>
#[Out]#   id      xcentroid      ...        flux                 mag         
#[Out]# int64      float64       ...      float64              float64       
#[Out]# ----- ------------------ ... ------------------ ---------------------
#[Out]#     1  287.9700850298652 ...  5.166097034800846   -1.7829063981679578
#[Out]#     2  1304.852235218743 ...  1.654808948514731   -0.5468696517818874
#[Out]#     3  697.4116669665292 ... 1.9048347039793152   -0.6996432370838013
#[Out]#     4 1633.1442249028848 ... 1.1502752755029957   -0.1520044624618978
#[Out]#     5 1054.3503310555595 ... 2.3718053740052456   -0.9376976218660549
#[Out]#     6 1659.5769719916764 ...  2.541534385035888   -1.0127399743849508
#[Out]#     7 1665.9293754741275 ...  5.351397890710092   -1.8211681078203779
#[Out]#     8 1568.3300173689129 ... 3.2157891870242086   -1.2682189264402546
#[Out]#     9 1279.8452151362637 ... 1.1713922493576279  -0.17175586536364737
#[Out]#    10 1840.0230189800131 ... 1.0769662827824311  -0.08050526699436303
#[Out]#   ...                ... ...                ...                   ...
#[Out]#   249 1545.6013598426484 ...  5.022044625554629   -1.7522014187648494
#[Out]#   250 1917.8647117743872 ...   5.10273133042265   -1.7695067560321198
#[Out]#   251  693.2974170967494 ... 1.9043478372539704   -0.6993656925829771
#[Out]#   252  65.63278618915696 ... 1.8314866512568613   -0.6570093941699704
#[Out]#   253  833.0293607623491 ...  2.365648448118481   -0.9348755147342993
#[Out]#   254  65.94338658143386 ...  4.269323383601497   -1.5758976301549352
#[Out]#   255  2006.256010558064 ... 1.0445644071035258  -0.04733805858230442
#[Out]#   256 1783.3036370430382 ... 5.1739943330785705    -1.784564871777532
#[Out]#   257 1338.5532616480493 ...  5.800416081031218   -1.9086478697757026
#[Out]#   258 1920.6323306541221 ...  1.038588058617489 -0.041108312241218005
pl.figure(figsize=(12,12))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
pl.plot(starcat['xcentroid'], starcat['ycentroid'], 'wx')
#[Out]# [<matplotlib.lines.Line2D at 0x2b6e226696d8>]
import stsci.stimage
get_ipython().run_line_magic('pinfo', 'stsci.stimage.xyxymatch')
coords_in = np.array([starcat['xcentroid'], starcat['ycentroid']])
coords_ref = np.array([table_coordinates.ra.value, table_coordinates.dec.value])
stsci.stimage.xyxymatch(coords_in, coords_ref)
########################################################
# Started Logging At: 2020-10-22 12:42:58
########################################################
########################################################
# # Started Logging At: 2020-10-22 12:42:59
########################################################
coords_in = np.array([starcat['xcentroid'], starcat['ycentroid']])
coords_ref = np.array([table_coordinates.ra.value, table_coordinates.dec.value])
coords_in.shape, coords_ref.shape
########################################################
# Started Logging At: 2020-10-22 12:43:13
########################################################
########################################################
# # Started Logging At: 2020-10-22 12:43:13
########################################################
get_ipython().run_line_magic('cd', 'GTC2-20AFLO/OB0001/object')
files = get_ipython().getoutput('ls *fits')
files[0]
#[Out]# '0002613543-20200712-EMIR-STARE_IMAGE.fits'
from astropy.io import fits
filehandle = fits.open(files[0])
filehandle
#[Out]# [<astropy.io.fits.hdu.image.PrimaryHDU object at 0x2ada8cb114a8>]
from astropy.wcs import WCS
ww = WCS(filehandle[0].header)
get_ipython().run_line_magic('matplotlib', 'inline')
import pylab as pl
from astropy import visualization
pl.style.use('dark_background')
pl.figure(figsize=(12,12))
pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99))
#[Out]# <matplotlib.image.AxesImage at 0x2ada91cacf98>
from astroquery.vizier import Vizier
from astropy import coordinates, units as u
cy, cx = (x/2 for x in filehandle[0].data.shape)
center = coordinates.SkyCoord(*ww.wcs_pix2world(cx, cy, 0)*u.deg, frame='fk5')
center
#[Out]# <SkyCoord (FK5: equinox=J2000.000): (ra, dec) in deg
#[Out]#     (290.92240637, 14.50477208)>
tables = Vizier(row_limit=10000).query_region(center, radius=5*u.arcmin, catalog='2MASS')
table = tables[0]
table
#[Out]# <Table length=1716>
#[Out]#  RAJ2000    DEJ2000        _2MASS        Jmag   e_Jmag ... Bflg Cflg  Xflg  Aflg
#[Out]#    deg        deg                        mag     mag   ...                      
#[Out]#  float64    float64        str17       float32 float32 ... str3 str3 uint8 uint8
#[Out]# ---------- ---------- ---------------- ------- ------- ... ---- ---- ----- -----
#[Out]# 290.874978  14.435305 19232999+1426070  14.476   0.036 ...  111  00c     0     0
#[Out]# 290.911328  14.430030 19233871+1425481  15.728   0.078 ...  111  000     0     0
#[Out]# 290.910689  14.434605 19233856+1426045  15.396   0.076 ...  111  ccc     0     0
#[Out]# 290.911945  14.427302 19233886+1425382  13.687   0.031 ...  111  000     0     0
#[Out]# 290.909739  14.426192 19233833+1425342  15.914   0.131 ...  111  c00     0     0
#[Out]# 290.911764  14.424986 19233882+1425299  13.565   0.032 ...  111  000     0     0
#[Out]# 290.912462  14.432902 19233899+1425584  15.786   0.076 ...  111  000     0     0
#[Out]# 290.909358  14.423078 19233824+1425230  14.609   0.035 ...  121  0cc     0     0
#[Out]# 290.909538  14.424500 19233828+1425282  15.417      -- ...  021  0c0     0     0
#[Out]#        ...        ...              ...     ...     ... ...  ...  ...   ...   ...
#[Out]# 290.950200  14.565629 19234804+1433562  16.001   0.115 ...  110  000     2     0
#[Out]# 290.949962  14.564198 19234799+1433511  16.505   0.141 ...  100  000     2     0
#[Out]# 290.963596  14.576619 19235126+1434358  14.674      -- ...  022  0cc     0     0
#[Out]# 290.951234  14.577243 19234829+1434380  16.328      -- ...  001  000     0     0
#[Out]# 290.951408  14.580699 19234833+1434505  15.585   0.087 ...  111  000     0     0
#[Out]# 290.946172  14.580816 19234708+1434509  14.777   0.054 ...  111  000     0     0
#[Out]# 290.977730  14.562895 19235465+1433464  16.854      -- ...  001  000     2     0
#[Out]# 290.948752  14.581684 19234770+1434540  16.948      -- ...  011  000     0     0
#[Out]# 290.977786  14.565290 19235466+1433550  15.644      -- ...  011  0c0     2     0
#[Out]# 290.948769  14.582990 19234770+1434587  16.347   0.123 ...  100  000     0     0
table_coordinates = coordinates.SkyCoord(table['RAJ2000'], table['DEJ2000'], frame='fk5')
pl.figure(figsize=(12,12))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99))
pl.plot(table_coordinates.ra, table_coordinates.dec, transform=ax.get_transform('world'), marker='x', color='w', linestyle='none')
#[Out]# [<matplotlib.lines.Line2D at 0x2ada981d74a8>]
pl.figure(figsize=(12,12))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99))
axlims = ax.axis()
pl.plot(table_coordinates.ra, table_coordinates.dec, transform=ax.get_transform('world'), marker='x', color='w', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
brightstars = table['Kmag'] < 10
pl.figure(figsize=(12,12))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
axlims = ax.axis()
pl.plot(table_coordinates.ra[brightstars], table_coordinates.dec[brightstars], transform=ax.get_transform('world'), marker='x', color='w', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
from photutils import DAOStarFinder
std = filehandle[0].data.std() # crummy guess!!
daofind = DAOStarFinder(fwhm=3.0, threshold=5.*std)
starcat = daofind(filehandle[0].data - np.median(filehandle[0].data)) 
starcat
#[Out]# <Table length=258>
#[Out]#   id      xcentroid      ...        flux                 mag         
#[Out]# int64      float64       ...      float64              float64       
#[Out]# ----- ------------------ ... ------------------ ---------------------
#[Out]#     1  287.9700850298652 ...  5.166097034800846   -1.7829063981679578
#[Out]#     2  1304.852235218743 ...  1.654808948514731   -0.5468696517818874
#[Out]#     3  697.4116669665292 ... 1.9048347039793152   -0.6996432370838013
#[Out]#     4 1633.1442249028848 ... 1.1502752755029957   -0.1520044624618978
#[Out]#     5 1054.3503310555595 ... 2.3718053740052456   -0.9376976218660549
#[Out]#     6 1659.5769719916764 ...  2.541534385035888   -1.0127399743849508
#[Out]#     7 1665.9293754741275 ...  5.351397890710092   -1.8211681078203779
#[Out]#     8 1568.3300173689129 ... 3.2157891870242086   -1.2682189264402546
#[Out]#     9 1279.8452151362637 ... 1.1713922493576279  -0.17175586536364737
#[Out]#    10 1840.0230189800131 ... 1.0769662827824311  -0.08050526699436303
#[Out]#   ...                ... ...                ...                   ...
#[Out]#   249 1545.6013598426484 ...  5.022044625554629   -1.7522014187648494
#[Out]#   250 1917.8647117743872 ...   5.10273133042265   -1.7695067560321198
#[Out]#   251  693.2974170967494 ... 1.9043478372539704   -0.6993656925829771
#[Out]#   252  65.63278618915696 ... 1.8314866512568613   -0.6570093941699704
#[Out]#   253  833.0293607623491 ...  2.365648448118481   -0.9348755147342993
#[Out]#   254  65.94338658143386 ...  4.269323383601497   -1.5758976301549352
#[Out]#   255  2006.256010558064 ... 1.0445644071035258  -0.04733805858230442
#[Out]#   256 1783.3036370430382 ... 5.1739943330785705    -1.784564871777532
#[Out]#   257 1338.5532616480493 ...  5.800416081031218   -1.9086478697757026
#[Out]#   258 1920.6323306541221 ...  1.038588058617489 -0.041108312241218005
pl.figure(figsize=(12,12))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
pl.plot(starcat['xcentroid'], starcat['ycentroid'], 'wx')
#[Out]# [<matplotlib.lines.Line2D at 0x2ada9fcd6e48>]
import stsci.stimage
get_ipython().run_line_magic('pinfo', 'stsci.stimage.xyxymatch')
coords_in = np.array([starcat['xcentroid'], starcat['ycentroid']])
coords_ref = np.array([table_coordinates.ra.value, table_coordinates.dec.value])
coords_in.shape, coords_ref.shape
#[Out]# ((2, 258), (2, 1716))
#result = stsci.stimage.xyxymatch(coords_in, coords_ref)
#result
result = stsci.stimage.xyxymatch(coords_in.T, coords_ref.T)
result
#[Out]# array([],
#[Out]#       dtype=[('input_x', '<f8'), ('input_y', '<f8'), ('input_idx', '<u8'), ('ref_x', '<f8'), ('ref_y', '<f8'), ('ref_idx', '<u8')])
import tweakwcs
import tristars
tristars.match
import tristars.match
tristars.match.match_catalog_tri(coords_in.T, coords_ref.T)
########################################################
# Started Logging At: 2020-10-22 12:51:58
########################################################
########################################################
# # Started Logging At: 2020-10-22 12:51:59
########################################################
########################################################
# Started Logging At: 2020-10-22 12:52:22
########################################################
########################################################
# # Started Logging At: 2020-10-22 12:52:22
########################################################
get_ipython().run_line_magic('cd', 'GTC2-20AFLO/OB0001/object')
files = get_ipython().getoutput('ls *fits')
files[0]
#[Out]# '0002613543-20200712-EMIR-STARE_IMAGE.fits'
from astropy.io import fits
filehandle = fits.open(files[0])
filehandle
#[Out]# [<astropy.io.fits.hdu.image.PrimaryHDU object at 0x2ae823eaa390>]
from astropy.wcs import WCS
ww = WCS(filehandle[0].header)
get_ipython().run_line_magic('matplotlib', 'inline')
import pylab as pl
from astropy import visualization
pl.style.use('dark_background')
pl.figure(figsize=(12,12))
pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99))
#[Out]# <matplotlib.image.AxesImage at 0x2ae82d33b0f0>
from astroquery.vizier import Vizier
from astropy import coordinates, units as u
cy, cx = (x/2 for x in filehandle[0].data.shape)
center = coordinates.SkyCoord(*ww.wcs_pix2world(cx, cy, 0)*u.deg, frame='fk5')
center
#[Out]# <SkyCoord (FK5: equinox=J2000.000): (ra, dec) in deg
#[Out]#     (290.92240637, 14.50477208)>
tables = Vizier(row_limit=10000).query_region(center, radius=5*u.arcmin, catalog='2MASS')
table = tables[0]
table
#[Out]# <Table length=1716>
#[Out]#  RAJ2000    DEJ2000        _2MASS        Jmag   e_Jmag ... Bflg Cflg  Xflg  Aflg
#[Out]#    deg        deg                        mag     mag   ...                      
#[Out]#  float64    float64        str17       float32 float32 ... str3 str3 uint8 uint8
#[Out]# ---------- ---------- ---------------- ------- ------- ... ---- ---- ----- -----
#[Out]# 290.874978  14.435305 19232999+1426070  14.476   0.036 ...  111  00c     0     0
#[Out]# 290.911328  14.430030 19233871+1425481  15.728   0.078 ...  111  000     0     0
#[Out]# 290.910689  14.434605 19233856+1426045  15.396   0.076 ...  111  ccc     0     0
#[Out]# 290.911945  14.427302 19233886+1425382  13.687   0.031 ...  111  000     0     0
#[Out]# 290.909739  14.426192 19233833+1425342  15.914   0.131 ...  111  c00     0     0
#[Out]# 290.911764  14.424986 19233882+1425299  13.565   0.032 ...  111  000     0     0
#[Out]# 290.912462  14.432902 19233899+1425584  15.786   0.076 ...  111  000     0     0
#[Out]# 290.909358  14.423078 19233824+1425230  14.609   0.035 ...  121  0cc     0     0
#[Out]# 290.909538  14.424500 19233828+1425282  15.417      -- ...  021  0c0     0     0
#[Out]#        ...        ...              ...     ...     ... ...  ...  ...   ...   ...
#[Out]# 290.950200  14.565629 19234804+1433562  16.001   0.115 ...  110  000     2     0
#[Out]# 290.949962  14.564198 19234799+1433511  16.505   0.141 ...  100  000     2     0
#[Out]# 290.963596  14.576619 19235126+1434358  14.674      -- ...  022  0cc     0     0
#[Out]# 290.951234  14.577243 19234829+1434380  16.328      -- ...  001  000     0     0
#[Out]# 290.951408  14.580699 19234833+1434505  15.585   0.087 ...  111  000     0     0
#[Out]# 290.946172  14.580816 19234708+1434509  14.777   0.054 ...  111  000     0     0
#[Out]# 290.977730  14.562895 19235465+1433464  16.854      -- ...  001  000     2     0
#[Out]# 290.948752  14.581684 19234770+1434540  16.948      -- ...  011  000     0     0
#[Out]# 290.977786  14.565290 19235466+1433550  15.644      -- ...  011  0c0     2     0
#[Out]# 290.948769  14.582990 19234770+1434587  16.347   0.123 ...  100  000     0     0
table_coordinates = coordinates.SkyCoord(table['RAJ2000'], table['DEJ2000'], frame='fk5')
pl.figure(figsize=(12,12))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99))
pl.plot(table_coordinates.ra, table_coordinates.dec, transform=ax.get_transform('world'), marker='x', color='w', linestyle='none')
#[Out]# [<matplotlib.lines.Line2D at 0x2ae82f83c710>]
pl.figure(figsize=(12,12))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99))
axlims = ax.axis()
pl.plot(table_coordinates.ra, table_coordinates.dec, transform=ax.get_transform('world'), marker='x', color='w', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
brightstars = table['Kmag'] < 10
pl.figure(figsize=(12,12))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
axlims = ax.axis()
pl.plot(table_coordinates.ra[brightstars], table_coordinates.dec[brightstars], transform=ax.get_transform('world'), marker='x', color='w', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
from photutils import DAOStarFinder
std = filehandle[0].data.std() # crummy guess!!
daofind = DAOStarFinder(fwhm=3.0, threshold=5.*std)
starcat = daofind(filehandle[0].data - np.median(filehandle[0].data)) 
starcat
#[Out]# <Table length=258>
#[Out]#   id      xcentroid      ...        flux                 mag         
#[Out]# int64      float64       ...      float64              float64       
#[Out]# ----- ------------------ ... ------------------ ---------------------
#[Out]#     1  287.9700850298652 ...  5.166097034800846   -1.7829063981679578
#[Out]#     2  1304.852235218743 ...  1.654808948514731   -0.5468696517818874
#[Out]#     3  697.4116669665292 ... 1.9048347039793152   -0.6996432370838013
#[Out]#     4 1633.1442249028848 ... 1.1502752755029957   -0.1520044624618978
#[Out]#     5 1054.3503310555595 ... 2.3718053740052456   -0.9376976218660549
#[Out]#     6 1659.5769719916764 ...  2.541534385035888   -1.0127399743849508
#[Out]#     7 1665.9293754741275 ...  5.351397890710092   -1.8211681078203779
#[Out]#     8 1568.3300173689129 ... 3.2157891870242086   -1.2682189264402546
#[Out]#     9 1279.8452151362637 ... 1.1713922493576279  -0.17175586536364737
#[Out]#    10 1840.0230189800131 ... 1.0769662827824311  -0.08050526699436303
#[Out]#   ...                ... ...                ...                   ...
#[Out]#   249 1545.6013598426484 ...  5.022044625554629   -1.7522014187648494
#[Out]#   250 1917.8647117743872 ...   5.10273133042265   -1.7695067560321198
#[Out]#   251  693.2974170967494 ... 1.9043478372539704   -0.6993656925829771
#[Out]#   252  65.63278618915696 ... 1.8314866512568613   -0.6570093941699704
#[Out]#   253  833.0293607623491 ...  2.365648448118481   -0.9348755147342993
#[Out]#   254  65.94338658143386 ...  4.269323383601497   -1.5758976301549352
#[Out]#   255  2006.256010558064 ... 1.0445644071035258  -0.04733805858230442
#[Out]#   256 1783.3036370430382 ... 5.1739943330785705    -1.784564871777532
#[Out]#   257 1338.5532616480493 ...  5.800416081031218   -1.9086478697757026
#[Out]#   258 1920.6323306541221 ...  1.038588058617489 -0.041108312241218005
pl.figure(figsize=(12,12))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
pl.plot(starcat['xcentroid'], starcat['ycentroid'], 'wx')
#[Out]# [<matplotlib.lines.Line2D at 0x2ae83d897ba8>]
import stsci.stimage
import tweakwcs
coords_in = np.array([starcat['xcentroid'], starcat['ycentroid']])
coords_ref = np.array([table_coordinates.ra.value[brightstars], table_coordinates.dec.value[brightstars]])
coords_in.shape, coords_ref.shape
#[Out]# ((2, 258), (2, 31))
import tristars.match
tristars.match.match_catalog_tri(coords_in.T, coords_ref.T)
brightstars = table['Kmag'] < 11
brightstars.sum()
#[Out]# 86
pl.figure(figsize=(12,12))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
axlims = ax.axis()
pl.plot(table_coordinates.ra[brightstars], table_coordinates.dec[brightstars], transform=ax.get_transform('world'), marker='x', color='w', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
coords_in = np.array([starcat['xcentroid'], starcat['ycentroid']])
coords_ref = np.array([table_coordinates.ra.value[brightstars], table_coordinates.dec.value[brightstars]])
coords_in.shape, coords_ref.shape
#[Out]# ((2, 258), (2, 86))
import tristars.match
tristars.match.match_catalog_tri(coords_in.T, coords_ref.T)
tristars.match.match_catalog_tri(coords_in.T, coords_ref.T, ignore_size=False, ignore_rot=False)
tristars.match.match_catalog_tri(coords_in.T, coords_ref.T, ignore_scale=False, ignore_rot=False)
tristars.match.match_catalog_tri(coords_in.T[::3,:], coords_ref.T, ignore_scale=False, ignore_rot=True)
filehandle[0.header]
filehandle[0].header
#[Out]# SIMPLE  =                    T / file does conform to FITS standard             
#[Out]# BITPIX  =                   16 / number of bits per data pixel                  
#[Out]# NAXIS   =                    2 / number of data axes                            
#[Out]# NAXIS1  =                 2048 / length of data axis 1                          
#[Out]# NAXIS2  =                 2048 / length of data axis 2                          
#[Out]# EXTEND  =                    T / FITS dataset may contain extensions            
#[Out]# COMMENT   FITS (Flexible Image Transport System) format is defined in 'Astronomy
#[Out]# COMMENT   and Astrophysics', volume 376, page 359; bibcode: 2001A&A...376..359H 
#[Out]# BZERO   =                32768 / offset data range to that of unsigned short    
#[Out]# BSCALE  =                    1 / default scaling factor                         
#[Out]# DETVER  = 'SCI     '           / 401 Detector used: science or engineering      
#[Out]# NSEC    =                    1 / 402 Number of sequences executed at detector   
#[Out]# NRST    =                    1 / 403 Number of resets                           
#[Out]# OPTRST  =                    3 / 404 Type of reset                              
#[Out]# NIMGRST =                    1 / 405 Number of reset images                     
#[Out]# NRDBL_ND=                    0 / 406 Number of non-productive reads before loop 
#[Out]# NRDBL   =                    0 / 407 Number of productive reads before loop     
#[Out]# NLOOP   =                    1 / 408 Exposure Number                            
#[Out]# TOPER   =                  559 / [ms] 409 Time period in the detector sequence f
#[Out]# NRDIL_ND=                    8 / 410 Number of non-productibe reads per loop ite
#[Out]# NRDIL   =                    1 / 411 Number of productive reads per loop iterati
#[Out]# Y_SIZE  =                 1024 / 412 Offset in pixels for window mode           
#[Out]# Y_SIZE_B=                    0 / 413 Number of readable columns (1024 - Y_SIZE) 
#[Out]# NPARAM_X=                    0 / 414 Number of dummy readouts of a line         
#[Out]# GAIN    =                  3.3 / 416 Gain, in e-/ADU                            
#[Out]# RON     =                  6.2 / 417 Read-out noise, in ADU                     
#[Out]# VOFFSET =                   0. / 418 Voff                                       
#[Out]# VRESET  =                   0. / 419 Vreset                                     
#[Out]# WINMODE =                    0 / 420 Window mode: full, 128px                   
#[Out]# BIASGATE=                   0. / 421 Biasgate                                   
#[Out]# FIRMVER = '20023   '           / 422 Controller firmware version                
#[Out]# NFRSEC  =                    2 / 423 Frames produced per detector exposure      
#[Out]# FRSEC   =                    0 / 424 Counter of the frame sequence              
#[Out]# NEXP    =                    1 / 425 Number of detector exposures               
#[Out]# EXP     =                    1 / 426 Detector exposures counter                 
#[Out]# TSTAMP  =           1594612398 / [s] Time stamp in UTC                          
#[Out]# READMODN=                    1 / E00 Readout (numerico) mode used for the observ
#[Out]# TSUTC1  =      1594612397.6684 / [s] E01 Time stamp before read detector (UTC)  
#[Out]# TSUTC2  =     1594612408.77522 / [s] E02 Time stamp after read detector (UTC)   
#[Out]# TSUTCD  =     11.1068141460419 / [s] E03 Diff. between TSUTC2 and TSUTC1        
#[Out]# ITER_NUM=                    1 / E04 frame counter                              
#[Out]# FRSTAT  =                    2 / E05 status 0=START,1=RUN,2=END,3=ABR,4=ERR     
#[Out]# APPNAME = '/work/gcsop/etc/config/emir/lods/33-18_SDSU2_MUX_v20_UNIX.lod' / E06 
#[Out]# WINDCOV =                    1 / Window blind status (OPEN/CLOSE)               
#[Out]# WINDOW  =                    1 / Window status (OPEN/CLOSE)                     
#[Out]# XDTU_C  =      -999.9990234375 / X Absolute position commanded to DTU. If not -9
#[Out]# YDTU_C  =      -999.9990234375 / Y Absolute position commanded to DTU. If not -9
#[Out]# ZDTU_C  =      -999.9990234375 / Z Absolute position commanded to DTU. If not -9
#[Out]# XDTU_F  =             0.922918 / DTU-X Scale Factor                             
#[Out]# YDTU_F  =             0.971815 / DTU-Y Scale Factor                             
#[Out]# ZDTU_F  =                   1. / DTU-Z Scale Factor                             
#[Out]# CSUP1   =    0.488999992609024 / CSU current position                           
#[Out]# CSUP2   =    0.492000013589859 / CSU current position                           
#[Out]# CSUP3   =    0.495000004768372 / CSU current position                           
#[Out]# CSUP4   =    0.493999987840652 / CSU current position                           
#[Out]# CSUP5   =    0.493000000715256 / CSU current position                           
#[Out]# CSUP6   =    0.493000000715256 / CSU current position                           
#[Out]# CSUP7   =    0.492000013589859 / CSU current position                           
#[Out]# CSUP8   =    0.495999991893768 / CSU current position                           
#[Out]# CSUP9   =     0.49099999666214 / CSU current position                           
#[Out]# CSUP10  =    0.495000004768372 / CSU current position                           
#[Out]# CSUP11  =    0.492000013589859 / CSU current position                           
#[Out]# CSUP12  =    0.508000016212463 / CSU current position                           
#[Out]# CSUP13  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP14  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP15  =    0.490000009536743 / CSU current position                           
#[Out]# CSUP16  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP17  =    0.497000008821487 / CSU current position                           
#[Out]# CSUP18  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP19  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP20  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP21  =     0.49099999666214 / CSU current position                           
#[Out]# CSUP22  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP23  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP24  =    0.492000013589859 / CSU current position                           
#[Out]# CSUP25  =     0.49099999666214 / CSU current position                           
#[Out]# CSUP26  =     0.49099999666214 / CSU current position                           
#[Out]# CSUP27  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP28  =    0.493999987840652 / CSU current position                           
#[Out]# CSUP29  =    0.492000013589859 / CSU current position                           
#[Out]# CSUP30  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP31  =     0.49099999666214 / CSU current position                           
#[Out]# CSUP32  =    0.495000004768372 / CSU current position                           
#[Out]# CSUP33  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP34  =    0.493999987840652 / CSU current position                           
#[Out]# CSUP35  =     0.49099999666214 / CSU current position                           
#[Out]# CSUP36  =     0.49099999666214 / CSU current position                           
#[Out]# CSUP37  =    0.492000013589859 / CSU current position                           
#[Out]# CSUP38  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP39  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP40  =     0.49099999666214 / CSU current position                           
#[Out]# CSUP41  =     0.49099999666214 / CSU current position                           
#[Out]# CSUP42  =    0.493999987840652 / CSU current position                           
#[Out]# CSUP43  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP44  =    0.493999987840652 / CSU current position                           
#[Out]# CSUP45  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP46  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP47  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP48  =    0.497000008821487 / CSU current position                           
#[Out]# CSUP49  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP50  =    0.493999987840652 / CSU current position                           
#[Out]# CSUP51  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP52  =    0.492000013589859 / CSU current position                           
#[Out]# CSUP53  =    0.493999987840652 / CSU current position                           
#[Out]# CSUP54  =    0.493999987840652 / CSU current position                           
#[Out]# CSUP55  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP56  =     0.49099999666214 / CSU current position                           
#[Out]# CSUP57  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP58  =    0.492000013589859 / CSU current position                           
#[Out]# CSUP59  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP60  =    0.492000013589859 / CSU current position                           
#[Out]# CSUP61  =    0.493999987840652 / CSU current position                           
#[Out]# CSUP62  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP63  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP64  =    0.492000013589859 / CSU current position                           
#[Out]# CSUP65  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP66  =    0.492000013589859 / CSU current position                           
#[Out]# CSUP67  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP68  =    0.488999992609024 / CSU current position                           
#[Out]# CSUP69  =    0.507000029087067 / CSU current position                           
#[Out]# CSUP70  =    0.490000009536743 / CSU current position                           
#[Out]# CSUP71  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP72  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP73  =    0.492000013589859 / CSU current position                           
#[Out]# CSUP74  =    0.488999992609024 / CSU current position                           
#[Out]# CSUP75  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP76  =    0.490000009536743 / CSU current position                           
#[Out]# CSUP77  =    0.495999991893768 / CSU current position                           
#[Out]# CSUP78  =     0.49099999666214 / CSU current position                           
#[Out]# CSUP79  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP80  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP81  =    0.495000004768372 / CSU current position                           
#[Out]# CSUP82  =    0.488000005483627 / CSU current position                           
#[Out]# CSUP83  =    0.493999987840652 / CSU current position                           
#[Out]# CSUP84  =    0.492000013589859 / CSU current position                           
#[Out]# CSUP85  =     0.50900000333786 / CSU current position                           
#[Out]# CSUP86  =     0.49099999666214 / CSU current position                           
#[Out]# CSUP87  =    0.495999991893768 / CSU current position                           
#[Out]# CSUP88  =    0.492000013589859 / CSU current position                           
#[Out]# CSUP89  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP90  =    0.488999992609024 / CSU current position                           
#[Out]# CSUP91  =    0.493999987840652 / CSU current position                           
#[Out]# CSUP92  =    0.488999992609024 / CSU current position                           
#[Out]# CSUP93  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP94  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP95  =    0.493000000715256 / CSU current position                           
#[Out]# CSUP96  =    0.492000013589859 / CSU current position                           
#[Out]# CSUP97  =    0.497000008821487 / CSU current position                           
#[Out]# CSUP98  =    0.492000013589859 / CSU current position                           
#[Out]# CSUP99  =    0.493999987840652 / CSU current position                           
#[Out]# CSUP100 =    0.490000009536743 / CSU current position                           
#[Out]# CSUP101 =    0.493999987840652 / CSU current position                           
#[Out]# CSUP102 =    0.490000009536743 / CSU current position                           
#[Out]# CSUP103 =    0.493999987840652 / CSU current position                           
#[Out]# CSUP104 =    0.492000013589859 / CSU current position                           
#[Out]# CSUP105 =    0.495000004768372 / CSU current position                           
#[Out]# CSUP106 =    0.493000000715256 / CSU current position                           
#[Out]# CSUP107 =    0.492000013589859 / CSU current position                           
#[Out]# CSUP108 =    0.492000013589859 / CSU current position                           
#[Out]# CSUP109 =    0.493000000715256 / CSU current position                           
#[Out]# CSUP110 =    0.490000009536743 / CSU current position                           
#[Out]# CS_0    =               10000. / CSU bars sensors                               
#[Out]# CS_1    =               10000. / CSU bars sensors                               
#[Out]# CS_2    =               10000. / CSU bars sensors                               
#[Out]# CS_3    =               10000. / CSU bars sensors                               
#[Out]# CS_4    =               10000. / CSU bars sensors                               
#[Out]# CS_5    =               10000. / CSU bars sensors                               
#[Out]# CS_6    =               10000. / CSU bars sensors                               
#[Out]# CS_7    =               10000. / CSU bars sensors                               
#[Out]# CS_8    =               10000. / CSU bars sensors                               
#[Out]# CS_9    =               10000. / CSU bars sensors                               
#[Out]# CS_10   =               10000. / CSU bars sensors                               
#[Out]# CS_11   =               10000. / CSU bars sensors                               
#[Out]# CS_12   =               10000. / CSU bars sensors                               
#[Out]# CS_13   =               10000. / CSU bars sensors                               
#[Out]# CS_14   =               10000. / CSU bars sensors                               
#[Out]# CS_15   =               10000. / CSU bars sensors                               
#[Out]# CS_16   =               10000. / CSU bars sensors                               
#[Out]# CS_17   =               10000. / CSU bars sensors                               
#[Out]# CS_18   =               10000. / CSU bars sensors                               
#[Out]# CS_19   =               10000. / CSU bars sensors                               
#[Out]# CS_20   =               10000. / CSU bars sensors                               
#[Out]# CS_21   =               10000. / CSU bars sensors                               
#[Out]# CS_22   =               10000. / CSU bars sensors                               
#[Out]# CS_23   =               10000. / CSU bars sensors                               
#[Out]# CS_24   =               10000. / CSU bars sensors                               
#[Out]# CS_25   =               10000. / CSU bars sensors                               
#[Out]# CS_26   =               10000. / CSU bars sensors                               
#[Out]# CS_27   =               10000. / CSU bars sensors                               
#[Out]# CS_28   =               10000. / CSU bars sensors                               
#[Out]# CS_29   =               10000. / CSU bars sensors                               
#[Out]# CS_30   =               10000. / CSU bars sensors                               
#[Out]# CS_31   =               10000. / CSU bars sensors                               
#[Out]# CS_32   =               10000. / CSU bars sensors                               
#[Out]# CS_33   =               10000. / CSU bars sensors                               
#[Out]# CS_34   =               10000. / CSU bars sensors                               
#[Out]# CS_35   =               10000. / CSU bars sensors                               
#[Out]# CS_36   =               10000. / CSU bars sensors                               
#[Out]# CS_37   =               10000. / CSU bars sensors                               
#[Out]# CS_38   =               10000. / CSU bars sensors                               
#[Out]# CS_39   =               10000. / CSU bars sensors                               
#[Out]# CS_40   =               10000. / CSU bars sensors                               
#[Out]# CS_41   =               10000. / CSU bars sensors                               
#[Out]# CS_42   =               10000. / CSU bars sensors                               
#[Out]# CS_43   =               10000. / CSU bars sensors                               
#[Out]# CS_44   =               10000. / CSU bars sensors                               
#[Out]# CS_45   =               10000. / CSU bars sensors                               
#[Out]# CS_46   =               10000. / CSU bars sensors                               
#[Out]# CS_47   =               10000. / CSU bars sensors                               
#[Out]# CS_48   =               10000. / CSU bars sensors                               
#[Out]# CS_49   =               10000. / CSU bars sensors                               
#[Out]# CS_50   =               10000. / CSU bars sensors                               
#[Out]# CS_51   =               10000. / CSU bars sensors                               
#[Out]# CS_52   =               10000. / CSU bars sensors                               
#[Out]# CS_53   =               10000. / CSU bars sensors                               
#[Out]# CS_54   =               10000. / CSU bars sensors                               
#[Out]# CS_55   =               10000. / CSU bars sensors                               
#[Out]# CS_56   =               10000. / CSU bars sensors                               
#[Out]# CS_57   =               10000. / CSU bars sensors                               
#[Out]# CS_58   =               10000. / CSU bars sensors                               
#[Out]# CS_59   =               10000. / CSU bars sensors                               
#[Out]# CS_60   =               10000. / CSU bars sensors                               
#[Out]# CS_61   =               10000. / CSU bars sensors                               
#[Out]# CS_62   =               10000. / CSU bars sensors                               
#[Out]# CS_63   =               10000. / CSU bars sensors                               
#[Out]# CS_64   =               10000. / CSU bars sensors                               
#[Out]# CS_65   =               10000. / CSU bars sensors                               
#[Out]# CS_66   =               10000. / CSU bars sensors                               
#[Out]# CS_67   =               10000. / CSU bars sensors                               
#[Out]# CS_68   =               10000. / CSU bars sensors                               
#[Out]# CS_69   =               10000. / CSU bars sensors                               
#[Out]# CS_70   =               10000. / CSU bars sensors                               
#[Out]# CS_71   =               10000. / CSU bars sensors                               
#[Out]# CS_72   =               10000. / CSU bars sensors                               
#[Out]# CS_73   =               10000. / CSU bars sensors                               
#[Out]# CS_74   =               10000. / CSU bars sensors                               
#[Out]# CS_75   =               10000. / CSU bars sensors                               
#[Out]# CS_76   =               10000. / CSU bars sensors                               
#[Out]# CS_77   =               10000. / CSU bars sensors                               
#[Out]# CS_78   =               10000. / CSU bars sensors                               
#[Out]# CS_79   =               10000. / CSU bars sensors                               
#[Out]# CS_80   =               10000. / CSU bars sensors                               
#[Out]# CS_81   =               10000. / CSU bars sensors                               
#[Out]# CS_82   =               10000. / CSU bars sensors                               
#[Out]# CS_83   =               10000. / CSU bars sensors                               
#[Out]# CS_84   =               10000. / CSU bars sensors                               
#[Out]# CS_85   =               10000. / CSU bars sensors                               
#[Out]# CS_86   =               10000. / CSU bars sensors                               
#[Out]# CS_87   =               10000. / CSU bars sensors                               
#[Out]# CS_88   =               10000. / CSU bars sensors                               
#[Out]# CS_89   =               10000. / CSU bars sensors                               
#[Out]# CS_90   =               10000. / CSU bars sensors                               
#[Out]# CS_91   =               10000. / CSU bars sensors                               
#[Out]# CS_92   =               10000. / CSU bars sensors                               
#[Out]# CS_93   =               10000. / CSU bars sensors                               
#[Out]# CS_94   =               10000. / CSU bars sensors                               
#[Out]# CS_95   =               10000. / CSU bars sensors                               
#[Out]# CS_96   =               10000. / CSU bars sensors                               
#[Out]# CS_97   =               10000. / CSU bars sensors                               
#[Out]# CS_98   =               10000. / CSU bars sensors                               
#[Out]# CS_99   =               10000. / CSU bars sensors                               
#[Out]# CS_100  =               10000. / CSU bars sensors                               
#[Out]# CS_101  =               10000. / CSU bars sensors                               
#[Out]# CS_102  =               10000. / CSU bars sensors                               
#[Out]# CS_103  =               10000. / CSU bars sensors                               
#[Out]# CS_104  =               10000. / CSU bars sensors                               
#[Out]# CS_105  =               10000. / CSU bars sensors                               
#[Out]# CS_106  =               10000. / CSU bars sensors                               
#[Out]# CS_107  =               10000. / CSU bars sensors                               
#[Out]# CS_108  =               10000. / CSU bars sensors                               
#[Out]# CS_109  =               10000. / CSU bars sensors                               
#[Out]# CS_110  =               10000. / CSU bars sensors                               
#[Out]# CS_111  =               10000. / CSU bars sensors                               
#[Out]# CS_112  =               10000. / CSU bars sensors                               
#[Out]# CS_113  =               10000. / CSU bars sensors                               
#[Out]# CS_114  =               10000. / CSU bars sensors                               
#[Out]# CS_115  =               10000. / CSU bars sensors                               
#[Out]# CS_116  =               10000. / CSU bars sensors                               
#[Out]# CS_117  =               10000. / CSU bars sensors                               
#[Out]# CS_118  =               10000. / CSU bars sensors                               
#[Out]# CS_119  =               10000. / CSU bars sensors                               
#[Out]# CS_120  =               10000. / CSU bars sensors                               
#[Out]# CS_121  =               10000. / CSU bars sensors                               
#[Out]# CS_122  =               10000. / CSU bars sensors                               
#[Out]# CS_123  =               10000. / CSU bars sensors                               
#[Out]# CS_124  =               10000. / CSU bars sensors                               
#[Out]# CS_125  =               10000. / CSU bars sensors                               
#[Out]# CS_126  =               10000. / CSU bars sensors                               
#[Out]# CS_127  =               10000. / CSU bars sensors                               
#[Out]# CS_128  =               10000. / CSU bars sensors                               
#[Out]# CS_129  =               10000. / CSU bars sensors                               
#[Out]# CS_130  =               10000. / CSU bars sensors                               
#[Out]# CS_131  =               10000. / CSU bars sensors                               
#[Out]# CS_132  =               10000. / CSU bars sensors                               
#[Out]# CS_133  =               10000. / CSU bars sensors                               
#[Out]# CS_134  =               10000. / CSU bars sensors                               
#[Out]# CS_135  =               10000. / CSU bars sensors                               
#[Out]# CS_136  =               10000. / CSU bars sensors                               
#[Out]# CS_137  =               10000. / CSU bars sensors                               
#[Out]# CS_138  =               10000. / CSU bars sensors                               
#[Out]# CS_139  =               10000. / CSU bars sensors                               
#[Out]# CS_140  =               10000. / CSU bars sensors                               
#[Out]# CS_141  =               10000. / CSU bars sensors                               
#[Out]# CS_142  =               10000. / CSU bars sensors                               
#[Out]# CS_143  =               10000. / CSU bars sensors                               
#[Out]# CS_144  =               10000. / CSU bars sensors                               
#[Out]# CS_145  =               10000. / CSU bars sensors                               
#[Out]# CS_146  =               10000. / CSU bars sensors                               
#[Out]# CS_147  =               10000. / CSU bars sensors                               
#[Out]# CS_148  =               10000. / CSU bars sensors                               
#[Out]# CS_149  =               10000. / CSU bars sensors                               
#[Out]# CS_150  =               10000. / CSU bars sensors                               
#[Out]# CS_151  =               10000. / CSU bars sensors                               
#[Out]# CS_152  =               10000. / CSU bars sensors                               
#[Out]# CS_153  =               10000. / CSU bars sensors                               
#[Out]# CS_154  =               10000. / CSU bars sensors                               
#[Out]# CS_155  =               10000. / CSU bars sensors                               
#[Out]# CS_156  =               10000. / CSU bars sensors                               
#[Out]# CS_157  =               10000. / CSU bars sensors                               
#[Out]# CS_158  =               10000. / CSU bars sensors                               
#[Out]# CS_159  =               10000. / CSU bars sensors                               
#[Out]# CS_160  =               10000. / CSU bars sensors                               
#[Out]# CS_161  =               10000. / CSU bars sensors                               
#[Out]# CS_162  =               10000. / CSU bars sensors                               
#[Out]# CS_163  =               10000. / CSU bars sensors                               
#[Out]# CS_164  =               10000. / CSU bars sensors                               
#[Out]# CS_165  =               10000. / CSU bars sensors                               
#[Out]# CS_166  =               10000. / CSU bars sensors                               
#[Out]# CS_167  =               10000. / CSU bars sensors                               
#[Out]# CS_168  =               10000. / CSU bars sensors                               
#[Out]# CS_169  =               10000. / CSU bars sensors                               
#[Out]# CS_170  =               10000. / CSU bars sensors                               
#[Out]# CS_171  =               10000. / CSU bars sensors                               
#[Out]# CS_172  =               10000. / CSU bars sensors                               
#[Out]# CS_173  =               10000. / CSU bars sensors                               
#[Out]# CS_174  =               10000. / CSU bars sensors                               
#[Out]# CS_175  =               10000. / CSU bars sensors                               
#[Out]# CS_176  =               10000. / CSU bars sensors                               
#[Out]# CS_177  =               10000. / CSU bars sensors                               
#[Out]# CS_178  =               10000. / CSU bars sensors                               
#[Out]# CS_179  =               10000. / CSU bars sensors                               
#[Out]# CS_180  =               10000. / CSU bars sensors                               
#[Out]# CS_181  =               10000. / CSU bars sensors                               
#[Out]# CS_182  =               10000. / CSU bars sensors                               
#[Out]# CS_183  =               10000. / CSU bars sensors                               
#[Out]# CS_184  =               10000. / CSU bars sensors                               
#[Out]# CS_185  =               10000. / CSU bars sensors                               
#[Out]# CS_186  =               10000. / CSU bars sensors                               
#[Out]# CS_187  =               10000. / CSU bars sensors                               
#[Out]# CS_188  =               10000. / CSU bars sensors                               
#[Out]# CS_189  =               10000. / CSU bars sensors                               
#[Out]# CS_190  =               10000. / CSU bars sensors                               
#[Out]# CS_191  =               10000. / CSU bars sensors                               
#[Out]# CS_192  =               10000. / CSU bars sensors                               
#[Out]# CS_193  =               10000. / CSU bars sensors                               
#[Out]# CS_194  =               10000. / CSU bars sensors                               
#[Out]# CS_195  =               10000. / CSU bars sensors                               
#[Out]# CS_196  =               10000. / CSU bars sensors                               
#[Out]# CS_197  =               10000. / CSU bars sensors                               
#[Out]# CS_198  =               10000. / CSU bars sensors                               
#[Out]# CS_199  =               10000. / CSU bars sensors                               
#[Out]# CS_200  =               10000. / CSU bars sensors                               
#[Out]# CS_201  =               10000. / CSU bars sensors                               
#[Out]# CS_202  =               10000. / CSU bars sensors                               
#[Out]# CS_203  =               10000. / CSU bars sensors                               
#[Out]# CS_204  =               10000. / CSU bars sensors                               
#[Out]# CS_205  =               10000. / CSU bars sensors                               
#[Out]# CS_206  =               10000. / CSU bars sensors                               
#[Out]# CS_207  =               10000. / CSU bars sensors                               
#[Out]# CS_208  =               10000. / CSU bars sensors                               
#[Out]# CS_209  =               10000. / CSU bars sensors                               
#[Out]# CS_210  =               10000. / CSU bars sensors                               
#[Out]# CS_211  =               10000. / CSU bars sensors                               
#[Out]# CS_212  =               10000. / CSU bars sensors                               
#[Out]# CS_213  =               10000. / CSU bars sensors                               
#[Out]# CS_214  =               10000. / CSU bars sensors                               
#[Out]# CS_215  =               10000. / CSU bars sensors                               
#[Out]# CS_216  =               10000. / CSU bars sensors                               
#[Out]# CS_217  =               10000. / CSU bars sensors                               
#[Out]# CS_218  =               10000. / CSU bars sensors                               
#[Out]# CS_219  =               10000. / CSU bars sensors                               
#[Out]# CS_220  =               10000. / CSU bars sensors                               
#[Out]# CS_221  =               10000. / CSU bars sensors                               
#[Out]# CS_222  =               10000. / CSU bars sensors                               
#[Out]# CS_223  =               10000. / CSU bars sensors                               
#[Out]# CS_224  =               10000. / CSU bars sensors                               
#[Out]# CS_225  =               10000. / CSU bars sensors                               
#[Out]# CS_226  =               10000. / CSU bars sensors                               
#[Out]# CS_227  =               10000. / CSU bars sensors                               
#[Out]# CS_228  =               10000. / CSU bars sensors                               
#[Out]# CS_229  =               10000. / CSU bars sensors                               
#[Out]# CS_230  =               10000. / CSU bars sensors                               
#[Out]# CS_231  =               10000. / CSU bars sensors                               
#[Out]# CS_232  =               10000. / CSU bars sensors                               
#[Out]# CS_233  =               10000. / CSU bars sensors                               
#[Out]# CS_234  =               10000. / CSU bars sensors                               
#[Out]# CS_235  =               10000. / CSU bars sensors                               
#[Out]# CS_236  =               10000. / CSU bars sensors                               
#[Out]# CS_237  =               10000. / CSU bars sensors                               
#[Out]# CS_238  =               10000. / CSU bars sensors                               
#[Out]# CS_239  =               10000. / CSU bars sensors                               
#[Out]# CS_240  =               10000. / CSU bars sensors                               
#[Out]# CS_241  =               10000. / CSU bars sensors                               
#[Out]# CS_242  =               10000. / CSU bars sensors                               
#[Out]# CS_243  =               10000. / CSU bars sensors                               
#[Out]# CS_244  =               10000. / CSU bars sensors                               
#[Out]# CS_245  =               10000. / CSU bars sensors                               
#[Out]# CS_246  =               10000. / CSU bars sensors                               
#[Out]# CS_247  =               10000. / CSU bars sensors                               
#[Out]# CS_248  =               10000. / CSU bars sensors                               
#[Out]# CS_249  =               10000. / CSU bars sensors                               
#[Out]# CS_250  =               10000. / CSU bars sensors                               
#[Out]# CS_251  =               10000. / CSU bars sensors                               
#[Out]# CS_252  =               10000. / CSU bars sensors                               
#[Out]# CS_253  =               10000. / CSU bars sensors                               
#[Out]# CS_254  =               10000. / CSU bars sensors                               
#[Out]# CS_255  =               10000. / CSU bars sensors                               
#[Out]# CS_256  =               10000. / CSU bars sensors                               
#[Out]# CS_257  =               10000. / CSU bars sensors                               
#[Out]# CS_258  =               10000. / CSU bars sensors                               
#[Out]# CS_259  =               10000. / CSU bars sensors                               
#[Out]# CS_260  =               10000. / CSU bars sensors                               
#[Out]# CS_261  =               10000. / CSU bars sensors                               
#[Out]# CS_262  =               10000. / CSU bars sensors                               
#[Out]# CS_263  =               10000. / CSU bars sensors                               
#[Out]# CS_264  =               10000. / CSU bars sensors                               
#[Out]# CS_265  =               10000. / CSU bars sensors                               
#[Out]# CS_266  =               10000. / CSU bars sensors                               
#[Out]# CS_267  =               10000. / CSU bars sensors                               
#[Out]# CS_268  =               10000. / CSU bars sensors                               
#[Out]# CS_269  =               10000. / CSU bars sensors                               
#[Out]# CS_270  =               10000. / CSU bars sensors                               
#[Out]# CS_271  =               10000. / CSU bars sensors                               
#[Out]# CS_272  =               10000. / CSU bars sensors                               
#[Out]# CS_273  =               10000. / CSU bars sensors                               
#[Out]# CS_274  =               10000. / CSU bars sensors                               
#[Out]# CS_275  =               10000. / CSU bars sensors                               
#[Out]# CS_276  =               10000. / CSU bars sensors                               
#[Out]# CS_277  =               10000. / CSU bars sensors                               
#[Out]# CS_278  =               10000. / CSU bars sensors                               
#[Out]# CS_279  =               10000. / CSU bars sensors                               
#[Out]# CS_280  =               10000. / CSU bars sensors                               
#[Out]# CS_281  =               10000. / CSU bars sensors                               
#[Out]# CS_282  =               10000. / CSU bars sensors                               
#[Out]# CS_283  =               10000. / CSU bars sensors                               
#[Out]# CS_284  =               10000. / CSU bars sensors                               
#[Out]# CS_285  =               10000. / CSU bars sensors                               
#[Out]# CS_286  =               10000. / CSU bars sensors                               
#[Out]# CS_287  =               10000. / CSU bars sensors                               
#[Out]# CS_288  =               10000. / CSU bars sensors                               
#[Out]# CS_289  =               10000. / CSU bars sensors                               
#[Out]# CS_290  =               10000. / CSU bars sensors                               
#[Out]# CS_291  =               10000. / CSU bars sensors                               
#[Out]# CS_292  =               10000. / CSU bars sensors                               
#[Out]# CS_293  =               10000. / CSU bars sensors                               
#[Out]# CS_294  =               10000. / CSU bars sensors                               
#[Out]# CS_295  =               10000. / CSU bars sensors                               
#[Out]# CS_296  =               10000. / CSU bars sensors                               
#[Out]# CS_297  =               10000. / CSU bars sensors                               
#[Out]# CS_298  =               10000. / CSU bars sensors                               
#[Out]# CS_299  =               10000. / CSU bars sensors                               
#[Out]# CS_300  =               10000. / CSU bars sensors                               
#[Out]# CS_301  =               10000. / CSU bars sensors                               
#[Out]# CS_302  =               10000. / CSU bars sensors                               
#[Out]# CS_303  =               10000. / CSU bars sensors                               
#[Out]# CS_304  =               10000. / CSU bars sensors                               
#[Out]# CS_305  =               10000. / CSU bars sensors                               
#[Out]# CS_306  =               10000. / CSU bars sensors                               
#[Out]# CS_307  =               10000. / CSU bars sensors                               
#[Out]# CS_308  =               10000. / CSU bars sensors                               
#[Out]# CS_309  =               10000. / CSU bars sensors                               
#[Out]# CS_310  =               10000. / CSU bars sensors                               
#[Out]# CS_311  =               10000. / CSU bars sensors                               
#[Out]# CS_312  =               10000. / CSU bars sensors                               
#[Out]# CS_313  =               10000. / CSU bars sensors                               
#[Out]# CS_314  =               10000. / CSU bars sensors                               
#[Out]# CS_315  =               10000. / CSU bars sensors                               
#[Out]# CS_316  =               10000. / CSU bars sensors                               
#[Out]# CS_317  =               10000. / CSU bars sensors                               
#[Out]# CS_318  =               10000. / CSU bars sensors                               
#[Out]# CS_319  =               10000. / CSU bars sensors                               
#[Out]# CS_320  =               10000. / CSU bars sensors                               
#[Out]# CS_321  =               10000. / CSU bars sensors                               
#[Out]# CS_322  =               10000. / CSU bars sensors                               
#[Out]# CS_323  =               10000. / CSU bars sensors                               
#[Out]# CS_324  =               10000. / CSU bars sensors                               
#[Out]# CS_325  =               10000. / CSU bars sensors                               
#[Out]# CS_326  =               10000. / CSU bars sensors                               
#[Out]# CS_327  =               10000. / CSU bars sensors                               
#[Out]# CS_328  =               10000. / CSU bars sensors                               
#[Out]# CS_329  =               10000. / CSU bars sensors                               
#[Out]# CS_330  =               10000. / CSU bars sensors                               
#[Out]# CS_331  =               10000. / CSU bars sensors                               
#[Out]# CS_332  =               10000. / CSU bars sensors                               
#[Out]# CS_333  =               10000. / CSU bars sensors                               
#[Out]# CS_334  =               10000. / CSU bars sensors                               
#[Out]# CS_335  =               10000. / CSU bars sensors                               
#[Out]# CS_336  =               10000. / CSU bars sensors                               
#[Out]# CS_337  =               10000. / CSU bars sensors                               
#[Out]# CS_338  =               10000. / CSU bars sensors                               
#[Out]# CS_339  =               10000. / CSU bars sensors                               
#[Out]# CS_340  =               10000. / CSU bars sensors                               
#[Out]# CS_341  =               10000. / CSU bars sensors                               
#[Out]# CS_342  =               10000. / CSU bars sensors                               
#[Out]# CS_343  =               10000. / CSU bars sensors                               
#[Out]# CS_344  =               10000. / CSU bars sensors                               
#[Out]# CS_345  =               10000. / CSU bars sensors                               
#[Out]# CS_346  =               10000. / CSU bars sensors                               
#[Out]# CS_347  =               10000. / CSU bars sensors                               
#[Out]# CS_348  =               10000. / CSU bars sensors                               
#[Out]# CS_349  =               10000. / CSU bars sensors                               
#[Out]# CS_350  =               10000. / CSU bars sensors                               
#[Out]# CS_351  =               10000. / CSU bars sensors                               
#[Out]# CS_352  =               10000. / CSU bars sensors                               
#[Out]# CS_353  =               10000. / CSU bars sensors                               
#[Out]# CS_354  =               10000. / CSU bars sensors                               
#[Out]# CS_355  =               10000. / CSU bars sensors                               
#[Out]# CS_356  =               10000. / CSU bars sensors                               
#[Out]# CS_357  =               10000. / CSU bars sensors                               
#[Out]# CS_358  =               10000. / CSU bars sensors                               
#[Out]# CS_359  =               10000. / CSU bars sensors                               
#[Out]# CS_360  =               10000. / CSU bars sensors                               
#[Out]# CS_361  =               10000. / CSU bars sensors                               
#[Out]# CS_362  =               10000. / CSU bars sensors                               
#[Out]# CS_363  =               10000. / CSU bars sensors                               
#[Out]# CS_364  =               10000. / CSU bars sensors                               
#[Out]# CS_365  =               10000. / CSU bars sensors                               
#[Out]# CS_366  =               10000. / CSU bars sensors                               
#[Out]# CS_367  =               10000. / CSU bars sensors                               
#[Out]# CS_368  =               10000. / CSU bars sensors                               
#[Out]# CS_369  =               10000. / CSU bars sensors                               
#[Out]# CS_370  =               10000. / CSU bars sensors                               
#[Out]# CS_371  =               10000. / CSU bars sensors                               
#[Out]# CS_372  =               10000. / CSU bars sensors                               
#[Out]# CS_373  =               10000. / CSU bars sensors                               
#[Out]# CS_374  =               10000. / CSU bars sensors                               
#[Out]# CS_375  =               10000. / CSU bars sensors                               
#[Out]# CS_376  =               10000. / CSU bars sensors                               
#[Out]# CS_377  =               10000. / CSU bars sensors                               
#[Out]# CS_378  =               10000. / CSU bars sensors                               
#[Out]# CS_379  =               10000. / CSU bars sensors                               
#[Out]# CS_380  =               10000. / CSU bars sensors                               
#[Out]# CS_381  =               10000. / CSU bars sensors                               
#[Out]# CS_382  =               10000. / CSU bars sensors                               
#[Out]# CS_383  =               10000. / CSU bars sensors                               
#[Out]# CS_384  =               10000. / CSU bars sensors                               
#[Out]# CS_385  =               10000. / CSU bars sensors                               
#[Out]# CS_386  =               10000. / CSU bars sensors                               
#[Out]# CS_387  =               10000. / CSU bars sensors                               
#[Out]# CS_388  =               10000. / CSU bars sensors                               
#[Out]# CS_389  =               10000. / CSU bars sensors                               
#[Out]# CS_390  =               10000. / CSU bars sensors                               
#[Out]# CS_391  =               10000. / CSU bars sensors                               
#[Out]# CS_392  =               10000. / CSU bars sensors                               
#[Out]# CS_393  =               10000. / CSU bars sensors                               
#[Out]# CS_394  =               10000. / CSU bars sensors                               
#[Out]# CS_395  =               10000. / CSU bars sensors                               
#[Out]# CS_396  =               10000. / CSU bars sensors                               
#[Out]# CS_397  =               10000. / CSU bars sensors                               
#[Out]# CS_398  =               10000. / CSU bars sensors                               
#[Out]# CS_399  =               10000. / CSU bars sensors                               
#[Out]# CS_400  =               10000. / CSU bars sensors                               
#[Out]# CS_401  =               10000. / CSU bars sensors                               
#[Out]# CS_402  =               10000. / CSU bars sensors                               
#[Out]# CS_403  =               10000. / CSU bars sensors                               
#[Out]# CS_404  =               10000. / CSU bars sensors                               
#[Out]# CS_405  =               10000. / CSU bars sensors                               
#[Out]# CS_406  =               10000. / CSU bars sensors                               
#[Out]# CS_407  =               10000. / CSU bars sensors                               
#[Out]# CS_408  =               10000. / CSU bars sensors                               
#[Out]# CS_409  =               10000. / CSU bars sensors                               
#[Out]# CS_410  =               10000. / CSU bars sensors                               
#[Out]# CS_411  =               10000. / CSU bars sensors                               
#[Out]# CS_412  =               10000. / CSU bars sensors                               
#[Out]# CS_413  =               10000. / CSU bars sensors                               
#[Out]# CS_414  =               10000. / CSU bars sensors                               
#[Out]# CS_415  =               10000. / CSU bars sensors                               
#[Out]# CS_416  =               10000. / CSU bars sensors                               
#[Out]# CS_417  =               10000. / CSU bars sensors                               
#[Out]# CS_418  =               10000. / CSU bars sensors                               
#[Out]# CS_419  =               10000. / CSU bars sensors                               
#[Out]# CS_420  =               10000. / CSU bars sensors                               
#[Out]# CS_421  =               10000. / CSU bars sensors                               
#[Out]# CS_422  =               10000. / CSU bars sensors                               
#[Out]# CS_423  =               10000. / CSU bars sensors                               
#[Out]# CS_424  =               10000. / CSU bars sensors                               
#[Out]# CS_425  =               10000. / CSU bars sensors                               
#[Out]# CS_426  =               10000. / CSU bars sensors                               
#[Out]# CS_427  =               10000. / CSU bars sensors                               
#[Out]# CS_428  =               10000. / CSU bars sensors                               
#[Out]# CS_429  =               10000. / CSU bars sensors                               
#[Out]# CS_430  =               10000. / CSU bars sensors                               
#[Out]# CS_431  =               10000. / CSU bars sensors                               
#[Out]# CS_432  =               10000. / CSU bars sensors                               
#[Out]# CS_433  =               10000. / CSU bars sensors                               
#[Out]# CS_434  =               10000. / CSU bars sensors                               
#[Out]# CS_435  =               10000. / CSU bars sensors                               
#[Out]# CS_436  =               10000. / CSU bars sensors                               
#[Out]# CS_437  =               10000. / CSU bars sensors                               
#[Out]# CS_438  =               10000. / CSU bars sensors                               
#[Out]# CS_439  =               10000. / CSU bars sensors                               
#[Out]# SLIFL1  =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL2  =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL3  =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL4  =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL5  =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL6  =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL7  =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL8  =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL9  =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL10 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL11 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL12 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL13 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL14 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL15 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL16 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL17 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL18 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL19 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL20 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL21 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL22 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL23 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL24 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL25 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL26 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL27 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL28 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL29 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL30 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL31 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL32 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL33 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL34 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL35 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL36 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL37 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL38 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL39 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL40 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL41 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL42 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL43 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL44 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL45 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL46 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL47 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL48 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL49 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL50 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL51 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL52 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL53 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL54 =                    0 / Slit flag for assigned or reference slits      
#[Out]# SLIFL55 =                    0 / Slit flag for assigned or reference slits      
#[Out]# XVSLI1  =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI2  =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI3  =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI4  =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI5  =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI6  =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI7  =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI8  =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI9  =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI10 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI11 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI12 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI13 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI14 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI15 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI16 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI17 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI18 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI19 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI20 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI21 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI22 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI23 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI24 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI25 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI26 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI27 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI28 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI29 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI30 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI31 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI32 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI33 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI34 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI35 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI36 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI37 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI38 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI39 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI40 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI41 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI42 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI43 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI44 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI45 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI46 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI47 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI48 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI49 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI50 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI51 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI52 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI53 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI54 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# XVSLI55 =                -100. / X coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI1  =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI2  =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI3  =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI4  =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI5  =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI6  =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI7  =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI8  =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI9  =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI10 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI11 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI12 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI13 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI14 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI15 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI16 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI17 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI18 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI19 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI20 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI21 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI22 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI23 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI24 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI25 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI26 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI27 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI28 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI29 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI30 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI31 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI32 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI33 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI34 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI35 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI36 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI37 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI38 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI39 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI40 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI41 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI42 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI43 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI44 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI45 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI46 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI47 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI48 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI49 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI50 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI51 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI52 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI53 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI54 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# YVSLI55 =                -100. / Y coord. (vpix) of the obj. assigned to the sli
#[Out]# XRSLI1  =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI2  =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI3  =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI4  =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI5  =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI6  =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI7  =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI8  =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI9  =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI10 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI11 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI12 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI13 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI14 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI15 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI16 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI17 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI18 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI19 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI20 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI21 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI22 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI23 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI24 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI25 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI26 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI27 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI28 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI29 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI30 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI31 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI32 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI33 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI34 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI35 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI36 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI37 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI38 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI39 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI40 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI41 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI42 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI43 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI44 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI45 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI46 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI47 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI48 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI49 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI50 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI51 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI52 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI53 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI54 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# XRSLI55 =                -100. / X coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI1  =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI2  =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI3  =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI4  =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI5  =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI6  =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI7  =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI8  =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI9  =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI10 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI11 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI12 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI13 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI14 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI15 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI16 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI17 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI18 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI19 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI20 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI21 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI22 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI23 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI24 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI25 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI26 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI27 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI28 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI29 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI30 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI31 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI32 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI33 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI34 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI35 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI36 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI37 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI38 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI39 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI40 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI41 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI42 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI43 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI44 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI45 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI46 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI47 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI48 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI49 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI50 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI51 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI52 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI53 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI54 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# YRSLI55 =                -100. / Y coord. (pix) of the obj. assigned to the slit
#[Out]# TEMPDET =     69.9599990844727 / Temperature at place                           
#[Out]# PRESEMIR= 2.65633985918612E-07 / Pressure at place                              
#[Out]# WCTEMP  =     16.8999996185303 / Temperature in Celsius at EMIR Window          
#[Out]# WCHUM   =                  14. / Humidity in percentage at EMIR Window          
#[Out]# WCDWP   =    -10.6999998092651 / DewPoint in Celsius at EMIR window             
#[Out]# IPA     =     90.0500000000004 / Instrument position angle in degrees  (degrees)
#[Out]# AIRMASS =     1.30835942623114 / AIRMASS                                        
#[Out]# AIRPRESS=             781.8377 / Mean atmospheric pressure during the RA        
#[Out]# RA      = '19:23:41.411'       / Telescope right ascension (HH:MM:SS)  (h:m:s)  
#[Out]# DEC     = '14:30:18.825'       / Telescope declination (DD:PP:SS) (d:m:s)       
#[Out]# RADEG   =     290.922547408529 / Telescope right ascension in decimal degrees. (
#[Out]# DECDEG  =     14.5052292777092 / Telescope declination in degrees (degrees)     
#[Out]# OESTATE =                    2 / Observing State (OFF/SLEWING/TRACKING/GUIDING) 
#[Out]# AZIMUTH =     259.498906824101 / Tel. azimuth at start time (degrees)           
#[Out]# ELEVAT  =     49.7979634711328 / Elevation at start of observation (degrees)    
#[Out]# ROTANG  =     157.738519685649 / Rotator position angle in degrees.             
#[Out]# TURNTBL1=    -40.0022601744186 / Turntable1 position in degrees                 
#[Out]# ARMROT1 =           29.9986125 / ArmRotator1 position in degrees                
#[Out]# TURNTBL2=    -39.9987961785368 / Turntable2 position in degrees                 
#[Out]# ARMROT2 =          -50.0000625 / ArmRotator2 position in degrees                
#[Out]# DEWPOINT=             -10.1454 / Ambient dew point in Celsius degrees           
#[Out]# HUMIDITY=                13.81 / Ambient humidity in percent.                   
#[Out]# PRESSURE=             781.8377 / Ambient atmospheric pressure (hPascal)         
#[Out]# TAMBIENT=               18.687 / Ambient temperature in Celsius degrees         
#[Out]# WINDDIRE=                 331. / Wind direction (from) in degrees from N to E   
#[Out]# WINDSPEE=     3.18673333333391 / Wind speed in m/s                              
#[Out]# DOMETEMP=     18.7537777777778 / Temperature inside the dome                    
#[Out]# M2UX    =      1.9619699716568 / GTC secondary mirror UX position               
#[Out]# M2UY    =      2.3966600894928 / GTC secondary mirror UY position               
#[Out]# M2UZ    =    -2.50573992729187 / GTC secondary mirror UZ position               
#[Out]# M2RX    = 0.000615641998592764 / GTC secondary mirror RX position               
#[Out]# M2RY    = -0.000510331010445952 / GTC secondary mirror RY position              
#[Out]# LAMPXE1 =                    0 / GTC Xe1 spectral lamp                          
#[Out]# LAMPNE1 =                    0 / GTC Ne1 spectral lamp                          
#[Out]# LAMPHG1 =                    0 / GTC Hg(Ar)1 spectral lamp                      
#[Out]# LAMPXE2 =                    0 / GTC Hg(Ar)2 spectral lamp                      
#[Out]# LAMPNE2 =                    0 / GTC Ne2 spectral lamp                          
#[Out]# LAMPHG2 =                    0 / GTC Hg(Ar)2 spectral lamp                      
#[Out]# LAMPINCD=                    0 / GTC incandescent lamp                          
#[Out]# LAMPINTN=                   0. / GTC incandescent lamp intensity                
#[Out]# OBJECT  = 'W51A    '           / Object name                                    
#[Out]# INSMODE = '        '           / Instrument Mode                                
#[Out]# OBSTYPE = 'OBJECT  '           / Observation Type                               
#[Out]# PI      = 'aginsburg'          / Principal Investigator                         
#[Out]# OBSERVER= 'SA      '           / Observer Name (SA = support astronomer)        
#[Out]# GTCPRGID= 'GTC2-20AFLO'        / Program Identifier                             
#[Out]# GTCOBID = '0001    '           / Observation Block ID                           
#[Out]# TELESCOP= 'GTC     '           / Telescope id.                                  
#[Out]# OBSMODE = 'STARE_IMAGE'        / Observation Mode                               
#[Out]# ORIGIN  = 'GRANTECAN'          / FITS file originator                           
#[Out]# OBSERVAT= 'ORM     '           / Name of observatory (IRAF style)               
#[Out]# LATITUDE= '+28:45:43.2'        / Telescope latitude (degrees), +28:45:43.2      
#[Out]# LONGITUD= '+17:52:39.5'        / Telescope longitude (degrees), +17:52:39.5     
#[Out]# HEIGHT  =                 2348 / Telescope height above sea level (m)           
#[Out]# CTYPE1  = 'RA---ZPN'           / R.A. in tangent plane projection               
#[Out]# CTYPE2  = 'DEC--ZPN'           / DEC. in tangent plane projection               
#[Out]# RADESYS = 'FK5     '           / Equatorial coordinate system                   
#[Out]# EQUINOX =                2000. / Epoch of the mean equinox for WCS              
#[Out]# CRVAL1  =     290.922547408529 / RA at Ref pix in decimal degrees               
#[Out]# CRVAL2  =     14.5052292777092 / DEC at Ref pix in decimal degrees              
#[Out]# CRPIX1  =      1022.4864072389 / Ref pix of axis 1                              
#[Out]# CRPIX2  =     1016.55651287301 / Ref pix of axis 2                              
#[Out]# CD1_1   = -5.41620904877093E-05 / WCS matrix element 1,1                        
#[Out]# CD1_2   = -4.72653524372305E-08 / WCS matrix element 1,2                        
#[Out]# CD2_1   = 4.72653524372305E-08 / WCS matrix element 2,1                         
#[Out]# CD2_2   = -5.41620904877093E-05 / WCS matrix element 2,2                        
#[Out]# PV2_1   =                   1.                                                  
#[Out]# PV2_2   =                   0.                                                  
#[Out]# PV2_3   =              14584.8                                                  
#[Out]# PV2_4   =                   0.                                                  
#[Out]# PV2_5   =         1755295542.4                                                  
#[Out]# PCD1_1  = -3.58179062439342E-17 / WCS matrix element 1,1                        
#[Out]# PCD1_2  =            0.1949836 / WCS matrix element 1,2                         
#[Out]# PCD2_1  =           -0.1949836 / WCS matrix element 2,1                         
#[Out]# PCD2_2  = -3.58179062439342E-17 / WCS matrix element 2,2                        
#[Out]# PCRPIX1 =              1022.49 / Reference pixel for coordinate transformation  
#[Out]# PCRPIX2 =              1016.56 / Reference pixel for coordinate transformation  
#[Out]# BUNIT   = 'ADU     '           / Data Units; adu for raw; adu/s preproc         
#[Out]# INSTRUME= 'EMIR    '           / EMIR                                           
#[Out]# COMMENT ***OBSERVATION BLOCK****                                                
#[Out]# DATE-OBS= '2020-07-13T03:53:27.71' / Date of observation (start) in Y2K complian
#[Out]# UTC     = '03:53:27.719928'    / Coordinate UT of the observation (start)       
#[Out]# DETPA   =                   0. / Detector position angle [deg] wrt FP           
#[Out]# DTUPA   =           2.35797393 / DTU position angle [deg] wrt FP                
#[Out]# FPPA    =                 270. / Focal Plane position angle [deg] wrt nominal FO
#[Out]# PSCFP   =               1.1746 / Plate scale at the focal plane                 
#[Out]# PXSZCSU =                0.166 / Projected pixel size at the focal plane (CSU)  
#[Out]# PXSZDET =                  18. / Pixel size at the detector                     
#[Out]# ROTOFF  =                90.05 / Rotator offset                                 
#[Out]# COMMENT ***INSTRUMENT CONF. BLOCK***                                            
#[Out]# TELPOS  = 'SOURCE  '           / TELPOS (SKY/SOURCE/SKYFLAT/DOMEFLAT/NOD_A/NOD_B
#[Out]# FILTPOS =                    2 / Filter wheel position                          
#[Out]# GRISMPOS=                    6 / Grism wheel position                           
#[Out]# FILTER  = 'J       '           / Filter name                                    
#[Out]# GRISM   = 'OPEN    '           / Grism name                                     
#[Out]# XDTU    =    -221.300003051758 / Actual DTU-X position                          
#[Out]# YDTU    =    -36.6703987121582 / Actual DTU-Y position                          
#[Out]# ZDTU    =    -534.966979980469 / Actual DTU-Z position                          
#[Out]# XDTU_0  =    -220.880996704102 / DTU-X which centres the detector in FOV        
#[Out]# YDTU_0  =    -36.6697998046875 / DTU-Y which centres the detector in FOV        
#[Out]# ZDTU_0  =     -535.02099609375 / DTU-Z which best focus the det.                
#[Out]# CSUCONFF= 'UNKNOWN '           / CSU Configuration File                         
#[Out]# MASKID  = '        '           / Mask identifier                                
#[Out]# OBJSL1  = '        '           / Objects assigned to slit                       
#[Out]# COMSL1  = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL2  = '        '           / Objects assigned to slit                       
#[Out]# COMSL2  = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL3  = '        '           / Objects assigned to slit                       
#[Out]# COMSL3  = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL4  = '        '           / Objects assigned to slit                       
#[Out]# COMSL4  = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL5  = '        '           / Objects assigned to slit                       
#[Out]# COMSL5  = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL6  = '        '           / Objects assigned to slit                       
#[Out]# COMSL6  = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL7  = '        '           / Objects assigned to slit                       
#[Out]# COMSL7  = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL8  = '        '           / Objects assigned to slit                       
#[Out]# COMSL8  = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL9  = '        '           / Objects assigned to slit                       
#[Out]# COMSL9  = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL10 = '        '           / Objects assigned to slit                       
#[Out]# COMSL10 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL11 = '        '           / Objects assigned to slit                       
#[Out]# COMSL11 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL12 = '        '           / Objects assigned to slit                       
#[Out]# COMSL12 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL13 = '        '           / Objects assigned to slit                       
#[Out]# COMSL13 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL14 = '        '           / Objects assigned to slit                       
#[Out]# COMSL14 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL15 = '        '           / Objects assigned to slit                       
#[Out]# COMSL15 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL16 = '        '           / Objects assigned to slit                       
#[Out]# COMSL16 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL17 = '        '           / Objects assigned to slit                       
#[Out]# COMSL17 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL18 = '        '           / Objects assigned to slit                       
#[Out]# COMSL18 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL19 = '        '           / Objects assigned to slit                       
#[Out]# COMSL19 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL20 = '        '           / Objects assigned to slit                       
#[Out]# COMSL20 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL21 = '        '           / Objects assigned to slit                       
#[Out]# COMSL21 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL22 = '        '           / Objects assigned to slit                       
#[Out]# COMSL22 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL23 = '        '           / Objects assigned to slit                       
#[Out]# COMSL23 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL24 = '        '           / Objects assigned to slit                       
#[Out]# COMSL24 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL25 = '        '           / Objects assigned to slit                       
#[Out]# COMSL25 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL26 = '        '           / Objects assigned to slit                       
#[Out]# COMSL26 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL27 = '        '           / Objects assigned to slit                       
#[Out]# COMSL27 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL28 = '        '           / Objects assigned to slit                       
#[Out]# COMSL28 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL29 = '        '           / Objects assigned to slit                       
#[Out]# COMSL29 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL30 = '        '           / Objects assigned to slit                       
#[Out]# COMSL30 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL31 = '        '           / Objects assigned to slit                       
#[Out]# COMSL31 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL32 = '        '           / Objects assigned to slit                       
#[Out]# COMSL32 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL33 = '        '           / Objects assigned to slit                       
#[Out]# COMSL33 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL34 = '        '           / Objects assigned to slit                       
#[Out]# COMSL34 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL35 = '        '           / Objects assigned to slit                       
#[Out]# COMSL35 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL36 = '        '           / Objects assigned to slit                       
#[Out]# COMSL36 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL37 = '        '           / Objects assigned to slit                       
#[Out]# COMSL37 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL38 = '        '           / Objects assigned to slit                       
#[Out]# COMSL38 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL39 = '        '           / Objects assigned to slit                       
#[Out]# COMSL39 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL40 = '        '           / Objects assigned to slit                       
#[Out]# COMSL40 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL41 = '        '           / Objects assigned to slit                       
#[Out]# COMSL41 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL42 = '        '           / Objects assigned to slit                       
#[Out]# COMSL42 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL43 = '        '           / Objects assigned to slit                       
#[Out]# COMSL43 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL44 = '        '           / Objects assigned to slit                       
#[Out]# COMSL44 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL45 = '        '           / Objects assigned to slit                       
#[Out]# COMSL45 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL46 = '        '           / Objects assigned to slit                       
#[Out]# COMSL46 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL47 = '        '           / Objects assigned to slit                       
#[Out]# COMSL47 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL48 = '        '           / Objects assigned to slit                       
#[Out]# COMSL48 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL49 = '        '           / Objects assigned to slit                       
#[Out]# COMSL49 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL50 = '        '           / Objects assigned to slit                       
#[Out]# COMSL50 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL51 = '        '           / Objects assigned to slit                       
#[Out]# COMSL51 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL52 = '        '           / Objects assigned to slit                       
#[Out]# COMSL52 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL53 = '        '           / Objects assigned to slit                       
#[Out]# COMSL53 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL54 = '        '           / Objects assigned to slit                       
#[Out]# COMSL54 = '        '           / Object comment in the user catalogue.          
#[Out]# OBJSL55 = '        '           / Objects assigned to slit                       
#[Out]# COMSL55 = '        '           / Object comment in the user catalogue.          
#[Out]# COMMENT *****EXPOSURE BLOCK*****                                                
#[Out]# READMODE= 'CDS     '           / Detector readout mode in string                
#[Out]# EXPTIME =             9.999657 / [s] Exposure time                              
#[Out]# SECTIME =            11.054887 / [s] Total time per sequence                    
#[Out]# NOBSBLCK=                   13 / Requested blocks in the obs. sequence          
#[Out]# OBSBLOCK=                    1 / Counter of the block sequence                  
#[Out]# NIMGOBBL=                    7 / Requested number of images per obs. block      
#[Out]# IMGOBBL =                    1 / Counter of the image sequence                  
#[Out]# COMMENT *****DETECTOR BLOCK*****                                                
#[Out]# DRIFTCOR=                    T / Correction applied                             
#[Out]# COMMENT  *****INSTRUMENT STATUS BLOCK*****                                      
#[Out]# CYCLENUM= 'II      '           / Number of temperature cycle                    
#[Out]# SKYADD  =                    F / Sky observed                                   
#[Out]# OBJRADIO=                  30. / Nodd throw radius for the dither pattern.      
#[Out]# COMMENT *****TELESCOPE BLOCK*****                                               
#[Out]# COMMENT *****PROCESSING BLOCK*****                                              
# https://docs.astropy.org/en/stable/visualization/wcsaxes/
pl.figure(figsize=(12,12))
pl.subplot(projection=ww) # this line makes the image show up with RA/Dec coordinates
pl.imshow(filehandle[0].data,)
#          norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99))
#[Out]# <matplotlib.image.AxesImage at 0x2ae85195c828>
# https://docs.astropy.org/en/stable/visualization/wcsaxes/
pl.figure(figsize=(12,12))
pl.subplot(projection=ww) # this line makes the image show up with RA/Dec coordinates
pl.imshow(filehandle[0].data,
          norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.5))
#[Out]# <matplotlib.image.AxesImage at 0x2ae847717b70>
# cx, cy are 1024
cy, cx = (x/2 for x in filehandle[0].data.shape)
cx, cy
#[Out]# (1024.0, 1024.0)
ww.wcs_pix2world(cx, cy, 0)*u.deg
#[Out]# <Quantity [290.92240637,  14.50477208] deg>
ra, dec = ww.wcs_pix2world(cx, cy, 0)*u.deg
ra, dec
#[Out]# (<Quantity 290.92240637 deg>, <Quantity 14.50477208 deg>)
center = coordinates.SkyCoord(ra, dec, frame='fk5')
center
#[Out]# <SkyCoord (FK5: equinox=J2000.000): (ra, dec) in deg
#[Out]#     (290.92240637, 14.50477208)>
filehandle[0].header['FILTER']
#[Out]# 'J'
tables = Vizier(row_limit=10000).query_region(center, radius=5*u.arcmin, catalog='2MASS')
tables
#[Out]# TableList with 2 tables:
#[Out]# 	'0:II/246/out' with 15 column(s) and 1716 row(s) 
#[Out]# 	'1:VII/233/xsc' with 13 column(s) and 12 row(s) 
table = tables[0]
table.meta
#[Out]# {'ID': 'II_246_out',
#[Out]#  'name': 'II/246/out',
#[Out]#  'description': '2MASS Point Source Catalogue, output (on a total of 470,992,970 sources)'}
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99))
axlims = ax.axis()
pl.plot(table_coordinates.ra, table_coordinates.dec, transform=ax.get_transform('world'), marker='x', color='w', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
pl.figure(figsize=(12,12))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99))
axlims = ax.axis()
pl.plot(table_coordinates.ra, table_coordinates.dec, transform=ax.get_transform('world'), marker='x', color='w', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
ax.axis()
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
brightstars = table['Jmag'] < 11
brightstars.sum()
#[Out]# 14
brightstars = table['Jmag'] < 12
brightstars.sum()
#[Out]# 36
pl.figure(figsize=(12,12))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
axlims = ax.axis()
pl.plot(table_coordinates.ra[brightstars], table_coordinates.dec[brightstars], transform=ax.get_transform('world'), marker='x', color='w', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
table['Jmag']
#[Out]# <MaskedColumn name='Jmag' dtype='float32' unit='mag' format='{:6.3f}' description='?(j_m) J selected default magnitude (2)' length=1716>
#[Out]# 14.476
#[Out]# 15.728
#[Out]# 15.396
#[Out]# 13.687
#[Out]# 15.914
#[Out]# 13.565
#[Out]# 15.786
#[Out]# 14.609
#[Out]# 15.417
#[Out]# 15.974
#[Out]# 15.962
#[Out]# 16.694
#[Out]#    ...
#[Out]# 16.380
#[Out]# 15.145
#[Out]# 16.001
#[Out]# 16.505
#[Out]# 14.674
#[Out]# 16.328
#[Out]# 15.585
#[Out]# 14.777
#[Out]# 16.854
#[Out]# 16.948
#[Out]# 15.644
#[Out]# 16.347
table['Jmag'] < 12
#[Out]# masked_array(data=[False, False, False, ..., False, False, False],
#[Out]#              mask=False,
#[Out]#        fill_value=True)
table['Jmag'][brightmask]
table['Jmag'][brightstars]
#[Out]# <MaskedColumn name='Jmag' dtype='float32' unit='mag' format='{:6.3f}' description='?(j_m) J selected default magnitude (2)' length=36>
#[Out]# 11.870
#[Out]# 11.924
#[Out]#  9.467
#[Out]# 11.545
#[Out]#  8.295
#[Out]# 11.603
#[Out]#  8.672
#[Out]# 10.018
#[Out]# 11.768
#[Out]# 11.310
#[Out]# 11.075
#[Out]#  9.909
#[Out]#    ...
#[Out]# 10.911
#[Out]# 11.260
#[Out]# 10.213
#[Out]# 11.898
#[Out]# 11.862
#[Out]#  8.639
#[Out]# 11.462
#[Out]#  9.537
#[Out]# 11.546
#[Out]# 11.844
#[Out]# 10.616
#[Out]# 11.864
table[brightstars]
#[Out]# <Table length=36>
#[Out]#  RAJ2000    DEJ2000        _2MASS        Jmag   e_Jmag ... Bflg Cflg  Xflg  Aflg
#[Out]#    deg        deg                        mag     mag   ...                      
#[Out]#  float64    float64        str17       float32 float32 ... str3 str3 uint8 uint8
#[Out]# ---------- ---------- ---------------- ------- ------- ... ---- ---- ----- -----
#[Out]# 290.885387  14.433283 19233249+1425598  11.870   0.029 ...  121  0c0     0     0
#[Out]# 290.883563  14.436242 19233205+1426104  11.924   0.023 ...  111  000     0     0
#[Out]# 290.856901  14.494410 19232565+1429398   9.467   0.024 ...  111  000     0     0
#[Out]# 290.854934  14.475876 19232518+1428331  11.545   0.023 ...  111  000     0     0
#[Out]# 290.869099  14.465510 19232858+1427558   8.295   0.020 ...  111  000     0     0
#[Out]# 290.927729  14.478181 19234265+1428414  11.603   0.024 ...  111  000     2     0
#[Out]# 290.896063  14.448781 19233505+1426556   8.672   0.018 ...  111  000     2     0
#[Out]# 290.888486  14.461746 19233323+1427422  10.018   0.024 ...  111  000     2     0
#[Out]# 290.914630  14.486144 19233951+1429101  11.768   0.023 ...  111  000     2     0
#[Out]#        ...        ...              ...     ...     ... ...  ...  ...   ...   ...
#[Out]# 290.892759  14.507957 19233426+1430286  10.213   0.023 ...  111  000     0     0
#[Out]# 290.973511  14.551600 19235364+1433057  11.898   0.029 ...  111  000     2     0
#[Out]# 290.942194  14.548260 19234612+1432537  11.862   0.027 ...  111  000     2     0
#[Out]# 290.944519  14.515432 19234668+1430555   8.639   0.020 ...  111  000     2     0
#[Out]# 290.959013  14.550743 19235016+1433026  11.462   0.183 ...  111  cc0     2     0
#[Out]# 290.960248  14.549298 19235045+1432574   9.537   0.027 ...  111  000     2     0
#[Out]# 290.902727  14.562981 19233665+1433467  11.546   0.023 ...  111  000     0     0
#[Out]# 290.921168  14.578784 19234108+1434436  11.844   0.023 ...  111  000     0     0
#[Out]# 290.916457  14.567991 19233994+1434047  10.616   0.023 ...  111  000     0     0
#[Out]# 290.931891  14.574841 19234365+1434294  11.864   0.026 ...  111  000     0     0
pl.figure(figsize=(12,12))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
axlims = ax.axis()
pl.plot(table_coordinates.ra[brightstars],
        table_coordinates.dec[brightstars],
        transform=ax.get_transform('world'), marker='x', color='w', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
pl.figure(figsize=(24,24))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
axlims = ax.axis()
pl.plot(table_coordinates.ra[brightstars],
        table_coordinates.dec[brightstars],
        transform=ax.get_transform('world'), marker='x', color='w', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
get_ipython().run_line_magic('pwd', '')
#[Out]# '/orange/adamginsburg/w51/gtc/GTC2-20AFLO/OB0001/object'
get_ipython().run_line_magic('ls', '../../')
get_ipython().run_line_magic('ls', '../../../')
pl.figure(figsize=(12,12))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
pl.plot(starcat['xcentroid'], starcat['ycentroid'], 'wx')
pl.plot(table_coordinates.ra[brightstars],
        table_coordinates.dec[brightstars],
        transform=ax.get_transform('world'), marker='x', color='r', linestyle='none')
#[Out]# [<matplotlib.lines.Line2D at 0x2ae8475fba58>]
pl.figure(figsize=(12,12))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
pl.plot(starcat['xcentroid'], starcat['ycentroid'], 'wx')
pl.plot(table_coordinates.ra[brightstars],
        table_coordinates.dec[brightstars],
        transform=ax.get_transform('world'), marker='x', color='r', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
ww.wcs_world2pix(table_coordinates.ra, table_coordinates.dec, 0)
#[Out]# [array([1.90416911e+03, 1.22708141e+03, 1.23807713e+03, ...,
#[Out]#         5.37819238e+02, 3.09876249e-01, 5.36906589e+02]),
#[Out]#  array([2357.80265047, 2447.28902649, 2354.90826303, ..., -446.85786946,
#[Out]#         -133.77509257, -473.7452817 ])]
xc, yc = ww.wcs_world2pix(table_coordinates.ra, table_coordinates.dec, 0)
ra, dec = ww.wcs_pix2world(starcat['xcentroid'], starcat['ycentroid'], 0)
ra, de
ra, dec = ww.wcs_pix2world(starcat['xcentroid'], starcat['ycentroid'], 0)
ra, dec
#[Out]# (array([290.96273264, 290.90698346, 290.94045386, 290.88900644,
#[Out]#         290.92077933, 290.88756628, 290.8871992 , 290.89250502,
#[Out]#         290.90832629, 290.87779142, 290.92793654, 290.96249859,
#[Out]#         290.89148251, 290.89150528, 290.97433333, 290.89162701,
#[Out]#         290.95965028, 290.95967382, 290.93009552, 290.90192809,
#[Out]#         290.97504126, 290.96081144, 290.87337598, 290.88646529,
#[Out]#         290.96101417, 290.88647529, 290.960831  , 290.87565101,
#[Out]#         290.88649981, 290.9609504 , 290.96854363, 290.94277707,
#[Out]#         290.94274397, 290.9427871 , 290.94098396, 290.90583354,
#[Out]#         290.88875899, 290.88874497, 290.88962493, 290.88881025,
#[Out]#         290.885229  , 290.94399698, 290.95184746, 290.94759108,
#[Out]#         290.88233429, 290.95148595, 290.93121679, 290.86976705,
#[Out]#         290.91207239, 290.91799485, 290.90923933, 290.92527262,
#[Out]#         290.89506508, 290.91013632, 290.93646026, 290.94789924,
#[Out]#         290.88553045, 290.97035814, 290.88756551, 290.87075883,
#[Out]#         290.8736285 , 290.92596548, 290.92917328, 290.90452065,
#[Out]#         290.95765232, 290.90701349, 290.95028684, 290.9047431 ,
#[Out]#         290.96199374, 290.93171625, 290.91003986, 290.87396377,
#[Out]#         290.93042056, 290.94015154, 290.92858965, 290.87525063,
#[Out]#         290.94428091, 290.87111319, 290.94576622, 290.96687756,
#[Out]#         290.96688108, 290.88141075, 290.95732074, 290.87968706,
#[Out]#         290.92232929, 290.94607863, 290.93722826, 290.91352644,
#[Out]#         290.91603975, 290.91795866, 290.87756732, 290.96233976,
#[Out]#         290.94501556, 290.9180866 , 290.94491387, 290.94505741,
#[Out]#         290.95669752, 290.91612817, 290.95361782, 290.92779475,
#[Out]#         290.9489472 , 290.94456047, 290.93996868, 290.94320878,
#[Out]#         290.94309796, 290.94322869, 290.92826253, 290.88871707,
#[Out]#         290.88115839, 290.9055229 , 290.91063166, 290.88547896,
#[Out]#         290.94468547, 290.94425356, 290.88601312, 290.88278828,
#[Out]#         290.96555264, 290.9058444 , 290.90566954, 290.90584478,
#[Out]#         290.90586569, 290.89110236, 290.92690584, 290.89318392,
#[Out]#         290.90624017, 290.89315506, 290.8937189 , 290.87914204,
#[Out]#         290.91717559, 290.90498759, 290.93560211, 290.90968852,
#[Out]#         290.96634071, 290.96029259, 290.8934941 , 290.93122237,
#[Out]#         290.93176409, 290.91147   , 290.97109599, 290.96832588,
#[Out]#         290.97609301, 290.92923898, 290.91877618, 290.88570805,
#[Out]#         290.86612832, 290.91091454, 290.89355017, 290.92748442,
#[Out]#         290.87026151, 290.86816829, 290.95164252, 290.9201332 ,
#[Out]#         290.88619201, 290.93227591, 290.90976159, 290.92550614,
#[Out]#         290.88416357, 290.88417471, 290.96817969, 290.89322725,
#[Out]#         290.93621723, 290.93203041, 290.89716745, 290.93276924,
#[Out]#         290.93527397, 290.97080072, 290.94846004, 290.88125376,
#[Out]#         290.88244263, 290.91503541, 290.90523424, 290.91505477,
#[Out]#         290.89533923, 290.88676202, 290.952685  , 290.90539041,
#[Out]#         290.89543443, 290.92791032, 290.92778815, 290.87722045,
#[Out]#         290.93588741, 290.92233213, 290.90435787, 290.9207327 ,
#[Out]#         290.92816793, 290.94847672, 290.92819067, 290.8787743 ,
#[Out]#         290.94561098, 290.88847368, 290.87955792, 290.91210278,
#[Out]#         290.87916296, 290.87070665, 290.94782795, 290.9477451 ,
#[Out]#         290.88728926, 290.96002754, 290.90455986, 290.94718696,
#[Out]#         290.94718464, 290.89105712, 290.92100265, 290.93858243,
#[Out]#         290.91420399, 290.88068487, 290.90533088, 290.86952274,
#[Out]#         290.9389899 , 290.93169964, 290.892517  , 290.88363595,
#[Out]#         290.9672107 , 290.92280491, 290.87782037, 290.88693667,
#[Out]#         290.86937942, 290.86925394, 290.91426806, 290.97257778,
#[Out]#         290.95072386, 290.89882429, 290.91719391, 290.88889668,
#[Out]#         290.88897908, 290.88883448, 290.93506977, 290.92783394,
#[Out]#         290.87753348, 290.90507851, 290.91408857, 290.91408678,
#[Out]#         290.91408422, 290.91409145, 290.94696178, 290.88751926,
#[Out]#         290.88634044, 290.91848727, 290.88748995, 290.90609829,
#[Out]#         290.89884369, 290.89909135, 290.88673306, 290.92995245,
#[Out]#         290.89890371, 290.89051063, 290.95467793, 290.96986859,
#[Out]#         290.89367508, 290.87361579, 290.9405875 , 290.97453141,
#[Out]#         290.93289654, 290.97451331, 290.86897177, 290.88085661,
#[Out]#         290.90504206, 290.8735257 ]),
#[Out]#  array([14.55891228, 14.55934029, 14.55837277, 14.55730484, 14.55726308,
#[Out]#         14.55698552, 14.55587973, 14.5558412 , 14.55567525, 14.55491824,
#[Out]#         14.55524964, 14.55397887, 14.5537353 , 14.55374866, 14.55083364,
#[Out]#         14.55084661, 14.54999751, 14.54994637, 14.55014897, 14.54944704,
#[Out]#         14.54838303, 14.54860609, 14.5484762 , 14.54853389, 14.54847092,
#[Out]#         14.54856409, 14.5484489 , 14.54832073, 14.548526  , 14.54831613,
#[Out]#         14.54769584, 14.54743824, 14.54742202, 14.54744753, 14.54518734,
#[Out]#         14.54355735, 14.54268283, 14.54265214, 14.54249406, 14.54258713,
#[Out]#         14.54223925, 14.54168843, 14.541388  , 14.53997399, 14.5394532 ,
#[Out]#         14.53891125, 14.53655165, 14.53552736, 14.53582853, 14.53579761,
#[Out]#         14.53538105, 14.53437941, 14.53394184, 14.53373941, 14.53309023,
#[Out]#         14.53256405, 14.53236492, 14.53039447, 14.53047879, 14.52999084,
#[Out]#         14.52966855, 14.52968199, 14.52951048, 14.52951785, 14.52929682,
#[Out]#         14.52846725, 14.52811467, 14.52774665, 14.52699759, 14.52708478,
#[Out]#         14.52681557, 14.52554498, 14.52468374, 14.52437492, 14.52343159,
#[Out]#         14.52308304, 14.52268493, 14.52255499, 14.52241384, 14.52132599,
#[Out]#         14.52133078, 14.52115417, 14.52044464, 14.52001915, 14.51970777,
#[Out]#         14.51912007, 14.5179649 , 14.51799281, 14.51775239, 14.51749571,
#[Out]#         14.51621901, 14.51517774, 14.51472159, 14.5144857 , 14.51439436,
#[Out]#         14.51417693, 14.51387553, 14.51295791, 14.51276168, 14.51262879,
#[Out]#         14.51250397, 14.51244757, 14.51241529, 14.51220381, 14.51224524,
#[Out]#         14.51224385, 14.51187803, 14.51176166, 14.51129612, 14.51098928,
#[Out]#         14.5106678 , 14.50969043, 14.50957517, 14.50930381, 14.50934813,
#[Out]#         14.50894684, 14.50858774, 14.50843501, 14.5084109 , 14.50837517,
#[Out]#         14.50827876, 14.5077642 , 14.50693197, 14.50691581, 14.50679266,
#[Out]#         14.50691063, 14.50661609, 14.50654422, 14.50495413, 14.50492625,
#[Out]#         14.50448335, 14.50388534, 14.50367747, 14.50328423, 14.50295913,
#[Out]#         14.50277818, 14.50196888, 14.50187512, 14.50138902, 14.50130286,
#[Out]#         14.50115962, 14.50116296, 14.50032169, 14.5002551 , 14.500357  ,
#[Out]#         14.49949253, 14.49893749, 14.49747934, 14.49628737, 14.49629749,
#[Out]#         14.49584025, 14.4957818 , 14.49553862, 14.49522927, 14.49483114,
#[Out]#         14.49330536, 14.49084919, 14.49072808, 14.49045993, 14.49002269,
#[Out]#         14.48983537, 14.48935589, 14.48903622, 14.48770046, 14.48728554,
#[Out]#         14.48709481, 14.48691895, 14.48676193, 14.48647718, 14.48512735,
#[Out]#         14.48507493, 14.48506876, 14.48447536, 14.48429525, 14.48371214,
#[Out]#         14.48345859, 14.48349075, 14.48315271, 14.48180146, 14.48074549,
#[Out]#         14.48044457, 14.48015167, 14.47864179, 14.47829909, 14.47721686,
#[Out]#         14.47718046, 14.477061  , 14.47723123, 14.47682834, 14.47601579,
#[Out]#         14.47598344, 14.47562863, 14.47506313, 14.47515649, 14.47449114,
#[Out]#         14.47424168, 14.47352715, 14.47343604, 14.47212419, 14.47104306,
#[Out]#         14.47097769, 14.4709531 , 14.4705768 , 14.46962328, 14.4693132 ,
#[Out]#         14.4695969 , 14.46912169, 14.46874642, 14.46810282, 14.46729256,
#[Out]#         14.4668659 , 14.46644406, 14.46565634, 14.46531583, 14.46558488,
#[Out]#         14.4647999 , 14.46483053, 14.46470341, 14.46393215, 14.46391753,
#[Out]#         14.46275872, 14.46243797, 14.46062937, 14.46076085, 14.46061698,
#[Out]#         14.46039451, 14.46005696, 14.45985882, 14.46032477, 14.45965817,
#[Out]#         14.45861839, 14.45853208, 14.45853253, 14.45853079, 14.45798368,
#[Out]#         14.45766925, 14.4567918 , 14.45637264, 14.45622409, 14.45532836,
#[Out]#         14.45505641, 14.45489556, 14.45507556, 14.45467924, 14.45471399,
#[Out]#         14.45486299, 14.45458462, 14.45477683, 14.45411365, 14.45383295,
#[Out]#         14.45314607, 14.45354794, 14.45293535, 14.45349547, 14.45279194,
#[Out]#         14.45175075, 14.45124801, 14.45186401]))
ra, dec = ww.wcs_pix2world(starcat['xcentroid'], starcat['ycentroid'], 0)
get_ipython().run_line_magic('pinfo', 'coordinates.match_coordinates_sky')
starfind_coords = coordinates.SkyCoord(ra, dec, frame='fk5')
ra, dec = ww.wcs_pix2world(starcat['xcentroid'], starcat['ycentroid'], 0)*u.deg
starfind_coords = coordinates.SkyCoord(ra, dec, frame='fk5')
starfind_coords.shape, table_coordinates.shape
#[Out]# ((258,), (1716,))
matches = coordinates.match_coordinates_sky(starfind_coords, table_coordinates)
matches
#[Out]# (array([1455, 1202, 1417, 1126,  958, 1096, 1088, 1228, 1192, 1169, 1079,
#[Out]#         1458, 1130, 1130, 1315, 1170, 1507, 1507, 1048, 1208, 1312, 1507,
#[Out]#          855, 1090, 1460, 1090, 1460, 1141, 1090, 1460, 1377, 1429, 1429,
#[Out]#         1429, 1415, 1174, 1125, 1125, 1125, 1125, 1104, 1442, 1401, 1388,
#[Out]#         1153, 1402, 1024,  870,  974,  939,  978, 1049, 1215,  972, 1037,
#[Out]#         1387, 1098, 1293, 1107,  850,  854, 1060, 1077, 1172, 1492, 1201,
#[Out]#         1407, 1172, 1461, 1017, 1087,  857, 1028, 1420, 1085,  861, 1437,
#[Out]#          845, 1390, 1475, 1475, 1167, 1489, 1140,  948, 1430, 1032,  998,
#[Out]#          989,  934, 1135, 1459, 1434,  928, 1434, 1438, 1484,  991, 1468,
#[Out]#         1068, 1382, 1438, 1419, 1444, 1444, 1444, 1056, 1123, 1161, 1171,
#[Out]#          969, 1097, 1395, 1440, 1097, 1151, 1474, 1189, 1189, 1189, 1189,
#[Out]#         1113, 1050, 1216, 1189, 1216, 1216, 1137,  964, 1188, 1042, 1089,
#[Out]#         1478, 1480, 1213, 1013, 1013,  971, 1288, 1426, 1301, 1070,  943,
#[Out]#         1091,  903,  975,  229,  252,  159,  192,  688,  207,  296,  209,
#[Out]#          354,  437,  521,  521,  729,  313,  312,  222,  248,  222,  273,
#[Out]#          721,  679,  506,  523,  297,  455,  297,  260,  282,  645,  456,
#[Out]#          260,  247,  247,  485,  319,  465,  458,  452,  257,  766,  257,
#[Out]#          508,  674,  280,  494,  403,  494,  154,  675,  675,  290,  761,
#[Out]#          451,  670,  670,  327,  449,  656,  377,  501,  454,  146,  656,
#[Out]#          218,  338,  512,  630,  469,  483,  302,  156,  156,  385,  526,
#[Out]#          690,  432,  345,  283,  283,  283,  272,  245,  478,  446,  382,
#[Out]#          382,  382,  382,  669,  288,  304,  407,  278,  363,  427,  427,
#[Out]#          304,  265,  427,  291,  657,  727,  228,  149,  635,  564,  232,
#[Out]#          542,  163,  500,  445,  149]),
#[Out]#  <Angle [0.00099492, 0.00083726, 0.00094048, 0.0007511 , 0.00089692,
#[Out]#          0.00075563, 0.00078508, 0.00088908, 0.0008465 , 0.00019905,
#[Out]#          0.00092463, 0.00100528, 0.00084489, 0.00084234, 0.00110492,
#[Out]#          0.00084751, 0.00090777, 0.00085397, 0.00094707, 0.00091161,
#[Out]#          0.00108452, 0.000881  , 0.00076415, 0.0008501 , 0.00093035,
#[Out]#          0.00082611, 0.00100998, 0.00078646, 0.00087056, 0.00083422,
#[Out]#          0.00107857, 0.0009969 , 0.00099277, 0.00099483, 0.00101865,
#[Out]#          0.00091349, 0.00083473, 0.00085772, 0.00151213, 0.00094232,
#[Out]#          0.00089901, 0.00097679, 0.00101738, 0.00102561, 0.00090159,
#[Out]#          0.00103659, 0.0009793 , 0.00088841, 0.00095276, 0.00098923,
#[Out]#          0.00091008, 0.00099376, 0.00094735, 0.00035124, 0.00103155,
#[Out]#          0.00105638, 0.00092666, 0.00112443, 0.00094342, 0.0009165 ,
#[Out]#          0.00088389, 0.00102286, 0.00103969, 0.00086896, 0.00109772,
#[Out]#          0.00097615, 0.00107745, 0.00099166, 0.00111488, 0.00102653,
#[Out]#          0.00100336, 0.00083267, 0.00105777, 0.00107034, 0.0010642 ,
#[Out]#          0.00088639, 0.00106357, 0.0009548 , 0.0009917 , 0.00114395,
#[Out]#          0.00114162, 0.00096541, 0.00111529, 0.00092307, 0.00074148,
#[Out]#          0.00108152, 0.00105973, 0.00099802, 0.00090268, 0.0011651 ,
#[Out]#          0.00098598, 0.0011318 , 0.00085777, 0.00083368, 0.00110581,
#[Out]#          0.00124271, 0.00112719, 0.00107032, 0.00111866, 0.00100592,
#[Out]#          0.00110785, 0.00113123, 0.00108228, 0.00113869, 0.0010558 ,
#[Out]#          0.00111235, 0.00127994, 0.0010331 , 0.00097484, 0.00099303,
#[Out]#          0.00052405, 0.00089342, 0.00094148, 0.00112348, 0.00091303,
#[Out]#          0.00103195, 0.00119463, 0.00068203, 0.00067829, 0.00062218,
#[Out]#          0.00052635, 0.00100069, 0.00117297, 0.00111951, 0.00103553,
#[Out]#          0.00111441, 0.00163145, 0.00100212, 0.0010597 , 0.00092007,
#[Out]#          0.00112245, 0.00104426, 0.00117491, 0.00067797, 0.00102267,
#[Out]#          0.00013594, 0.00105657, 0.00104279, 0.00118621, 0.00116384,
#[Out]#          0.00124866, 0.00107363, 0.00105759, 0.00104751, 0.00096964,
#[Out]#          0.00105609, 0.00043472, 0.00107492, 0.00097794, 0.00103106,
#[Out]#          0.00119207, 0.00106108, 0.0010468 , 0.00109303, 0.00111955,
#[Out]#          0.00110729, 0.00096711, 0.00108506, 0.00123833, 0.0010373 ,
#[Out]#          0.00106654, 0.00066489, 0.00105215, 0.00113895, 0.00116747,
#[Out]#          0.00128125, 0.001176  , 0.00106634, 0.00106324, 0.00108979,
#[Out]#          0.00063982, 0.00115121, 0.00026721, 0.0004587 , 0.00120591,
#[Out]#          0.00028873, 0.00106637, 0.00064121, 0.00115557, 0.00108173,
#[Out]#          0.00117117, 0.00111558, 0.00110742, 0.00113328, 0.00105365,
#[Out]#          0.00119933, 0.0012059 , 0.00047253, 0.00118354, 0.00108501,
#[Out]#          0.00068375, 0.00111169, 0.0010816 , 0.00115584, 0.0011924 ,
#[Out]#          0.00139216, 0.00109555, 0.0012707 , 0.00112335, 0.00118729,
#[Out]#          0.00124627, 0.00109213, 0.00115351, 0.00040895, 0.00116159,
#[Out]#          0.00071368, 0.00114192, 0.00135689, 0.00121518, 0.00117631,
#[Out]#          0.0011134 , 0.00112157, 0.00136098, 0.00117816, 0.00111285,
#[Out]#          0.00093359, 0.00073172, 0.00082043, 0.00117277, 0.00142731,
#[Out]#          0.00117642, 0.00113672, 0.00048784, 0.00106238, 0.00122583,
#[Out]#          0.00139298, 0.00122717, 0.00119821, 0.00114146, 0.00115764,
#[Out]#          0.00110244, 0.00118257, 0.0011813 , 0.00118532, 0.00127993,
#[Out]#          0.0004546 , 0.0005847 , 0.00095372, 0.00053214, 0.00115031,
#[Out]#          0.00104844, 0.00128539, 0.00117775, 0.00123992, 0.0013936 ,
#[Out]#          0.00117511, 0.00137505, 0.00125362, 0.00117092, 0.00074799,
#[Out]#          0.00131667, 0.00151469, 0.0011828 , 0.00152907, 0.00126642,
#[Out]#          0.00121201, 0.0012288 , 0.00129615] deg>,
#[Out]#  <Quantity [1.73646409e-05, 1.46129254e-05, 1.64144207e-05, 1.31092271e-05,
#[Out]#             1.56541830e-05, 1.31883144e-05, 1.37023029e-05, 1.55173899e-05,
#[Out]#             1.47741551e-05, 3.47415146e-06, 1.61379017e-05, 1.75453714e-05,
#[Out]#             1.47461354e-05, 1.47016400e-05, 1.92844604e-05, 1.47918139e-05,
#[Out]#             1.58434883e-05, 1.49045343e-05, 1.65295267e-05, 1.59105914e-05,
#[Out]#             1.89284295e-05, 1.53764036e-05, 1.33369521e-05, 1.48369917e-05,
#[Out]#             1.62376881e-05, 1.44183290e-05, 1.76274283e-05, 1.37263637e-05,
#[Out]#             1.51941402e-05, 1.45598391e-05, 1.88245455e-05, 1.73991247e-05,
#[Out]#             1.73270699e-05, 1.73630101e-05, 1.77788779e-05, 1.59434523e-05,
#[Out]#             1.45687460e-05, 1.49699938e-05, 2.63916542e-05, 1.64466175e-05,
#[Out]#             1.56906979e-05, 1.70481788e-05, 1.77565506e-05, 1.79002129e-05,
#[Out]#             1.57357674e-05, 1.80918432e-05, 1.70920527e-05, 1.55056827e-05,
#[Out]#             1.66287253e-05, 1.72653092e-05, 1.58838528e-05, 1.73444232e-05,
#[Out]#             1.65343071e-05, 6.13027207e-06, 1.80038840e-05, 1.84372482e-05,
#[Out]#             1.61733188e-05, 1.96250284e-05, 1.64657667e-05, 1.59959810e-05,
#[Out]#             1.54267050e-05, 1.78523381e-05, 1.81459594e-05, 1.51662033e-05,
#[Out]#             1.91588003e-05, 1.70371021e-05, 1.88050800e-05, 1.73077841e-05,
#[Out]#             1.94582495e-05, 1.79162611e-05, 1.75118551e-05, 1.45328063e-05,
#[Out]#             1.84616518e-05, 1.86810226e-05, 1.85738346e-05, 1.54704539e-05,
#[Out]#             1.85627351e-05, 1.66643602e-05, 1.73084222e-05, 1.99656849e-05,
#[Out]#             1.99250299e-05, 1.68496225e-05, 1.94654233e-05, 1.61106735e-05,
#[Out]#             1.29413422e-05, 1.88761668e-05, 1.84958352e-05, 1.74188035e-05,
#[Out]#             1.57547053e-05, 2.03348192e-05, 1.72085231e-05, 1.97535595e-05,
#[Out]#             1.49708355e-05, 1.45505079e-05, 1.93001050e-05, 2.16894586e-05,
#[Out]#             1.96731899e-05, 1.86806232e-05, 1.95242745e-05, 1.75566849e-05,
#[Out]#             1.93355877e-05, 1.97436157e-05, 1.88893429e-05, 1.98738135e-05,
#[Out]#             1.84272205e-05, 1.94141439e-05, 2.23391524e-05, 1.80309260e-05,
#[Out]#             1.70142517e-05, 1.73316658e-05, 9.14639576e-06, 1.55931391e-05,
#[Out]#             1.64318461e-05, 1.96084488e-05, 1.59354208e-05, 1.80108576e-05,
#[Out]#             2.08501552e-05, 1.19036377e-05, 1.18383235e-05, 1.08591691e-05,
#[Out]#             9.18651403e-06, 1.74652694e-05, 2.04722168e-05, 1.95391042e-05,
#[Out]#             1.80734801e-05, 1.94501898e-05, 2.84741950e-05, 1.74903592e-05,
#[Out]#             1.84952202e-05, 1.60582509e-05, 1.95903832e-05, 1.82258570e-05,
#[Out]#             2.05060335e-05, 1.18327690e-05, 1.78490023e-05, 2.37251941e-06,
#[Out]#             1.84406920e-05, 1.82000486e-05, 2.07033502e-05, 2.03129100e-05,
#[Out]#             2.17931574e-05, 1.87383305e-05, 1.84584921e-05, 1.82825338e-05,
#[Out]#             1.69234715e-05, 1.84323135e-05, 7.58732899e-06, 1.87608468e-05,
#[Out]#             1.70683017e-05, 1.79953898e-05, 2.08054744e-05, 1.85193793e-05,
#[Out]#             1.82701418e-05, 1.90770141e-05, 1.95397823e-05, 1.93258540e-05,
#[Out]#             1.68791937e-05, 1.89378457e-05, 2.16128841e-05, 1.81043701e-05,
#[Out]#             1.86146877e-05, 1.16044426e-05, 1.83634794e-05, 1.98784963e-05,
#[Out]#             2.03761648e-05, 2.23619730e-05, 2.05250451e-05, 1.86111281e-05,
#[Out]#             1.85570147e-05, 1.90204356e-05, 1.11669806e-05, 2.00924401e-05,
#[Out]#             4.66361387e-06, 8.00575995e-06, 2.10471251e-05, 5.03921847e-06,
#[Out]#             1.86116741e-05, 1.11911590e-05, 2.01684215e-05, 1.88797011e-05,
#[Out]#             2.04406991e-05, 1.94705218e-05, 1.93280913e-05, 1.97795294e-05,
#[Out]#             1.83897085e-05, 2.09322395e-05, 2.10470031e-05, 8.24712968e-06,
#[Out]#             2.06566228e-05, 1.89369778e-05, 1.19336812e-05, 1.94027372e-05,
#[Out]#             1.88774538e-05, 2.01732496e-05, 2.08113019e-05, 2.42978435e-05,
#[Out]#             1.91210304e-05, 2.21779159e-05, 1.96061658e-05, 2.07221086e-05,
#[Out]#             2.17515635e-05, 1.90612733e-05, 2.01326000e-05, 7.13755442e-06,
#[Out]#             2.02735638e-05, 1.24559971e-05, 1.99302954e-05, 2.36821897e-05,
#[Out]#             2.12089619e-05, 2.05304058e-05, 1.94325150e-05, 1.95751509e-05,
#[Out]#             2.37536137e-05, 2.05627184e-05, 1.94229745e-05, 1.62942794e-05,
#[Out]#             1.27708788e-05, 1.43191714e-05, 2.04687129e-05, 2.49112981e-05,
#[Out]#             2.05323344e-05, 1.98395439e-05, 8.51445637e-06, 1.85420481e-05,
#[Out]#             2.13946885e-05, 2.43120359e-05, 2.14181269e-05, 2.09126558e-05,
#[Out]#             1.99222195e-05, 2.02045874e-05, 1.92411835e-05, 2.06396611e-05,
#[Out]#             2.06176251e-05, 2.06877471e-05, 2.23390311e-05, 7.93434957e-06,
#[Out]#             1.02048907e-05, 1.66455311e-05, 9.28760208e-06, 2.00766671e-05,
#[Out]#             1.82987168e-05, 2.24343701e-05, 2.05555300e-05, 2.16407496e-05,
#[Out]#             2.43228559e-05, 2.05094859e-05, 2.39990672e-05, 2.18798146e-05,
#[Out]#             2.04364464e-05, 1.30549204e-05, 2.29802030e-05, 2.64362604e-05,
#[Out]#             2.06437080e-05, 2.66872847e-05, 2.21031942e-05, 2.11534922e-05,
#[Out]#             2.14465828e-05, 2.26220255e-05]>)
matches[0].shape
#[Out]# (258,)
matches
#[Out]# (array([1455, 1202, 1417, 1126,  958, 1096, 1088, 1228, 1192, 1169, 1079,
#[Out]#         1458, 1130, 1130, 1315, 1170, 1507, 1507, 1048, 1208, 1312, 1507,
#[Out]#          855, 1090, 1460, 1090, 1460, 1141, 1090, 1460, 1377, 1429, 1429,
#[Out]#         1429, 1415, 1174, 1125, 1125, 1125, 1125, 1104, 1442, 1401, 1388,
#[Out]#         1153, 1402, 1024,  870,  974,  939,  978, 1049, 1215,  972, 1037,
#[Out]#         1387, 1098, 1293, 1107,  850,  854, 1060, 1077, 1172, 1492, 1201,
#[Out]#         1407, 1172, 1461, 1017, 1087,  857, 1028, 1420, 1085,  861, 1437,
#[Out]#          845, 1390, 1475, 1475, 1167, 1489, 1140,  948, 1430, 1032,  998,
#[Out]#          989,  934, 1135, 1459, 1434,  928, 1434, 1438, 1484,  991, 1468,
#[Out]#         1068, 1382, 1438, 1419, 1444, 1444, 1444, 1056, 1123, 1161, 1171,
#[Out]#          969, 1097, 1395, 1440, 1097, 1151, 1474, 1189, 1189, 1189, 1189,
#[Out]#         1113, 1050, 1216, 1189, 1216, 1216, 1137,  964, 1188, 1042, 1089,
#[Out]#         1478, 1480, 1213, 1013, 1013,  971, 1288, 1426, 1301, 1070,  943,
#[Out]#         1091,  903,  975,  229,  252,  159,  192,  688,  207,  296,  209,
#[Out]#          354,  437,  521,  521,  729,  313,  312,  222,  248,  222,  273,
#[Out]#          721,  679,  506,  523,  297,  455,  297,  260,  282,  645,  456,
#[Out]#          260,  247,  247,  485,  319,  465,  458,  452,  257,  766,  257,
#[Out]#          508,  674,  280,  494,  403,  494,  154,  675,  675,  290,  761,
#[Out]#          451,  670,  670,  327,  449,  656,  377,  501,  454,  146,  656,
#[Out]#          218,  338,  512,  630,  469,  483,  302,  156,  156,  385,  526,
#[Out]#          690,  432,  345,  283,  283,  283,  272,  245,  478,  446,  382,
#[Out]#          382,  382,  382,  669,  288,  304,  407,  278,  363,  427,  427,
#[Out]#          304,  265,  427,  291,  657,  727,  228,  149,  635,  564,  232,
#[Out]#          542,  163,  500,  445,  149]),
#[Out]#  <Angle [0.00099492, 0.00083726, 0.00094048, 0.0007511 , 0.00089692,
#[Out]#          0.00075563, 0.00078508, 0.00088908, 0.0008465 , 0.00019905,
#[Out]#          0.00092463, 0.00100528, 0.00084489, 0.00084234, 0.00110492,
#[Out]#          0.00084751, 0.00090777, 0.00085397, 0.00094707, 0.00091161,
#[Out]#          0.00108452, 0.000881  , 0.00076415, 0.0008501 , 0.00093035,
#[Out]#          0.00082611, 0.00100998, 0.00078646, 0.00087056, 0.00083422,
#[Out]#          0.00107857, 0.0009969 , 0.00099277, 0.00099483, 0.00101865,
#[Out]#          0.00091349, 0.00083473, 0.00085772, 0.00151213, 0.00094232,
#[Out]#          0.00089901, 0.00097679, 0.00101738, 0.00102561, 0.00090159,
#[Out]#          0.00103659, 0.0009793 , 0.00088841, 0.00095276, 0.00098923,
#[Out]#          0.00091008, 0.00099376, 0.00094735, 0.00035124, 0.00103155,
#[Out]#          0.00105638, 0.00092666, 0.00112443, 0.00094342, 0.0009165 ,
#[Out]#          0.00088389, 0.00102286, 0.00103969, 0.00086896, 0.00109772,
#[Out]#          0.00097615, 0.00107745, 0.00099166, 0.00111488, 0.00102653,
#[Out]#          0.00100336, 0.00083267, 0.00105777, 0.00107034, 0.0010642 ,
#[Out]#          0.00088639, 0.00106357, 0.0009548 , 0.0009917 , 0.00114395,
#[Out]#          0.00114162, 0.00096541, 0.00111529, 0.00092307, 0.00074148,
#[Out]#          0.00108152, 0.00105973, 0.00099802, 0.00090268, 0.0011651 ,
#[Out]#          0.00098598, 0.0011318 , 0.00085777, 0.00083368, 0.00110581,
#[Out]#          0.00124271, 0.00112719, 0.00107032, 0.00111866, 0.00100592,
#[Out]#          0.00110785, 0.00113123, 0.00108228, 0.00113869, 0.0010558 ,
#[Out]#          0.00111235, 0.00127994, 0.0010331 , 0.00097484, 0.00099303,
#[Out]#          0.00052405, 0.00089342, 0.00094148, 0.00112348, 0.00091303,
#[Out]#          0.00103195, 0.00119463, 0.00068203, 0.00067829, 0.00062218,
#[Out]#          0.00052635, 0.00100069, 0.00117297, 0.00111951, 0.00103553,
#[Out]#          0.00111441, 0.00163145, 0.00100212, 0.0010597 , 0.00092007,
#[Out]#          0.00112245, 0.00104426, 0.00117491, 0.00067797, 0.00102267,
#[Out]#          0.00013594, 0.00105657, 0.00104279, 0.00118621, 0.00116384,
#[Out]#          0.00124866, 0.00107363, 0.00105759, 0.00104751, 0.00096964,
#[Out]#          0.00105609, 0.00043472, 0.00107492, 0.00097794, 0.00103106,
#[Out]#          0.00119207, 0.00106108, 0.0010468 , 0.00109303, 0.00111955,
#[Out]#          0.00110729, 0.00096711, 0.00108506, 0.00123833, 0.0010373 ,
#[Out]#          0.00106654, 0.00066489, 0.00105215, 0.00113895, 0.00116747,
#[Out]#          0.00128125, 0.001176  , 0.00106634, 0.00106324, 0.00108979,
#[Out]#          0.00063982, 0.00115121, 0.00026721, 0.0004587 , 0.00120591,
#[Out]#          0.00028873, 0.00106637, 0.00064121, 0.00115557, 0.00108173,
#[Out]#          0.00117117, 0.00111558, 0.00110742, 0.00113328, 0.00105365,
#[Out]#          0.00119933, 0.0012059 , 0.00047253, 0.00118354, 0.00108501,
#[Out]#          0.00068375, 0.00111169, 0.0010816 , 0.00115584, 0.0011924 ,
#[Out]#          0.00139216, 0.00109555, 0.0012707 , 0.00112335, 0.00118729,
#[Out]#          0.00124627, 0.00109213, 0.00115351, 0.00040895, 0.00116159,
#[Out]#          0.00071368, 0.00114192, 0.00135689, 0.00121518, 0.00117631,
#[Out]#          0.0011134 , 0.00112157, 0.00136098, 0.00117816, 0.00111285,
#[Out]#          0.00093359, 0.00073172, 0.00082043, 0.00117277, 0.00142731,
#[Out]#          0.00117642, 0.00113672, 0.00048784, 0.00106238, 0.00122583,
#[Out]#          0.00139298, 0.00122717, 0.00119821, 0.00114146, 0.00115764,
#[Out]#          0.00110244, 0.00118257, 0.0011813 , 0.00118532, 0.00127993,
#[Out]#          0.0004546 , 0.0005847 , 0.00095372, 0.00053214, 0.00115031,
#[Out]#          0.00104844, 0.00128539, 0.00117775, 0.00123992, 0.0013936 ,
#[Out]#          0.00117511, 0.00137505, 0.00125362, 0.00117092, 0.00074799,
#[Out]#          0.00131667, 0.00151469, 0.0011828 , 0.00152907, 0.00126642,
#[Out]#          0.00121201, 0.0012288 , 0.00129615] deg>,
#[Out]#  <Quantity [1.73646409e-05, 1.46129254e-05, 1.64144207e-05, 1.31092271e-05,
#[Out]#             1.56541830e-05, 1.31883144e-05, 1.37023029e-05, 1.55173899e-05,
#[Out]#             1.47741551e-05, 3.47415146e-06, 1.61379017e-05, 1.75453714e-05,
#[Out]#             1.47461354e-05, 1.47016400e-05, 1.92844604e-05, 1.47918139e-05,
#[Out]#             1.58434883e-05, 1.49045343e-05, 1.65295267e-05, 1.59105914e-05,
#[Out]#             1.89284295e-05, 1.53764036e-05, 1.33369521e-05, 1.48369917e-05,
#[Out]#             1.62376881e-05, 1.44183290e-05, 1.76274283e-05, 1.37263637e-05,
#[Out]#             1.51941402e-05, 1.45598391e-05, 1.88245455e-05, 1.73991247e-05,
#[Out]#             1.73270699e-05, 1.73630101e-05, 1.77788779e-05, 1.59434523e-05,
#[Out]#             1.45687460e-05, 1.49699938e-05, 2.63916542e-05, 1.64466175e-05,
#[Out]#             1.56906979e-05, 1.70481788e-05, 1.77565506e-05, 1.79002129e-05,
#[Out]#             1.57357674e-05, 1.80918432e-05, 1.70920527e-05, 1.55056827e-05,
#[Out]#             1.66287253e-05, 1.72653092e-05, 1.58838528e-05, 1.73444232e-05,
#[Out]#             1.65343071e-05, 6.13027207e-06, 1.80038840e-05, 1.84372482e-05,
#[Out]#             1.61733188e-05, 1.96250284e-05, 1.64657667e-05, 1.59959810e-05,
#[Out]#             1.54267050e-05, 1.78523381e-05, 1.81459594e-05, 1.51662033e-05,
#[Out]#             1.91588003e-05, 1.70371021e-05, 1.88050800e-05, 1.73077841e-05,
#[Out]#             1.94582495e-05, 1.79162611e-05, 1.75118551e-05, 1.45328063e-05,
#[Out]#             1.84616518e-05, 1.86810226e-05, 1.85738346e-05, 1.54704539e-05,
#[Out]#             1.85627351e-05, 1.66643602e-05, 1.73084222e-05, 1.99656849e-05,
#[Out]#             1.99250299e-05, 1.68496225e-05, 1.94654233e-05, 1.61106735e-05,
#[Out]#             1.29413422e-05, 1.88761668e-05, 1.84958352e-05, 1.74188035e-05,
#[Out]#             1.57547053e-05, 2.03348192e-05, 1.72085231e-05, 1.97535595e-05,
#[Out]#             1.49708355e-05, 1.45505079e-05, 1.93001050e-05, 2.16894586e-05,
#[Out]#             1.96731899e-05, 1.86806232e-05, 1.95242745e-05, 1.75566849e-05,
#[Out]#             1.93355877e-05, 1.97436157e-05, 1.88893429e-05, 1.98738135e-05,
#[Out]#             1.84272205e-05, 1.94141439e-05, 2.23391524e-05, 1.80309260e-05,
#[Out]#             1.70142517e-05, 1.73316658e-05, 9.14639576e-06, 1.55931391e-05,
#[Out]#             1.64318461e-05, 1.96084488e-05, 1.59354208e-05, 1.80108576e-05,
#[Out]#             2.08501552e-05, 1.19036377e-05, 1.18383235e-05, 1.08591691e-05,
#[Out]#             9.18651403e-06, 1.74652694e-05, 2.04722168e-05, 1.95391042e-05,
#[Out]#             1.80734801e-05, 1.94501898e-05, 2.84741950e-05, 1.74903592e-05,
#[Out]#             1.84952202e-05, 1.60582509e-05, 1.95903832e-05, 1.82258570e-05,
#[Out]#             2.05060335e-05, 1.18327690e-05, 1.78490023e-05, 2.37251941e-06,
#[Out]#             1.84406920e-05, 1.82000486e-05, 2.07033502e-05, 2.03129100e-05,
#[Out]#             2.17931574e-05, 1.87383305e-05, 1.84584921e-05, 1.82825338e-05,
#[Out]#             1.69234715e-05, 1.84323135e-05, 7.58732899e-06, 1.87608468e-05,
#[Out]#             1.70683017e-05, 1.79953898e-05, 2.08054744e-05, 1.85193793e-05,
#[Out]#             1.82701418e-05, 1.90770141e-05, 1.95397823e-05, 1.93258540e-05,
#[Out]#             1.68791937e-05, 1.89378457e-05, 2.16128841e-05, 1.81043701e-05,
#[Out]#             1.86146877e-05, 1.16044426e-05, 1.83634794e-05, 1.98784963e-05,
#[Out]#             2.03761648e-05, 2.23619730e-05, 2.05250451e-05, 1.86111281e-05,
#[Out]#             1.85570147e-05, 1.90204356e-05, 1.11669806e-05, 2.00924401e-05,
#[Out]#             4.66361387e-06, 8.00575995e-06, 2.10471251e-05, 5.03921847e-06,
#[Out]#             1.86116741e-05, 1.11911590e-05, 2.01684215e-05, 1.88797011e-05,
#[Out]#             2.04406991e-05, 1.94705218e-05, 1.93280913e-05, 1.97795294e-05,
#[Out]#             1.83897085e-05, 2.09322395e-05, 2.10470031e-05, 8.24712968e-06,
#[Out]#             2.06566228e-05, 1.89369778e-05, 1.19336812e-05, 1.94027372e-05,
#[Out]#             1.88774538e-05, 2.01732496e-05, 2.08113019e-05, 2.42978435e-05,
#[Out]#             1.91210304e-05, 2.21779159e-05, 1.96061658e-05, 2.07221086e-05,
#[Out]#             2.17515635e-05, 1.90612733e-05, 2.01326000e-05, 7.13755442e-06,
#[Out]#             2.02735638e-05, 1.24559971e-05, 1.99302954e-05, 2.36821897e-05,
#[Out]#             2.12089619e-05, 2.05304058e-05, 1.94325150e-05, 1.95751509e-05,
#[Out]#             2.37536137e-05, 2.05627184e-05, 1.94229745e-05, 1.62942794e-05,
#[Out]#             1.27708788e-05, 1.43191714e-05, 2.04687129e-05, 2.49112981e-05,
#[Out]#             2.05323344e-05, 1.98395439e-05, 8.51445637e-06, 1.85420481e-05,
#[Out]#             2.13946885e-05, 2.43120359e-05, 2.14181269e-05, 2.09126558e-05,
#[Out]#             1.99222195e-05, 2.02045874e-05, 1.92411835e-05, 2.06396611e-05,
#[Out]#             2.06176251e-05, 2.06877471e-05, 2.23390311e-05, 7.93434957e-06,
#[Out]#             1.02048907e-05, 1.66455311e-05, 9.28760208e-06, 2.00766671e-05,
#[Out]#             1.82987168e-05, 2.24343701e-05, 2.05555300e-05, 2.16407496e-05,
#[Out]#             2.43228559e-05, 2.05094859e-05, 2.39990672e-05, 2.18798146e-05,
#[Out]#             2.04364464e-05, 1.30549204e-05, 2.29802030e-05, 2.64362604e-05,
#[Out]#             2.06437080e-05, 2.66872847e-05, 2.21031942e-05, 2.11534922e-05,
#[Out]#             2.14465828e-05, 2.26220255e-05]>)
get_ipython().run_line_magic('pinfo2', 'coordinates.match_coordinates_sky')
get_ipython().run_line_magic('pinfo', 'coordinates.match_coordinates_sky')
match_index, match_distance, _ = coordinates.match_coordinates_sky(starfind_coords, table_coordinates)
pl.hist(match_distance)
pl.hist(match_distance.value)
#[Out]# (array([  3.,   4.,   7.,  11.,  25.,  65., 101.,  31.,   7.,   4.]),
#[Out]#  array([0.00013594, 0.00028549, 0.00043504, 0.00058459, 0.00073414,
#[Out]#         0.00088369, 0.00103324, 0.0011828 , 0.00133235, 0.0014819 ,
#[Out]#         0.00163145]),
#[Out]#  <BarContainer object of 10 artists>)
pl.hist(match_distance.to(u.arcsec).value)
#[Out]# (array([  3.,   4.,   7.,  11.,  25.,  65., 101.,  31.,   7.,   4.]),
#[Out]#  array([0.48936726, 1.02775296, 1.56613867, 2.10452438, 2.64291008,
#[Out]#         3.18129579, 3.7196815 , 4.2580672 , 4.79645291, 5.33483862,
#[Out]#         5.87322432]),
#[Out]#  <BarContainer object of 10 artists>)
new_sky_coordinates = table_coordinates[match_index]
new_sky_coordinates = table_coordinates[match_index]
new_sky_coordinates_xy = ww.wcs_world2pix(new_sky_coordinates.ra, new_sky_coordinates.dec, 0)
pl.figure(figsize=(12,12))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
pl.plot(starcat['xcentroid'], starcat['ycentroid'], 'wx')
pl.plot(new_sky_coordinates_xy[0], new_sky_coordinates_xy[1], 'rx')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
from astropy.wcs.utils import fit_wcs_from_points
xy_starfind = np.array([starcat['xcentroid'], starcat['ycentroid']])
new_wcs = fit_wcs_from_points(xy_starfind, new_sky_coordinates)
new_wcs
#[Out]# WCS Keywords
#[Out]# 
#[Out]# Number of WCS axes: 2
#[Out]# CTYPE : 'RA---TAN'  'DEC--TAN'  
#[Out]# CRVAL : 290.9206483159954  14.50622684857145  
#[Out]# CRPIX : 1050.2335442565818  1011.2758435872751  
#[Out]# CD1_1 CD1_2  : -5.329112537667141e-05  -4.220216562506491e-08  
#[Out]# CD2_1 CD2_2  : 3.0153818048798635e-08  -5.3283752963099265e-05  
#[Out]# NAXIS : 1994.1946006769244  2028.2073632349282
new_wcs = fit_wcs_from_points(xy_starfind, new_sky_coordinates, sip_degree=2)
new_wcs
#[Out]# WCS Keywords
#[Out]# 
#[Out]# Number of WCS axes: 2
#[Out]# CTYPE : 'RA---TAN-SIP'  'DEC--TAN-SIP'  
#[Out]# CRVAL : 290.9206483159954  14.50622684857145  
#[Out]# CRPIX : 1049.9433097196043  1010.5531366978405  
#[Out]# CD1_1 CD1_2  : -5.3295974630547286e-05  -7.0994239113834e-08  
#[Out]# CD2_1 CD2_2  : 2.700699761702411e-08  -5.3277872668169876e-05  
#[Out]# NAXIS : 1994.1946006769244  2028.2073632349282
new_wcs.sip
#[Out]# <astropy.wcs.Sip at 0x2ae848bf7b90>
new_wcs = fit_wcs_from_points(xy_starfind, new_sky_coordinates,)# sip_degree=2)
new_wcs
#[Out]# WCS Keywords
#[Out]# 
#[Out]# Number of WCS axes: 2
#[Out]# CTYPE : 'RA---TAN'  'DEC--TAN'  
#[Out]# CRVAL : 290.9206483159954  14.50622684857145  
#[Out]# CRPIX : 1050.2335442565818  1011.2758435872751  
#[Out]# CD1_1 CD1_2  : -5.329112537667141e-05  -4.220216562506491e-08  
#[Out]# CD2_1 CD2_2  : 3.0153818048798635e-08  -5.3283752963099265e-05  
#[Out]# NAXIS : 1994.1946006769244  2028.2073632349282
new_wcs = fit_wcs_from_points(xy_starfind, new_sky_coordinates, sip_degree=2)
new_wcs
#[Out]# WCS Keywords
#[Out]# 
#[Out]# Number of WCS axes: 2
#[Out]# CTYPE : 'RA---TAN-SIP'  'DEC--TAN-SIP'  
#[Out]# CRVAL : 290.9206483159954  14.50622684857145  
#[Out]# CRPIX : 1049.9433097196043  1010.5531366978405  
#[Out]# CD1_1 CD1_2  : -5.3295974630547286e-05  -7.0994239113834e-08  
#[Out]# CD2_1 CD2_2  : 2.700699761702411e-08  -5.3277872668169876e-05  
#[Out]# NAXIS : 1994.1946006769244  2028.2073632349282
new_ra, new_dec = new_wcs.wcs_pix2world(starcat['xcentroid'], starcat['ycentroid'], 0)
pl.plot(new_ra, new_sky_coordinates, 'x')
visualization.quantity_support()
#[Out]# <astropy.visualization.units.quantity_support.<locals>.MplQuantityConverter at 0x2ae848b78198>
pl.plot(new_ra, new_sky_coordinates, 'x')
pl.plot(new_ra, new_sky_coordinates.ra, 'x')
#[Out]# [<matplotlib.lines.Line2D at 0x2ae8489e74e0>]
pl.plot(new_ra, new_dec, 'x')
pl.plot(new_sky_coordinates.ra, new_sky_coordinates.dec, 'x')
#[Out]# [<matplotlib.lines.Line2D at 0x2ae84877f898>]
pl.plot(new_ra-new_sky_coordinates.ra, new_dec-new_sky_coordinates.de, 'x')
pl.plot(new_ra-new_sky_coordinates.ra, new_dec-new_sky_coordinates.dec, 'x')
new_ra, new_dec = new_wcs.wcs_pix2world(starcat['xcentroid'], starcat['ycentroid'], 0)*u.deg
pl.plot(new_ra-new_sky_coordinates.ra, new_dec-new_sky_coordinates.dec, 'x')
#[Out]# [<matplotlib.lines.Line2D at 0x2ae8468bbdd8>]
pl.plot(new_ra-new_sky_coordinates.ra.to(u.arcsec), new_dec-new_sky_coordinates.dec.to(u.arcsec), 'x')
#[Out]# [<matplotlib.lines.Line2D at 0x2ae848a6cf98>]
pl.plot((new_ra-new_sky_coordinates.ra).to(u.arcsec), (new_dec-new_sky_coordinates.dec).to(u.arcsec), 'x')
#[Out]# [<matplotlib.lines.Line2D at 0x2ae848a67d68>]
pl.figure(figsize=(24,24))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
pl.plot(starcat['xcentroid'], starcat['ycentroid'], 'wx')
pl.plot(new_sky_coordinates_xy[0], new_sky_coordinates_xy[1], 'rx')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
ra_residual = (new_ra-new_sky_coordinates.ra).to(u.arcsec)
dec_residual = (new_dec-new_sky_coordinates.dec).to(u.arcsec)
pl.plot(ra_residual, dec_residual, 'x')
#[Out]# [<matplotlib.lines.Line2D at 0x2ae84899bef0>]
bad_matches = (ra_residual < -2*u.arcsec) | (ra_residual > 2*u.arcsec) | (dec_residual > 1*u.arcsec)
bad_matches.sum(), len(bad_matches)
#[Out]# (58, 258)
True or False
#[Out]# True
x = np.array([True, False])
x or x
x = np.array([True, False])
x | x
#[Out]# array([ True, False])
x = np.array([True, False])
x &x
#[Out]# array([ True, False])
x = np.array([True, False])
x ^ x
#[Out]# array([False, False])
new_wcs2 = fit_wcs_from_points(xy_starfind[~bad_matches], new_sky_coordinates[~bad_matches], sip_degree=2)
xy_starfind.shape
#[Out]# (2, 258)
new_wcs2 = fit_wcs_from_points(xy_starfind[:,~bad_matches], new_sky_coordinates[:,~bad_matches], sip_degree=2)
xy_starfind2 = xy_starfind.T[~bad_matches].T
new_sky_coordinates2 = new_sky_coordinates.T[~bad_matches].T
new_wcs2 = fit_wcs_from_points(xy_starfind2, new_sky_coordinates2, sip_degree=2)
xy_starfind.T.shape
#[Out]# (258, 2)
xy_starfind.T.T.shape
#[Out]# (2, 258)
new_ra2, new_dec2 = new_wcs2.wcs_pix2world(starcat['xcentroid'], starcat['ycentroid'], 0)*u.deg
ra_residual2 = (new_ra2-new_sky_coordinates.ra).to(u.arcsec)
dec_residual2 = (new_dec2-new_sky_coordinates.dec).to(u.arcsec)
pl.plot(ra_residual2, dec_residual2, 'x')
#[Out]# [<matplotlib.lines.Line2D at 0x2ae848b7ce10>]
ra_residual = (new_ra-new_sky_coordinates.ra).to(u.arcsec)
dec_residual = (new_dec-new_sky_coordinates.dec).to(u.arcsec)
pl.plot(ra_residual, dec_residual, 'x')
pl.grid()
ra_residual2 = (new_ra2-new_sky_coordinates.ra).to(u.arcsec)
dec_residual2 = (new_dec2-new_sky_coordinates.dec).to(u.arcsec)
pl.plot(ra_residual2, dec_residual2, 'x')
pl.grid()
pl.figure(figsize=(24,24))
ax = pl.subplot(projection=new_wcs2)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
pl.plot(starcat['xcentroid'], starcat['ycentroid'], 'wx')
pl.plot(table_coordinates.ra[brightstars],
        table_coordinates.dec[brightstars],
        transform=ax.get_transform('world'), marker='x', color='r', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
pl.figure(figsize=(24,24))
ax = pl.subplot(projection=new_wcs2)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
pl.plot(starcat['xcentroid'], starcat['ycentroid'], 'wx')
pl.plot(table_coordinates.ra,
        table_coordinates.dec,
        transform=ax.get_transform('world'), marker='x', color='r', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
xy_starfind2 = xy_starfind.T[~bad_matches].T
new_sky_coordinates2 = new_sky_coordinates.T[~bad_matches].T
new_wcs2 = fit_wcs_from_points(xy_starfind2, new_sky_coordinates2, sip_degree=5)
new_ra2, new_dec2 = new_wcs2.wcs_pix2world(starcat['xcentroid'], starcat['ycentroid'], 0)*u.deg
ra_residual2 = (new_ra2-new_sky_coordinates.ra).to(u.arcsec)
dec_residual2 = (new_dec2-new_sky_coordinates.dec).to(u.arcsec)
pl.plot(ra_residual2, dec_residual2, 'x')
pl.grid()
pl.figure(figsize=(24,24))
ax = pl.subplot(projection=new_wcs2)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
pl.plot(starcat['xcentroid'], starcat['ycentroid'], 'wx')
pl.plot(table_coordinates.ra,
        table_coordinates.dec,
        transform=ax.get_transform('world'), marker='x', color='r', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
import reproject
new_image = reproject.repoject_exact
get_ipython().set_next_input('new_image = reproject.reproject_exact');get_ipython().run_line_magic('pinfo', 'reproject.reproject_exact')
new_wcs2
#[Out]# WCS Keywords
#[Out]# 
#[Out]# Number of WCS axes: 2
#[Out]# CTYPE : 'RA---TAN-SIP'  'DEC--TAN-SIP'  
#[Out]# CRVAL : 290.92064831525624  14.506229848572652  
#[Out]# CRPIX : 1048.3560119416313  1015.8891118464609  
#[Out]# CD1_1 CD1_2  : -5.4008453032403673e-05  -5.783228490246018e-08  
#[Out]# CD2_1 CD2_2  : 1.9465163085037762e-08  -5.401767724807172e-05  
#[Out]# NAXIS : 1994.1946006769244  2028.2073632349282
len(files)
#[Out]# 234
ra_residual2 = (new_ra2-new_sky_coordinates.ra).to(u.arcsec)
dec_residual2 = (new_dec2-new_sky_coordinates.dec).to(u.arcsec)
pl.quiver((new_ra2, new_dec2), (ra_residual2, dec_residual2))
#[Out]# <matplotlib.quiver.Quiver at 0x2ae84a145c50>
new_ra2
#[Out]# <Quantity [290.96308315, 290.90634042, 290.94023489, 290.88801967,
#[Out]#            290.92031615, 290.88654442, 290.88618886, 290.89163477,
#[Out]#            290.90773182, 290.87647373, 290.92754199, 290.96272273,
#[Out]#            290.89062306, 290.89064614, 290.97497186, 290.89081603,
#[Out]#            290.9597058 , 290.95972905, 290.92970228, 290.90130638,
#[Out]#            290.97564815, 290.96087382, 290.87203084, 290.88556978,
#[Out]#            290.96107983, 290.88557953, 290.96089104, 290.87440613,
#[Out]#            290.88560532, 290.96101139, 290.96884522, 290.94248228,
#[Out]#            290.94244865, 290.94249251, 290.94065171, 290.90529676,
#[Out]#            290.88800299, 290.8879891 , 290.88888853, 290.88805654,
#[Out]#            290.884401  , 290.94366613, 290.95161163, 290.94728385,
#[Out]#            290.8814737 , 290.9512186 , 290.93078486, 290.86853516,
#[Out]#            290.91160252, 290.91753835, 290.90876157, 290.92482579,
#[Out]#            290.89449602, 290.90966708, 290.9360319 , 290.94753637,
#[Out]#            290.88482919, 290.97041991, 290.88691936, 290.86965521,
#[Out]#            290.87263671, 290.92551444, 290.92872264, 290.90404712,
#[Out]#            290.95738892, 290.90655224, 290.94991715, 290.90427704,
#[Out]#            290.96179229, 290.93126202, 290.90958919, 290.87303041,
#[Out]#            290.92996189, 290.93970226, 290.92813035, 290.87438153,
#[Out]#            290.94384103, 290.8701087 , 290.94533291, 290.96674387,
#[Out]#            290.96674752, 290.88071683, 290.9569903 , 290.87896098,
#[Out]#            290.92187681, 290.94563512, 290.93675742, 290.91308909,
#[Out]#            290.91559916, 290.91751481, 290.87680946, 290.9620685 ,
#[Out]#            290.9445552 , 290.91764317, 290.9444524 , 290.94459606,
#[Out]#            290.95633093, 290.91568922, 290.95321249, 290.92732737,
#[Out]#            290.94850275, 290.94409399, 290.93949117, 290.94273754,
#[Out]#            290.94262647, 290.94275757, 290.92779369, 290.88818433,
#[Out]#            290.88050168, 290.90509314, 290.91020197, 290.88490389,
#[Out]#            290.94421547, 290.9437818 , 290.88544675, 290.88216789,
#[Out]#            290.96532927, 290.90541612, 290.90524113, 290.90541652,
#[Out]#            290.90543747, 290.89060157, 290.92643831, 290.89270286,
#[Out]#            290.90581238, 290.89267376, 290.89324231, 290.8784474 ,
#[Out]#            290.91673415, 290.90455858, 290.93511836, 290.90925972,
#[Out]#            290.96613266, 290.95996425, 290.89301448, 290.93074429,
#[Out]#            290.93128505, 290.9110385 , 290.97101902, 290.96817007,
#[Out]#            290.97618951, 290.92876496, 290.91832925, 290.88513369,
#[Out]#            290.86499664, 290.91048204, 290.89306547, 290.92701468,
#[Out]#            290.86928042, 290.86710573, 290.95121949, 290.91968109,
#[Out]#            290.88561184, 290.9317985 , 290.90932472, 290.92504128,
#[Out]#            290.88352759, 290.88353824, 290.9680649 , 290.89271131,
#[Out]#            290.93574466, 290.93155856, 290.8966795 , 290.93229927,
#[Out]#            290.93480537, 290.97079048, 290.94804149, 290.88053086,
#[Out]#            290.88174346, 290.91458103, 290.90476903, 290.9146003 ,
#[Out]#            290.89481481, 290.88612762, 290.95232307, 290.90491989,
#[Out]#            290.89490521, 290.92744698, 290.92732604, 290.87633367,
#[Out]#            290.93543592, 290.92187088, 290.90386281, 290.9202702 ,
#[Out]#            290.92771102, 290.9481126 , 290.92773399, 290.87788878,
#[Out]#            290.94522343, 290.88779409, 290.87867797, 290.91162326,
#[Out]#            290.87825911, 290.86950624, 290.94747657, 290.94739473,
#[Out]#            290.88656049, 290.9598781 , 290.90403063, 290.94685573,
#[Out]#            290.94685392, 290.89036688, 290.92053515, 290.93818662,
#[Out]#            290.91371149, 290.87974215, 290.90478842, 290.868142  ,
#[Out]#            290.93860547, 290.93127468, 290.89180352, 290.882724  ,
#[Out]#            290.96738518, 290.92234169, 290.8767134 , 290.88608151,
#[Out]#            290.86789863, 290.86776365, 290.91375768, 290.97300291,
#[Out]#            290.95052677, 290.89815713, 290.9166923 , 290.8880231 ,
#[Out]#            290.88810508, 290.88795337, 290.93469981, 290.92740592,
#[Out]#            290.87630253, 290.90446367, 290.91355586, 290.91355368,
#[Out]#            290.9135511 , 290.91355838, 290.9467593 , 290.8865567 ,
#[Out]#            290.88532815, 290.91798541, 290.88649909, 290.90545827,
#[Out]#            290.89808889, 290.89833886, 290.88569764, 290.92955842,
#[Out]#            290.89814549, 290.88957445, 290.954688  , 290.97040704,
#[Out]#            290.89280187, 290.87203866, 290.94033714, 290.97534397,
#[Out]#            290.93254359, 290.97532658, 290.86710769, 290.87954179,
#[Out]#            290.90434681, 290.87188246] deg>
pl.quiver((starcat['xcentroid'], starcat['ycentroid']), (ra_residual2, dec_residual2))
#[Out]# <matplotlib.quiver.Quiver at 0x2ae84a167f28>
pl.quiver(starcat['xcentroid'], starcat['ycentroid'], ra_residual2, dec_residual2)
#[Out]# <matplotlib.quiver.Quiver at 0x2ae84a1f40b8>
ra_residual2 = (new_ra2-new_sky_coordinates.ra).to(u.arcsec)
dec_residual2 = (new_dec2-new_sky_coordinates.dec).to(u.arcsec)
pl.quiver(new_ra2, new_dec2, ra_residual2, dec_residual2)
#[Out]# <matplotlib.quiver.Quiver at 0x2ae84a3eb0f0>
ra_residual2 = (new_ra2-new_sky_coordinates.ra).to(u.arcsec)
dec_residual2 = (new_dec2-new_sky_coordinates.dec).to(u.arcsec)
pl.quiver(X=new_ra2, Y=new_dec2, U=ra_residual2, V=dec_residual2)
ra_residual2 = (new_ra2-new_sky_coordinates.ra).to(u.arcsec)
dec_residual2 = (new_dec2-new_sky_coordinates.dec).to(u.arcsec)
pl.quiver(X=new_ra2, Y=new_dec2, U=ra_residual2.value, V=dec_residual2.value)
ra_residual2 = (new_ra2-new_sky_coordinates.ra).to(u.arcsec)
dec_residual2 = (new_dec2-new_sky_coordinates.dec).to(u.arcsec)
pl.quiver(X=new_ra2.value, Y=new_dec2, U=ra_residual2.value, V=dec_residual2.value)
ra_residual2 = (new_ra2-new_sky_coordinates.ra).to(u.arcsec)
dec_residual2 = (new_dec2-new_sky_coordinates.dec).to(u.arcsec)
pl.quiver(X=new_ra2.value, Y=new_dec2.value, U=ra_residual2.value, V=dec_residual2.value)
get_ipython().run_line_magic('pinfo', 'pl.quiver')
ra_residual2 = (new_ra2-new_sky_coordinates.ra).to(u.arcsec)
dec_residual2 = (new_dec2-new_sky_coordinates.dec).to(u.arcsec)
pl.quiver(new_ra2.value, new_dec2.value, ra_residual2.value, dec_residual2.value)
#[Out]# <matplotlib.quiver.Quiver at 0x2ae84a596208>
pl.quiver(starcat['xcentroid'], starcat['ycentroid'], ra_residual2.value, dec_residual2.value)
#[Out]# <matplotlib.quiver.Quiver at 0x2ae84a49d9b0>
pl.quiver(starcat['xcentroid'], starcat['ycentroid'], ra_residual2.value, dec_residual2.value, 'w')
pl.quiver(starcat['xcentroid'], starcat['ycentroid'], ra_residual2.value, dec_residual2.value, C='w')
pl.quiver(starcat['xcentroid'], starcat['ycentroid'], ra_residual2.value, dec_residual2.value, color='w')
#[Out]# <matplotlib.quiver.Quiver at 0x2ae849ad6358>
ygrid, xgrid = np.mgrid[0:2048:64, 0:2048:64]

pl.quiver(starcat['xcentroid'], starcat['ycentroid'], ra_residual2.value, dec_residual2.value, color='w')
#[Out]# <matplotlib.quiver.Quiver at 0x2ae84990b710>
ygrid, xgrid = np.mgrid[0:2048:64, 0:2048:64]

pl.quiver(table_coordinates['ra'], table_coordinates['dec'], ra_residual2.value, dec_residual2.value, color='w')
ygrid, xgrid = np.mgrid[0:2048:64, 0:2048:64]

pl.quiver(new_ra.value, new_dec.value, ra_residual2.value, dec_residual2.value, color='w')
#[Out]# <matplotlib.quiver.Quiver at 0x2ae848c3b048>
pl.quiver(new_ra.value, new_dec.value, ra_residual2.value, dec_residual2.value, color='w')
pl.quiver(new_ra.value[bad_matches], new_dec.value[bad_matches], ra_residual2.value[bad_matches], dec_residual2.value[bad_matches], color='r')
#[Out]# <matplotlib.quiver.Quiver at 0x2ae85006d748>
#pl.quiver(new_ra.value, new_dec.value, ra_residual2.value, dec_residual2.value, color='w')
pl.quiver(new_ra.value[bad_matches], new_dec.value[bad_matches], ra_residual2.value[bad_matches], dec_residual2.value[bad_matches], color='r')
pl.quiver(new_ra.value[~bad_matches], new_dec.value[~bad_matches], ra_residual2.value[~bad_matches], dec_residual2.value[~bad_matches], color='w')
#[Out]# <matplotlib.quiver.Quiver at 0x2ae84fa1ff60>
ygrid, xgrid = np.mgrid[0:2048:64, 0:2048:64]
r1,d1 = ww.wcs_pix2world(xgrid, ygrid, 0)
r2,d2 = new_wcs2.wcs_pix2world(xgrid, ygrid, 0)
pl.quiver(r1-r2, d1-d2, color='w')
#[Out]# <matplotlib.quiver.Quiver at 0x2ae84fdc0278>
ygrid, xgrid = np.mgrid[0:2048:64, 0:2048:64]
r1,d1 = ww.wcs_pix2world(xgrid, ygrid, 0)
r2,d2 = new_wcs2.wcs_pix2world(xgrid, ygrid, 0)
pl.quiver(xgrid, ygrid, r1-r2, d1-d2, color='w')
#[Out]# <matplotlib.quiver.Quiver at 0x2ae84ffbdc50>
ygrid, xgrid = np.mgrid[0:2048:128, 0:2048:128]
r1,d1 = ww.wcs_pix2world(xgrid, ygrid, 0)
r2,d2 = new_wcs2.wcs_pix2world(xgrid, ygrid, 0)
pl.quiver(xgrid, ygrid, r1-r2, d1-d2, color='w')
#[Out]# <matplotlib.quiver.Quiver at 0x2ae8502c8cf8>
#pl.quiver(new_ra.value, new_dec.value, ra_residual2.value, dec_residual2.value, color='w')
pl.quiver(new_ra.value[bad_matches], new_dec.value[bad_matches], ra_residual2.value[bad_matches], dec_residual2.value[bad_matches], color='r')
pl.quiver(new_ra.value[~bad_matches], new_dec.value[~bad_matches], ra_residual2.value[~bad_matches], dec_residual2.value[~bad_matches], color='w')
#[Out]# <matplotlib.quiver.Quiver at 0x2ae850227be0>
ygrid, xgrid = np.mgrid[0:2048:128, 0:2048:128]
r1,d1 = ww.wcs_pix2world(xgrid, ygrid, 0)
r2,d2 = new_wcs2.all_pix2world(xgrid, ygrid, 0)
pl.quiver(xgrid, ygrid, r1-r2, d1-d2, color='w')
#[Out]# <matplotlib.quiver.Quiver at 0x2ae850331278>
ygrid, xgrid = np.mgrid[0:2048:128, 0:2048:128]
r1,d1 = ww.all_pix2world(xgrid, ygrid, 0)
r2,d2 = new_wcs2.all_pix2world(xgrid, ygrid, 0)
pl.quiver(xgrid, ygrid, r1-r2, d1-d2, color='w')
#[Out]# <matplotlib.quiver.Quiver at 0x2ae850358828>
ygrid, xgrid = np.mgrid[0:2048:128, 0:2048:128]
x1,y1 = ww.sip_pix2foc(xgrid, ygrid, 0)
x2,y2 = new_wcs2.sip_pix2foc(xgrid, ygrid, 0)
pl.quiver(xgrid, ygrid, x1-x2, y1-y2, color='w')
#[Out]# <matplotlib.quiver.Quiver at 0x2ae84fc46e48>
x1
#[Out]# array([[   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#         1408, 1536, 1664, 1792, 1920],
#[Out]#        [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#         1408, 1536, 1664, 1792, 1920],
#[Out]#        [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#         1408, 1536, 1664, 1792, 1920],
#[Out]#        [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#         1408, 1536, 1664, 1792, 1920],
#[Out]#        [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#         1408, 1536, 1664, 1792, 1920],
#[Out]#        [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#         1408, 1536, 1664, 1792, 1920],
#[Out]#        [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#         1408, 1536, 1664, 1792, 1920],
#[Out]#        [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#         1408, 1536, 1664, 1792, 1920],
#[Out]#        [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#         1408, 1536, 1664, 1792, 1920],
#[Out]#        [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#         1408, 1536, 1664, 1792, 1920],
#[Out]#        [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#         1408, 1536, 1664, 1792, 1920],
#[Out]#        [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#         1408, 1536, 1664, 1792, 1920],
#[Out]#        [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#         1408, 1536, 1664, 1792, 1920],
#[Out]#        [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#         1408, 1536, 1664, 1792, 1920],
#[Out]#        [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#         1408, 1536, 1664, 1792, 1920],
#[Out]#        [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#         1408, 1536, 1664, 1792, 1920]])
x2
#[Out]# array([[-1016.12890911,  -894.56654009,  -772.02555927,  -648.62147854,
#[Out]#          -524.47620791,  -399.71703785,  -274.4756215 ,  -148.88695699,
#[Out]#           -23.08836967,   102.7815056 ,   228.58374217,   354.18013936,
#[Out]#           479.43424019,   604.21234908,   728.3845496 ,   851.8257222 ],
#[Out]#        [-1020.49529203,  -898.53601129,  -775.57457653,  -651.7300975 ,
#[Out]#          -527.12854462,  -401.90173132,  -276.18629628,  -150.1226857 ,
#[Out]#           -23.85413559,   102.47434598,   228.71699664,   354.72831736,
#[Out]#           480.36409029,   605.48239641,   729.94463331,   853.61653287],
#[Out]#        [-1024.07323308,  -901.77655074,  -778.45405651,  -654.22811683,
#[Out]#          -529.22842144,  -403.59096561,  -277.45703243,  -150.97217506,
#[Out]#           -24.28519903,   102.45285551,   229.08973153,   355.47297283,
#[Out]#           481.45094178,   606.87383707,   731.59471139,   855.47048921],
#[Out]#        [-1026.94327838,  -904.36990795,  -780.74730809,  -656.20076085,
#[Out]#          -530.86333413,  -404.87486393,  -278.38093663,  -151.53187125,
#[Out]#           -24.4817017 ,   102.6128409 ,   229.59334599,   356.30074131,
#[Out]#           482.57631059,   608.26271132,   733.20499244,   857.25161211],
#[Out]#        [-1029.1748827 ,  -906.38609629,  -782.52525927,  -657.7202282 ,
#[Out]#          -532.10710801,  -405.82923431,  -279.03615566,  -151.88261579,
#[Out]#           -24.5275359 ,   102.86700305,   230.13677811,   357.11644205,
#[Out]#           483.64054109,   609.54453264,   734.66580302,   858.8446852 ],
#[Out]#        [-1030.82717797,  -907.88416155,  -783.84722573,  -658.84646045,
#[Out]#          -533.02066657,  -406.5163382 ,  -279.48664493,  -152.09041408,
#[Out]#           -24.49111305,   103.14416851,   230.64573636,   357.84230943,
#[Out]#           484.56203755,   610.63351918,   735.88681912,   860.15448627],
#[Out]#        [-1031.94974191,  -908.91295053,  -784.7616794 ,  -659.62791068,
#[Out]#          -533.65280007,  -406.98565902,  -279.78293707,  -152.20720402,
#[Out]#           -24.42613229,   103.38852084,   231.061931  ,   358.41722438,
#[Out]#           485.27649555,   611.46182512,   736.79629752,   861.10501869],
#[Out]#        [-1032.58336657,  -909.51187962,  -785.307017  ,  -660.10231201,
#[Out]#          -534.04093403,  -407.27467076,  -279.96291052,  -152.2716245 ,
#[Out]#           -24.37234905,   103.5588321 ,   231.34230552,   358.79594582,
#[Out]#           485.73613339,   611.97877216,   737.34030727,   861.63874284],
#[Out]#        [-1032.76082688,  -909.71170336,  -785.5123287 ,  -660.29744623,
#[Out]#          -534.21189789,  -407.40960651,  -280.0525581 ,  -152.30978408,
#[Out]#           -24.35634361,   103.62769423,   231.45826807,   358.94834207,
#[Out]#           485.90892358,   612.15008093,   737.4819611 ,   861.71580752],
#[Out]#        [-1032.5076493 ,  -909.53528301,  -785.39816662,  -660.23191234,
#[Out]#          -534.18269355,  -407.4062271 ,  -280.06675556,  -152.33602948,
#[Out]#           -24.39228969,   103.58075048,   231.39492288,   358.8586223 ,
#[Out]#           485.77782418,   611.95710237,   737.20064685,   861.31328142],
#[Out]#        [-1031.84288033,  -908.99835516,  -784.97731342,  -659.9158951 ,
#[Out]#          -533.96126393,  -407.27058962,  -280.01003019,  -152.3537142 ,
#[Out]#           -24.48272302,   103.41592688,   231.15030168,   358.52456793,
#[Out]#           485.34001028,   611.39604924,   736.49125886,   860.42438449],
#[Out]#        [-1030.77985511,  -908.11030024,  -784.25555089,  -659.35193369,
#[Out]#          -533.54726157,  -406.99981602,  -279.87732937,  -152.35596706,
#[Out]#           -24.61930992,   103.1426636 ,   230.73459511,   357.95676406,
#[Out]#           484.60610542,   610.47722747,   735.36342946,   859.05771941],
#[Out]#        [-1029.32696599,  -906.87491118,  -783.23242853,  -658.53569019,
#[Out]#          -532.93281719,  -406.58286166,  -279.65478914,  -152.32646083,
#[Out]#           -24.78361586,   102.78114642,   230.16938419,   357.17783091,
#[Out]#           483.59941299,   609.2242676 ,   733.84076034,   857.23650297],
#[Out]#        [-1027.4884311 ,  -905.2911619 ,  -781.90203208,  -657.45671822,
#[Out]#          -532.10330828,  -406.00128393,  -279.3205028 ,  -152.24018073,
#[Out]#           -24.94787405,   102.36153815,   229.48687172,   356.22165523,
#[Out]#           482.35514769,   607.67335626,   731.96005399,   854.99779755],
#[Out]#        [-1025.26506292,  -903.35397594,  -780.25375216,  -656.09923146,
#[Out]#          -531.03812764,  -405.23001079,  -278.84528948,  -152.06419307,
#[Out]#           -25.07575399,   101.92321003,   228.72911367,   355.13262174,
#[Out]#           480.91966693,   605.87246753,   729.77054515,   852.3917425 ],
#[Out]#        [-1022.65503689,  -901.05499501,  -778.2730528 ,  -654.44287228,
#[Out]#          -529.711452  ,  -404.23810932,  -278.19346267,  -151.7584138 ,
#[Out]#           -25.12313009,   101.51397321,   227.94725069,   353.96484454,
#[Out]#           479.34970226,   603.88059437,   727.33313221,   849.48078558]])
x1-x2
#[Out]# array([[1016.12890911, 1022.56654009, 1028.02555927, 1032.62147854,
#[Out]#         1036.47620791, 1039.71703785, 1042.4756215 , 1044.88695699,
#[Out]#         1047.08836967, 1049.2184944 , 1051.41625783, 1053.81986064,
#[Out]#         1056.56575981, 1059.78765092, 1063.6154504 , 1068.1742778 ],
#[Out]#        [1020.49529203, 1026.53601129, 1031.57457653, 1035.7300975 ,
#[Out]#         1039.12854462, 1041.90173132, 1044.18629628, 1046.1226857 ,
#[Out]#         1047.85413559, 1049.52565402, 1051.28300336, 1053.27168264,
#[Out]#         1055.63590971, 1058.51760359, 1062.05536669, 1066.38346713],
#[Out]#        [1024.07323308, 1029.77655074, 1034.45405651, 1038.22811683,
#[Out]#         1041.22842144, 1043.59096561, 1045.45703243, 1046.97217506,
#[Out]#         1048.28519903, 1049.54714449, 1050.91026847, 1052.52702717,
#[Out]#         1054.54905822, 1057.12616293, 1060.40528861, 1064.52951079],
#[Out]#        [1026.94327838, 1032.36990795, 1036.74730809, 1040.20076085,
#[Out]#         1042.86333413, 1044.87486393, 1046.38093663, 1047.53187125,
#[Out]#         1048.4817017 , 1049.3871591 , 1050.40665401, 1051.69925869,
#[Out]#         1053.42368941, 1055.73728868, 1058.79500756, 1062.74838789],
#[Out]#        [1029.1748827 , 1034.38609629, 1038.52525927, 1041.7202282 ,
#[Out]#         1044.10710801, 1045.82923431, 1047.03615566, 1047.88261579,
#[Out]#         1048.5275359 , 1049.13299695, 1049.86322189, 1050.88355795,
#[Out]#         1052.35945891, 1054.45546736, 1057.33419698, 1061.1553148 ],
#[Out]#        [1030.82717797, 1035.88416155, 1039.84722573, 1042.84646045,
#[Out]#         1045.02066657, 1046.5163382 , 1047.48664493, 1048.09041408,
#[Out]#         1048.49111305, 1048.85583149, 1049.35426364, 1050.15769057,
#[Out]#         1051.43796245, 1053.36648082, 1056.11318088, 1059.84551373],
#[Out]#        [1031.94974191, 1036.91295053, 1040.7616794 , 1043.62791068,
#[Out]#         1045.65280007, 1046.98565902, 1047.78293707, 1048.20720402,
#[Out]#         1048.42613229, 1048.61147916, 1048.938069  , 1049.58277562,
#[Out]#         1050.72350445, 1052.53817488, 1055.20370248, 1058.89498131],
#[Out]#        [1032.58336657, 1037.51187962, 1041.307017  , 1044.10231201,
#[Out]#         1046.04093403, 1047.27467076, 1047.96291052, 1048.2716245 ,
#[Out]#         1048.37234905, 1048.4411679 , 1048.65769448, 1049.20405418,
#[Out]#         1050.26386661, 1052.02122784, 1054.65969273, 1058.36125716],
#[Out]#        [1032.76082688, 1037.71170336, 1041.5123287 , 1044.29744623,
#[Out]#         1046.21189789, 1047.40960651, 1048.0525581 , 1048.30978408,
#[Out]#         1048.35634361, 1048.37230577, 1048.54173193, 1049.05165793,
#[Out]#         1050.09107642, 1051.84991907, 1054.5180389 , 1058.28419248],
#[Out]#        [1032.5076493 , 1037.53528301, 1041.39816662, 1044.23191234,
#[Out]#         1046.18269355, 1047.4062271 , 1048.06675556, 1048.33602948,
#[Out]#         1048.39228969, 1048.41924952, 1048.60507712, 1049.1413777 ,
#[Out]#         1050.22217582, 1052.04289763, 1054.79935315, 1058.68671858],
#[Out]#        [1031.84288033, 1036.99835516, 1040.97731342, 1043.9158951 ,
#[Out]#         1045.96126393, 1047.27058962, 1048.01003019, 1048.3537142 ,
#[Out]#         1048.48272302, 1048.58407312, 1048.84969832, 1049.47543207,
#[Out]#         1050.65998972, 1052.60395076, 1055.50874114, 1059.57561551],
#[Out]#        [1030.77985511, 1036.11030024, 1040.25555089, 1043.35193369,
#[Out]#         1045.54726157, 1046.99981602, 1047.87732937, 1048.35596706,
#[Out]#         1048.61930992, 1048.8573364 , 1049.26540489, 1050.04323594,
#[Out]#         1051.39389458, 1053.52277253, 1056.63657054, 1060.94228059],
#[Out]#        [1029.32696599, 1034.87491118, 1039.23242853, 1042.53569019,
#[Out]#         1044.93281719, 1046.58286166, 1047.65478914, 1048.32646083,
#[Out]#         1048.78361586, 1049.21885358, 1049.83061581, 1050.82216909,
#[Out]#         1052.40058701, 1054.7757324 , 1058.15923966, 1062.76349703],
#[Out]#        [1027.4884311 , 1033.2911619 , 1037.90203208, 1041.45671822,
#[Out]#         1044.10330828, 1046.00128393, 1047.3205028 , 1048.24018073,
#[Out]#         1048.94787405, 1049.63846185, 1050.51312828, 1051.77834477,
#[Out]#         1053.64485231, 1056.32664374, 1060.03994601, 1065.00220245],
#[Out]#        [1025.26506292, 1031.35397594, 1036.25375216, 1040.09923146,
#[Out]#         1043.03812764, 1045.23001079, 1046.84528948, 1048.06419307,
#[Out]#         1049.07575399, 1050.07678997, 1051.27088633, 1052.86737826,
#[Out]#         1055.08033307, 1058.12753247, 1062.22945485, 1067.6082575 ],
#[Out]#        [1022.65503689, 1029.05499501, 1034.2730528 , 1038.44287228,
#[Out]#         1041.711452  , 1044.23810932, 1046.19346267, 1047.7584138 ,
#[Out]#         1049.12313009, 1050.48602679, 1052.05274931, 1054.03515546,
#[Out]#         1056.65029774, 1060.11940563, 1064.66686779, 1070.51921442]])
(x1-x2).mean()
#[Out]# 1046.9636923156706
x1,x2
#[Out]# (array([[   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#          1408, 1536, 1664, 1792, 1920],
#[Out]#         [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#          1408, 1536, 1664, 1792, 1920],
#[Out]#         [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#          1408, 1536, 1664, 1792, 1920],
#[Out]#         [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#          1408, 1536, 1664, 1792, 1920],
#[Out]#         [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#          1408, 1536, 1664, 1792, 1920],
#[Out]#         [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#          1408, 1536, 1664, 1792, 1920],
#[Out]#         [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#          1408, 1536, 1664, 1792, 1920],
#[Out]#         [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#          1408, 1536, 1664, 1792, 1920],
#[Out]#         [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#          1408, 1536, 1664, 1792, 1920],
#[Out]#         [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#          1408, 1536, 1664, 1792, 1920],
#[Out]#         [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#          1408, 1536, 1664, 1792, 1920],
#[Out]#         [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#          1408, 1536, 1664, 1792, 1920],
#[Out]#         [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#          1408, 1536, 1664, 1792, 1920],
#[Out]#         [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#          1408, 1536, 1664, 1792, 1920],
#[Out]#         [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#          1408, 1536, 1664, 1792, 1920],
#[Out]#         [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#          1408, 1536, 1664, 1792, 1920]]),
#[Out]#  array([[-1016.12890911,  -894.56654009,  -772.02555927,  -648.62147854,
#[Out]#           -524.47620791,  -399.71703785,  -274.4756215 ,  -148.88695699,
#[Out]#            -23.08836967,   102.7815056 ,   228.58374217,   354.18013936,
#[Out]#            479.43424019,   604.21234908,   728.3845496 ,   851.8257222 ],
#[Out]#         [-1020.49529203,  -898.53601129,  -775.57457653,  -651.7300975 ,
#[Out]#           -527.12854462,  -401.90173132,  -276.18629628,  -150.1226857 ,
#[Out]#            -23.85413559,   102.47434598,   228.71699664,   354.72831736,
#[Out]#            480.36409029,   605.48239641,   729.94463331,   853.61653287],
#[Out]#         [-1024.07323308,  -901.77655074,  -778.45405651,  -654.22811683,
#[Out]#           -529.22842144,  -403.59096561,  -277.45703243,  -150.97217506,
#[Out]#            -24.28519903,   102.45285551,   229.08973153,   355.47297283,
#[Out]#            481.45094178,   606.87383707,   731.59471139,   855.47048921],
#[Out]#         [-1026.94327838,  -904.36990795,  -780.74730809,  -656.20076085,
#[Out]#           -530.86333413,  -404.87486393,  -278.38093663,  -151.53187125,
#[Out]#            -24.4817017 ,   102.6128409 ,   229.59334599,   356.30074131,
#[Out]#            482.57631059,   608.26271132,   733.20499244,   857.25161211],
#[Out]#         [-1029.1748827 ,  -906.38609629,  -782.52525927,  -657.7202282 ,
#[Out]#           -532.10710801,  -405.82923431,  -279.03615566,  -151.88261579,
#[Out]#            -24.5275359 ,   102.86700305,   230.13677811,   357.11644205,
#[Out]#            483.64054109,   609.54453264,   734.66580302,   858.8446852 ],
#[Out]#         [-1030.82717797,  -907.88416155,  -783.84722573,  -658.84646045,
#[Out]#           -533.02066657,  -406.5163382 ,  -279.48664493,  -152.09041408,
#[Out]#            -24.49111305,   103.14416851,   230.64573636,   357.84230943,
#[Out]#            484.56203755,   610.63351918,   735.88681912,   860.15448627],
#[Out]#         [-1031.94974191,  -908.91295053,  -784.7616794 ,  -659.62791068,
#[Out]#           -533.65280007,  -406.98565902,  -279.78293707,  -152.20720402,
#[Out]#            -24.42613229,   103.38852084,   231.061931  ,   358.41722438,
#[Out]#            485.27649555,   611.46182512,   736.79629752,   861.10501869],
#[Out]#         [-1032.58336657,  -909.51187962,  -785.307017  ,  -660.10231201,
#[Out]#           -534.04093403,  -407.27467076,  -279.96291052,  -152.2716245 ,
#[Out]#            -24.37234905,   103.5588321 ,   231.34230552,   358.79594582,
#[Out]#            485.73613339,   611.97877216,   737.34030727,   861.63874284],
#[Out]#         [-1032.76082688,  -909.71170336,  -785.5123287 ,  -660.29744623,
#[Out]#           -534.21189789,  -407.40960651,  -280.0525581 ,  -152.30978408,
#[Out]#            -24.35634361,   103.62769423,   231.45826807,   358.94834207,
#[Out]#            485.90892358,   612.15008093,   737.4819611 ,   861.71580752],
#[Out]#         [-1032.5076493 ,  -909.53528301,  -785.39816662,  -660.23191234,
#[Out]#           -534.18269355,  -407.4062271 ,  -280.06675556,  -152.33602948,
#[Out]#            -24.39228969,   103.58075048,   231.39492288,   358.8586223 ,
#[Out]#            485.77782418,   611.95710237,   737.20064685,   861.31328142],
#[Out]#         [-1031.84288033,  -908.99835516,  -784.97731342,  -659.9158951 ,
#[Out]#           -533.96126393,  -407.27058962,  -280.01003019,  -152.3537142 ,
#[Out]#            -24.48272302,   103.41592688,   231.15030168,   358.52456793,
#[Out]#            485.34001028,   611.39604924,   736.49125886,   860.42438449],
#[Out]#         [-1030.77985511,  -908.11030024,  -784.25555089,  -659.35193369,
#[Out]#           -533.54726157,  -406.99981602,  -279.87732937,  -152.35596706,
#[Out]#            -24.61930992,   103.1426636 ,   230.73459511,   357.95676406,
#[Out]#            484.60610542,   610.47722747,   735.36342946,   859.05771941],
#[Out]#         [-1029.32696599,  -906.87491118,  -783.23242853,  -658.53569019,
#[Out]#           -532.93281719,  -406.58286166,  -279.65478914,  -152.32646083,
#[Out]#            -24.78361586,   102.78114642,   230.16938419,   357.17783091,
#[Out]#            483.59941299,   609.2242676 ,   733.84076034,   857.23650297],
#[Out]#         [-1027.4884311 ,  -905.2911619 ,  -781.90203208,  -657.45671822,
#[Out]#           -532.10330828,  -406.00128393,  -279.3205028 ,  -152.24018073,
#[Out]#            -24.94787405,   102.36153815,   229.48687172,   356.22165523,
#[Out]#            482.35514769,   607.67335626,   731.96005399,   854.99779755],
#[Out]#         [-1025.26506292,  -903.35397594,  -780.25375216,  -656.09923146,
#[Out]#           -531.03812764,  -405.23001079,  -278.84528948,  -152.06419307,
#[Out]#            -25.07575399,   101.92321003,   228.72911367,   355.13262174,
#[Out]#            480.91966693,   605.87246753,   729.77054515,   852.3917425 ],
#[Out]#         [-1022.65503689,  -901.05499501,  -778.2730528 ,  -654.44287228,
#[Out]#           -529.711452  ,  -404.23810932,  -278.19346267,  -151.7584138 ,
#[Out]#            -25.12313009,   101.51397321,   227.94725069,   353.96484454,
#[Out]#            479.34970226,   603.88059437,   727.33313221,   849.48078558]]))
x2
#[Out]# array([[-1016.12890911,  -894.56654009,  -772.02555927,  -648.62147854,
#[Out]#          -524.47620791,  -399.71703785,  -274.4756215 ,  -148.88695699,
#[Out]#           -23.08836967,   102.7815056 ,   228.58374217,   354.18013936,
#[Out]#           479.43424019,   604.21234908,   728.3845496 ,   851.8257222 ],
#[Out]#        [-1020.49529203,  -898.53601129,  -775.57457653,  -651.7300975 ,
#[Out]#          -527.12854462,  -401.90173132,  -276.18629628,  -150.1226857 ,
#[Out]#           -23.85413559,   102.47434598,   228.71699664,   354.72831736,
#[Out]#           480.36409029,   605.48239641,   729.94463331,   853.61653287],
#[Out]#        [-1024.07323308,  -901.77655074,  -778.45405651,  -654.22811683,
#[Out]#          -529.22842144,  -403.59096561,  -277.45703243,  -150.97217506,
#[Out]#           -24.28519903,   102.45285551,   229.08973153,   355.47297283,
#[Out]#           481.45094178,   606.87383707,   731.59471139,   855.47048921],
#[Out]#        [-1026.94327838,  -904.36990795,  -780.74730809,  -656.20076085,
#[Out]#          -530.86333413,  -404.87486393,  -278.38093663,  -151.53187125,
#[Out]#           -24.4817017 ,   102.6128409 ,   229.59334599,   356.30074131,
#[Out]#           482.57631059,   608.26271132,   733.20499244,   857.25161211],
#[Out]#        [-1029.1748827 ,  -906.38609629,  -782.52525927,  -657.7202282 ,
#[Out]#          -532.10710801,  -405.82923431,  -279.03615566,  -151.88261579,
#[Out]#           -24.5275359 ,   102.86700305,   230.13677811,   357.11644205,
#[Out]#           483.64054109,   609.54453264,   734.66580302,   858.8446852 ],
#[Out]#        [-1030.82717797,  -907.88416155,  -783.84722573,  -658.84646045,
#[Out]#          -533.02066657,  -406.5163382 ,  -279.48664493,  -152.09041408,
#[Out]#           -24.49111305,   103.14416851,   230.64573636,   357.84230943,
#[Out]#           484.56203755,   610.63351918,   735.88681912,   860.15448627],
#[Out]#        [-1031.94974191,  -908.91295053,  -784.7616794 ,  -659.62791068,
#[Out]#          -533.65280007,  -406.98565902,  -279.78293707,  -152.20720402,
#[Out]#           -24.42613229,   103.38852084,   231.061931  ,   358.41722438,
#[Out]#           485.27649555,   611.46182512,   736.79629752,   861.10501869],
#[Out]#        [-1032.58336657,  -909.51187962,  -785.307017  ,  -660.10231201,
#[Out]#          -534.04093403,  -407.27467076,  -279.96291052,  -152.2716245 ,
#[Out]#           -24.37234905,   103.5588321 ,   231.34230552,   358.79594582,
#[Out]#           485.73613339,   611.97877216,   737.34030727,   861.63874284],
#[Out]#        [-1032.76082688,  -909.71170336,  -785.5123287 ,  -660.29744623,
#[Out]#          -534.21189789,  -407.40960651,  -280.0525581 ,  -152.30978408,
#[Out]#           -24.35634361,   103.62769423,   231.45826807,   358.94834207,
#[Out]#           485.90892358,   612.15008093,   737.4819611 ,   861.71580752],
#[Out]#        [-1032.5076493 ,  -909.53528301,  -785.39816662,  -660.23191234,
#[Out]#          -534.18269355,  -407.4062271 ,  -280.06675556,  -152.33602948,
#[Out]#           -24.39228969,   103.58075048,   231.39492288,   358.8586223 ,
#[Out]#           485.77782418,   611.95710237,   737.20064685,   861.31328142],
#[Out]#        [-1031.84288033,  -908.99835516,  -784.97731342,  -659.9158951 ,
#[Out]#          -533.96126393,  -407.27058962,  -280.01003019,  -152.3537142 ,
#[Out]#           -24.48272302,   103.41592688,   231.15030168,   358.52456793,
#[Out]#           485.34001028,   611.39604924,   736.49125886,   860.42438449],
#[Out]#        [-1030.77985511,  -908.11030024,  -784.25555089,  -659.35193369,
#[Out]#          -533.54726157,  -406.99981602,  -279.87732937,  -152.35596706,
#[Out]#           -24.61930992,   103.1426636 ,   230.73459511,   357.95676406,
#[Out]#           484.60610542,   610.47722747,   735.36342946,   859.05771941],
#[Out]#        [-1029.32696599,  -906.87491118,  -783.23242853,  -658.53569019,
#[Out]#          -532.93281719,  -406.58286166,  -279.65478914,  -152.32646083,
#[Out]#           -24.78361586,   102.78114642,   230.16938419,   357.17783091,
#[Out]#           483.59941299,   609.2242676 ,   733.84076034,   857.23650297],
#[Out]#        [-1027.4884311 ,  -905.2911619 ,  -781.90203208,  -657.45671822,
#[Out]#          -532.10330828,  -406.00128393,  -279.3205028 ,  -152.24018073,
#[Out]#           -24.94787405,   102.36153815,   229.48687172,   356.22165523,
#[Out]#           482.35514769,   607.67335626,   731.96005399,   854.99779755],
#[Out]#        [-1025.26506292,  -903.35397594,  -780.25375216,  -656.09923146,
#[Out]#          -531.03812764,  -405.23001079,  -278.84528948,  -152.06419307,
#[Out]#           -25.07575399,   101.92321003,   228.72911367,   355.13262174,
#[Out]#           480.91966693,   605.87246753,   729.77054515,   852.3917425 ],
#[Out]#        [-1022.65503689,  -901.05499501,  -778.2730528 ,  -654.44287228,
#[Out]#          -529.711452  ,  -404.23810932,  -278.19346267,  -151.7584138 ,
#[Out]#           -25.12313009,   101.51397321,   227.94725069,   353.96484454,
#[Out]#           479.34970226,   603.88059437,   727.33313221,   849.48078558]])
x1
#[Out]# array([[   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#         1408, 1536, 1664, 1792, 1920],
#[Out]#        [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#         1408, 1536, 1664, 1792, 1920],
#[Out]#        [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#         1408, 1536, 1664, 1792, 1920],
#[Out]#        [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#         1408, 1536, 1664, 1792, 1920],
#[Out]#        [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#         1408, 1536, 1664, 1792, 1920],
#[Out]#        [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#         1408, 1536, 1664, 1792, 1920],
#[Out]#        [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#         1408, 1536, 1664, 1792, 1920],
#[Out]#        [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#         1408, 1536, 1664, 1792, 1920],
#[Out]#        [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#         1408, 1536, 1664, 1792, 1920],
#[Out]#        [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#         1408, 1536, 1664, 1792, 1920],
#[Out]#        [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#         1408, 1536, 1664, 1792, 1920],
#[Out]#        [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#         1408, 1536, 1664, 1792, 1920],
#[Out]#        [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#         1408, 1536, 1664, 1792, 1920],
#[Out]#        [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#         1408, 1536, 1664, 1792, 1920],
#[Out]#        [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#         1408, 1536, 1664, 1792, 1920],
#[Out]#        [   0,  128,  256,  384,  512,  640,  768,  896, 1024, 1152, 1280,
#[Out]#         1408, 1536, 1664, 1792, 1920]])
ygrid, xgrid = np.mgrid[0:2048:128, 0:2048:128]
# this doesn't do anything because the original ""ww" didn't have SIP coefficients (x1 == xgrid exactly)
x1,y1 = ww.sip_pix2foc(xgrid, ygrid, 0)
# `sip_pix2foc` returns locations relative to crpix, so we redefine x1,x2 to be relative to crpix
x1,y1 = xgrid - ww.wcs.crpix[0], ygrid - ww.wcs.crpix[1]
x2,y2 = new_wcs2.sip_pix2foc(xgrid, ygrid, 0)
pl.quiver(xgrid, ygrid, x1-x2, y1-y2, color='w')
#[Out]# <matplotlib.quiver.Quiver at 0x2ae850514438>
x1
#[Out]# array([[-1022.48640724,  -894.48640724,  -766.48640724,  -638.48640724,
#[Out]#          -510.48640724,  -382.48640724,  -254.48640724,  -126.48640724,
#[Out]#             1.51359276,   129.51359276,   257.51359276,   385.51359276,
#[Out]#           513.51359276,   641.51359276,   769.51359276,   897.51359276],
#[Out]#        [-1022.48640724,  -894.48640724,  -766.48640724,  -638.48640724,
#[Out]#          -510.48640724,  -382.48640724,  -254.48640724,  -126.48640724,
#[Out]#             1.51359276,   129.51359276,   257.51359276,   385.51359276,
#[Out]#           513.51359276,   641.51359276,   769.51359276,   897.51359276],
#[Out]#        [-1022.48640724,  -894.48640724,  -766.48640724,  -638.48640724,
#[Out]#          -510.48640724,  -382.48640724,  -254.48640724,  -126.48640724,
#[Out]#             1.51359276,   129.51359276,   257.51359276,   385.51359276,
#[Out]#           513.51359276,   641.51359276,   769.51359276,   897.51359276],
#[Out]#        [-1022.48640724,  -894.48640724,  -766.48640724,  -638.48640724,
#[Out]#          -510.48640724,  -382.48640724,  -254.48640724,  -126.48640724,
#[Out]#             1.51359276,   129.51359276,   257.51359276,   385.51359276,
#[Out]#           513.51359276,   641.51359276,   769.51359276,   897.51359276],
#[Out]#        [-1022.48640724,  -894.48640724,  -766.48640724,  -638.48640724,
#[Out]#          -510.48640724,  -382.48640724,  -254.48640724,  -126.48640724,
#[Out]#             1.51359276,   129.51359276,   257.51359276,   385.51359276,
#[Out]#           513.51359276,   641.51359276,   769.51359276,   897.51359276],
#[Out]#        [-1022.48640724,  -894.48640724,  -766.48640724,  -638.48640724,
#[Out]#          -510.48640724,  -382.48640724,  -254.48640724,  -126.48640724,
#[Out]#             1.51359276,   129.51359276,   257.51359276,   385.51359276,
#[Out]#           513.51359276,   641.51359276,   769.51359276,   897.51359276],
#[Out]#        [-1022.48640724,  -894.48640724,  -766.48640724,  -638.48640724,
#[Out]#          -510.48640724,  -382.48640724,  -254.48640724,  -126.48640724,
#[Out]#             1.51359276,   129.51359276,   257.51359276,   385.51359276,
#[Out]#           513.51359276,   641.51359276,   769.51359276,   897.51359276],
#[Out]#        [-1022.48640724,  -894.48640724,  -766.48640724,  -638.48640724,
#[Out]#          -510.48640724,  -382.48640724,  -254.48640724,  -126.48640724,
#[Out]#             1.51359276,   129.51359276,   257.51359276,   385.51359276,
#[Out]#           513.51359276,   641.51359276,   769.51359276,   897.51359276],
#[Out]#        [-1022.48640724,  -894.48640724,  -766.48640724,  -638.48640724,
#[Out]#          -510.48640724,  -382.48640724,  -254.48640724,  -126.48640724,
#[Out]#             1.51359276,   129.51359276,   257.51359276,   385.51359276,
#[Out]#           513.51359276,   641.51359276,   769.51359276,   897.51359276],
#[Out]#        [-1022.48640724,  -894.48640724,  -766.48640724,  -638.48640724,
#[Out]#          -510.48640724,  -382.48640724,  -254.48640724,  -126.48640724,
#[Out]#             1.51359276,   129.51359276,   257.51359276,   385.51359276,
#[Out]#           513.51359276,   641.51359276,   769.51359276,   897.51359276],
#[Out]#        [-1022.48640724,  -894.48640724,  -766.48640724,  -638.48640724,
#[Out]#          -510.48640724,  -382.48640724,  -254.48640724,  -126.48640724,
#[Out]#             1.51359276,   129.51359276,   257.51359276,   385.51359276,
#[Out]#           513.51359276,   641.51359276,   769.51359276,   897.51359276],
#[Out]#        [-1022.48640724,  -894.48640724,  -766.48640724,  -638.48640724,
#[Out]#          -510.48640724,  -382.48640724,  -254.48640724,  -126.48640724,
#[Out]#             1.51359276,   129.51359276,   257.51359276,   385.51359276,
#[Out]#           513.51359276,   641.51359276,   769.51359276,   897.51359276],
#[Out]#        [-1022.48640724,  -894.48640724,  -766.48640724,  -638.48640724,
#[Out]#          -510.48640724,  -382.48640724,  -254.48640724,  -126.48640724,
#[Out]#             1.51359276,   129.51359276,   257.51359276,   385.51359276,
#[Out]#           513.51359276,   641.51359276,   769.51359276,   897.51359276],
#[Out]#        [-1022.48640724,  -894.48640724,  -766.48640724,  -638.48640724,
#[Out]#          -510.48640724,  -382.48640724,  -254.48640724,  -126.48640724,
#[Out]#             1.51359276,   129.51359276,   257.51359276,   385.51359276,
#[Out]#           513.51359276,   641.51359276,   769.51359276,   897.51359276],
#[Out]#        [-1022.48640724,  -894.48640724,  -766.48640724,  -638.48640724,
#[Out]#          -510.48640724,  -382.48640724,  -254.48640724,  -126.48640724,
#[Out]#             1.51359276,   129.51359276,   257.51359276,   385.51359276,
#[Out]#           513.51359276,   641.51359276,   769.51359276,   897.51359276],
#[Out]#        [-1022.48640724,  -894.48640724,  -766.48640724,  -638.48640724,
#[Out]#          -510.48640724,  -382.48640724,  -254.48640724,  -126.48640724,
#[Out]#             1.51359276,   129.51359276,   257.51359276,   385.51359276,
#[Out]#           513.51359276,   641.51359276,   769.51359276,   897.51359276]])
x1,x2
#[Out]# (array([[-1022.48640724,  -894.48640724,  -766.48640724,  -638.48640724,
#[Out]#           -510.48640724,  -382.48640724,  -254.48640724,  -126.48640724,
#[Out]#              1.51359276,   129.51359276,   257.51359276,   385.51359276,
#[Out]#            513.51359276,   641.51359276,   769.51359276,   897.51359276],
#[Out]#         [-1022.48640724,  -894.48640724,  -766.48640724,  -638.48640724,
#[Out]#           -510.48640724,  -382.48640724,  -254.48640724,  -126.48640724,
#[Out]#              1.51359276,   129.51359276,   257.51359276,   385.51359276,
#[Out]#            513.51359276,   641.51359276,   769.51359276,   897.51359276],
#[Out]#         [-1022.48640724,  -894.48640724,  -766.48640724,  -638.48640724,
#[Out]#           -510.48640724,  -382.48640724,  -254.48640724,  -126.48640724,
#[Out]#              1.51359276,   129.51359276,   257.51359276,   385.51359276,
#[Out]#            513.51359276,   641.51359276,   769.51359276,   897.51359276],
#[Out]#         [-1022.48640724,  -894.48640724,  -766.48640724,  -638.48640724,
#[Out]#           -510.48640724,  -382.48640724,  -254.48640724,  -126.48640724,
#[Out]#              1.51359276,   129.51359276,   257.51359276,   385.51359276,
#[Out]#            513.51359276,   641.51359276,   769.51359276,   897.51359276],
#[Out]#         [-1022.48640724,  -894.48640724,  -766.48640724,  -638.48640724,
#[Out]#           -510.48640724,  -382.48640724,  -254.48640724,  -126.48640724,
#[Out]#              1.51359276,   129.51359276,   257.51359276,   385.51359276,
#[Out]#            513.51359276,   641.51359276,   769.51359276,   897.51359276],
#[Out]#         [-1022.48640724,  -894.48640724,  -766.48640724,  -638.48640724,
#[Out]#           -510.48640724,  -382.48640724,  -254.48640724,  -126.48640724,
#[Out]#              1.51359276,   129.51359276,   257.51359276,   385.51359276,
#[Out]#            513.51359276,   641.51359276,   769.51359276,   897.51359276],
#[Out]#         [-1022.48640724,  -894.48640724,  -766.48640724,  -638.48640724,
#[Out]#           -510.48640724,  -382.48640724,  -254.48640724,  -126.48640724,
#[Out]#              1.51359276,   129.51359276,   257.51359276,   385.51359276,
#[Out]#            513.51359276,   641.51359276,   769.51359276,   897.51359276],
#[Out]#         [-1022.48640724,  -894.48640724,  -766.48640724,  -638.48640724,
#[Out]#           -510.48640724,  -382.48640724,  -254.48640724,  -126.48640724,
#[Out]#              1.51359276,   129.51359276,   257.51359276,   385.51359276,
#[Out]#            513.51359276,   641.51359276,   769.51359276,   897.51359276],
#[Out]#         [-1022.48640724,  -894.48640724,  -766.48640724,  -638.48640724,
#[Out]#           -510.48640724,  -382.48640724,  -254.48640724,  -126.48640724,
#[Out]#              1.51359276,   129.51359276,   257.51359276,   385.51359276,
#[Out]#            513.51359276,   641.51359276,   769.51359276,   897.51359276],
#[Out]#         [-1022.48640724,  -894.48640724,  -766.48640724,  -638.48640724,
#[Out]#           -510.48640724,  -382.48640724,  -254.48640724,  -126.48640724,
#[Out]#              1.51359276,   129.51359276,   257.51359276,   385.51359276,
#[Out]#            513.51359276,   641.51359276,   769.51359276,   897.51359276],
#[Out]#         [-1022.48640724,  -894.48640724,  -766.48640724,  -638.48640724,
#[Out]#           -510.48640724,  -382.48640724,  -254.48640724,  -126.48640724,
#[Out]#              1.51359276,   129.51359276,   257.51359276,   385.51359276,
#[Out]#            513.51359276,   641.51359276,   769.51359276,   897.51359276],
#[Out]#         [-1022.48640724,  -894.48640724,  -766.48640724,  -638.48640724,
#[Out]#           -510.48640724,  -382.48640724,  -254.48640724,  -126.48640724,
#[Out]#              1.51359276,   129.51359276,   257.51359276,   385.51359276,
#[Out]#            513.51359276,   641.51359276,   769.51359276,   897.51359276],
#[Out]#         [-1022.48640724,  -894.48640724,  -766.48640724,  -638.48640724,
#[Out]#           -510.48640724,  -382.48640724,  -254.48640724,  -126.48640724,
#[Out]#              1.51359276,   129.51359276,   257.51359276,   385.51359276,
#[Out]#            513.51359276,   641.51359276,   769.51359276,   897.51359276],
#[Out]#         [-1022.48640724,  -894.48640724,  -766.48640724,  -638.48640724,
#[Out]#           -510.48640724,  -382.48640724,  -254.48640724,  -126.48640724,
#[Out]#              1.51359276,   129.51359276,   257.51359276,   385.51359276,
#[Out]#            513.51359276,   641.51359276,   769.51359276,   897.51359276],
#[Out]#         [-1022.48640724,  -894.48640724,  -766.48640724,  -638.48640724,
#[Out]#           -510.48640724,  -382.48640724,  -254.48640724,  -126.48640724,
#[Out]#              1.51359276,   129.51359276,   257.51359276,   385.51359276,
#[Out]#            513.51359276,   641.51359276,   769.51359276,   897.51359276],
#[Out]#         [-1022.48640724,  -894.48640724,  -766.48640724,  -638.48640724,
#[Out]#           -510.48640724,  -382.48640724,  -254.48640724,  -126.48640724,
#[Out]#              1.51359276,   129.51359276,   257.51359276,   385.51359276,
#[Out]#            513.51359276,   641.51359276,   769.51359276,   897.51359276]]),
#[Out]#  array([[-1016.12890911,  -894.56654009,  -772.02555927,  -648.62147854,
#[Out]#           -524.47620791,  -399.71703785,  -274.4756215 ,  -148.88695699,
#[Out]#            -23.08836967,   102.7815056 ,   228.58374217,   354.18013936,
#[Out]#            479.43424019,   604.21234908,   728.3845496 ,   851.8257222 ],
#[Out]#         [-1020.49529203,  -898.53601129,  -775.57457653,  -651.7300975 ,
#[Out]#           -527.12854462,  -401.90173132,  -276.18629628,  -150.1226857 ,
#[Out]#            -23.85413559,   102.47434598,   228.71699664,   354.72831736,
#[Out]#            480.36409029,   605.48239641,   729.94463331,   853.61653287],
#[Out]#         [-1024.07323308,  -901.77655074,  -778.45405651,  -654.22811683,
#[Out]#           -529.22842144,  -403.59096561,  -277.45703243,  -150.97217506,
#[Out]#            -24.28519903,   102.45285551,   229.08973153,   355.47297283,
#[Out]#            481.45094178,   606.87383707,   731.59471139,   855.47048921],
#[Out]#         [-1026.94327838,  -904.36990795,  -780.74730809,  -656.20076085,
#[Out]#           -530.86333413,  -404.87486393,  -278.38093663,  -151.53187125,
#[Out]#            -24.4817017 ,   102.6128409 ,   229.59334599,   356.30074131,
#[Out]#            482.57631059,   608.26271132,   733.20499244,   857.25161211],
#[Out]#         [-1029.1748827 ,  -906.38609629,  -782.52525927,  -657.7202282 ,
#[Out]#           -532.10710801,  -405.82923431,  -279.03615566,  -151.88261579,
#[Out]#            -24.5275359 ,   102.86700305,   230.13677811,   357.11644205,
#[Out]#            483.64054109,   609.54453264,   734.66580302,   858.8446852 ],
#[Out]#         [-1030.82717797,  -907.88416155,  -783.84722573,  -658.84646045,
#[Out]#           -533.02066657,  -406.5163382 ,  -279.48664493,  -152.09041408,
#[Out]#            -24.49111305,   103.14416851,   230.64573636,   357.84230943,
#[Out]#            484.56203755,   610.63351918,   735.88681912,   860.15448627],
#[Out]#         [-1031.94974191,  -908.91295053,  -784.7616794 ,  -659.62791068,
#[Out]#           -533.65280007,  -406.98565902,  -279.78293707,  -152.20720402,
#[Out]#            -24.42613229,   103.38852084,   231.061931  ,   358.41722438,
#[Out]#            485.27649555,   611.46182512,   736.79629752,   861.10501869],
#[Out]#         [-1032.58336657,  -909.51187962,  -785.307017  ,  -660.10231201,
#[Out]#           -534.04093403,  -407.27467076,  -279.96291052,  -152.2716245 ,
#[Out]#            -24.37234905,   103.5588321 ,   231.34230552,   358.79594582,
#[Out]#            485.73613339,   611.97877216,   737.34030727,   861.63874284],
#[Out]#         [-1032.76082688,  -909.71170336,  -785.5123287 ,  -660.29744623,
#[Out]#           -534.21189789,  -407.40960651,  -280.0525581 ,  -152.30978408,
#[Out]#            -24.35634361,   103.62769423,   231.45826807,   358.94834207,
#[Out]#            485.90892358,   612.15008093,   737.4819611 ,   861.71580752],
#[Out]#         [-1032.5076493 ,  -909.53528301,  -785.39816662,  -660.23191234,
#[Out]#           -534.18269355,  -407.4062271 ,  -280.06675556,  -152.33602948,
#[Out]#            -24.39228969,   103.58075048,   231.39492288,   358.8586223 ,
#[Out]#            485.77782418,   611.95710237,   737.20064685,   861.31328142],
#[Out]#         [-1031.84288033,  -908.99835516,  -784.97731342,  -659.9158951 ,
#[Out]#           -533.96126393,  -407.27058962,  -280.01003019,  -152.3537142 ,
#[Out]#            -24.48272302,   103.41592688,   231.15030168,   358.52456793,
#[Out]#            485.34001028,   611.39604924,   736.49125886,   860.42438449],
#[Out]#         [-1030.77985511,  -908.11030024,  -784.25555089,  -659.35193369,
#[Out]#           -533.54726157,  -406.99981602,  -279.87732937,  -152.35596706,
#[Out]#            -24.61930992,   103.1426636 ,   230.73459511,   357.95676406,
#[Out]#            484.60610542,   610.47722747,   735.36342946,   859.05771941],
#[Out]#         [-1029.32696599,  -906.87491118,  -783.23242853,  -658.53569019,
#[Out]#           -532.93281719,  -406.58286166,  -279.65478914,  -152.32646083,
#[Out]#            -24.78361586,   102.78114642,   230.16938419,   357.17783091,
#[Out]#            483.59941299,   609.2242676 ,   733.84076034,   857.23650297],
#[Out]#         [-1027.4884311 ,  -905.2911619 ,  -781.90203208,  -657.45671822,
#[Out]#           -532.10330828,  -406.00128393,  -279.3205028 ,  -152.24018073,
#[Out]#            -24.94787405,   102.36153815,   229.48687172,   356.22165523,
#[Out]#            482.35514769,   607.67335626,   731.96005399,   854.99779755],
#[Out]#         [-1025.26506292,  -903.35397594,  -780.25375216,  -656.09923146,
#[Out]#           -531.03812764,  -405.23001079,  -278.84528948,  -152.06419307,
#[Out]#            -25.07575399,   101.92321003,   228.72911367,   355.13262174,
#[Out]#            480.91966693,   605.87246753,   729.77054515,   852.3917425 ],
#[Out]#         [-1022.65503689,  -901.05499501,  -778.2730528 ,  -654.44287228,
#[Out]#           -529.711452  ,  -404.23810932,  -278.19346267,  -151.7584138 ,
#[Out]#            -25.12313009,   101.51397321,   227.94725069,   353.96484454,
#[Out]#            479.34970226,   603.88059437,   727.33313221,   849.48078558]]))
r1
#[Out]# array([[290.9780491 , 290.97128749, 290.96444959, 290.9575471 ,
#[Out]#         290.95059151, 290.94359404, 290.93656555, 290.92951663,
#[Out]#         290.92245764, 290.91539883, 290.90835044, 290.90132285,
#[Out]#         290.89432664, 290.88737271, 290.88047226, 290.87363681],
#[Out]#        [290.97825392, 290.97146401, 290.96459828, 290.95766857,
#[Out]#         290.9506864 , 290.94366296, 290.93660901, 290.92953502,
#[Out]#         290.92245114, 290.91536745, 290.90829398, 290.90124093,
#[Out]#         290.89421875, 290.88723825, 290.88031059, 290.87344733],
#[Out]#        [290.97842839, 290.9716139 , 290.96472413, 290.957771  ,
#[Out]#         290.95076607, 290.94372047, 290.93664489, 290.92954961,
#[Out]#         290.92244466, 290.91533987, 290.90824513, 290.90117044,
#[Out]#         290.89412611, 290.88712284, 290.88017178, 290.8732845 ],
#[Out]#        [290.97857302, 290.97173775, 290.96482773, 290.95785497,
#[Out]#         290.95083103, 290.943767  , 290.93667347, 290.92956058,
#[Out]#         290.92243819, 290.91531597, 290.90820361, 290.90111097,
#[Out]#         290.89404821, 290.88702594, 290.88005525, 290.87314775],
#[Out]#        [290.97868844, 290.97183621, 290.96490974, 290.95792109,
#[Out]#         290.95088182, 290.94380298, 290.93669505, 290.92956807,
#[Out]#         290.92243174, 290.9152956 , 290.90816915, 290.90106211,
#[Out]#         290.89398454, 290.88694694, 290.87996038, 290.87303644],
#[Out]#        [290.97877526, 290.97190993, 290.9649708 , 290.95796994,
#[Out]#         290.95091895, 290.9438288 , 290.93670992, 290.92957224,
#[Out]#         290.92242534, 290.91527861, 290.90814146, 290.90102347,
#[Out]#         290.8939346 , 290.88688529, 290.87988654, 290.87294995],
#[Out]#        [290.97883405, 290.97195949, 290.96501145, 290.95800205,
#[Out]#         290.95094285, 290.94384482, 290.93671832, 290.9295732 ,
#[Out]#         290.92241897, 290.9152649 , 290.90812032, 290.90099472,
#[Out]#         290.89389798, 290.88684047, 290.8798332 , 290.87288773],
#[Out]#        [290.97886526, 290.97198533, 290.96503213, 290.95801779,
#[Out]#         290.95095387, 290.94385132, 290.93672045, 290.92957108,
#[Out]#         290.92241264, 290.91525439, 290.90810556, 290.9009756 ,
#[Out]#         290.89387434, 290.88681213, 290.87979993, 290.87284934],
#[Out]#        [290.97886917, 290.97198775, 290.96503312, 290.95801743,
#[Out]#         290.95095223, 290.94384845, 290.93671641, 290.92956592,
#[Out]#         290.92240637, 290.91524701, 290.90809706, 290.90096594,
#[Out]#         290.89386348, 290.88680001, 290.87978649, 290.87283451],
#[Out]#        [290.97884588, 290.97196683, 290.96501451, 290.95800104,
#[Out]#         290.95093799, 290.94383628, 290.93670627, 290.92955775,
#[Out]#         290.92240016, 290.91524276, 290.9080948 , 290.90096572,
#[Out]#         290.89386535, 290.88680406, 290.8797928 , 290.87284316],
#[Out]#        [290.97879529, 290.97192249, 290.9649762 , 290.95796854,
#[Out]#         290.95091108, 290.94381477, 290.93668997, 290.92954656,
#[Out]#         290.92239402, 290.91524168, 290.90809883, 290.90097499,
#[Out]#         290.89388004, 290.88682437, 290.87981896, 290.8728754 ],
#[Out]#        [290.97871713, 290.97185444, 290.96491793, 290.9579197 ,
#[Out]#         290.9508713 , 290.94378373, 290.93666741, 290.9295323 ,
#[Out]#         290.92238796, 290.91524382, 290.90810929, 290.90099395,
#[Out]#         290.89390778, 290.88686121, 290.87986527, 290.87293155],
#[Out]#        [290.97861096, 290.97176223, 290.96483927, 290.9578541 ,
#[Out]#         290.95081831, 290.94374291, 290.93663842, 290.92951488,
#[Out]#         290.92238199, 290.91524931, 290.90812636, 290.90102287,
#[Out]#         290.89394891, 290.88691499, 290.87993218, 290.87301205],
#[Out]#        [290.97847623, 290.97164532, 290.96473967, 290.95777127,
#[Out]#         290.95075168, 290.94369198, 290.93660276, 290.92949419,
#[Out]#         290.92237612, 290.91525826, 290.90815031, 290.90106212,
#[Out]#         290.89400389, 290.88698623, 290.88002024, 290.87311749],
#[Out]#        [290.97831235, 290.97150306, 290.96461852, 290.95767063,
#[Out]#         290.95067092, 290.94363054, 290.93656016, 290.9294701 ,
#[Out]#         290.92237037, 290.91527085, 290.90818142, 290.90111211,
#[Out]#         290.89407324, 290.88707552, 290.88013008, 290.87324851],
#[Out]#        [290.97811873, 290.97133486, 290.96447521, 290.95755159,
#[Out]#         290.95057554, 290.94355819, 290.93651036, 290.92944247,
#[Out]#         290.92236474, 290.91528722, 290.90821999, 290.90117325,
#[Out]#         290.89415747, 290.88718345, 290.88026236, 290.87340574]])
r1-r2
#[Out]# array([[0.0006982 , 0.00071926, 0.00071878, 0.00070198, 0.00067356,
#[Out]#         0.00063757, 0.00059753, 0.00055649, 0.00051712, 0.00048193,
#[Out]#         0.0004534 , 0.0004342 , 0.0004273 , 0.00043614, 0.00046468,
#[Out]#         0.00051746],
#[Out]#        [0.00066817, 0.00068294, 0.00067795, 0.00065834, 0.00062862,
#[Out]#         0.00059257, 0.00055333, 0.00051351, 0.00047527, 0.00044057,
#[Out]#         0.00041133, 0.00038961, 0.00037783, 0.00037886, 0.00039616,
#[Out]#         0.0004338 ],
#[Out]#        [0.00065188, 0.00066077, 0.00065173, 0.00062983, 0.00059938,
#[Out]#         0.0005639 , 0.00052617, 0.00048837, 0.00045218, 0.00041904,
#[Out]#         0.0003903 , 0.00036747, 0.00035241, 0.00034746, 0.00035557,
#[Out]#         0.00038034],
#[Out]#        [0.00064535, 0.00064876, 0.00063607, 0.00061225, 0.00058145,
#[Out]#         0.00054693, 0.00051114, 0.00047583, 0.00044226, 0.00041136,
#[Out]#         0.00038396, 0.00036104, 0.00034393, 0.00033445, 0.00033507,
#[Out]#         0.00034893],
#[Out]#        [0.0006453 , 0.00064364, 0.00062764, 0.00060218, 0.00057125,
#[Out]#         0.00053786, 0.00050416, 0.00047154, 0.00044083, 0.00041251,
#[Out]#         0.00038693, 0.00036459, 0.00034631, 0.00033342, 0.00032792,
#[Out]#         0.00033249],
#[Out]#        [0.00064905, 0.00064276, 0.00062375, 0.00059684, 0.00056586,
#[Out]#         0.0005336 , 0.00050194, 0.00047194, 0.00044407, 0.00041838,
#[Out]#         0.00039481, 0.00037339, 0.00035449, 0.000339  , 0.00032845,
#[Out]#         0.0003251 ],
#[Out]#        [0.00065437, 0.00064394, 0.00062224, 0.00059403, 0.00056298,
#[Out]#         0.00053173, 0.0005019 , 0.00047427, 0.00044897, 0.00042573,
#[Out]#         0.00040408, 0.00038368, 0.00036446, 0.0003469 , 0.00033212,
#[Out]#         0.00032195],
#[Out]#        [0.00065943, 0.00064542, 0.00062139, 0.00059202, 0.00056087,
#[Out]#         0.00053042, 0.00050209, 0.00047644, 0.00045332, 0.00043216,
#[Out]#         0.00041218, 0.00039267, 0.00037322, 0.00035392, 0.00033549,
#[Out]#         0.00031938],
#[Out]#        [0.00066267, 0.00064577, 0.00061983, 0.00058949, 0.00055822,
#[Out]#         0.00052836, 0.00050118, 0.00047705, 0.00045563, 0.00043608,
#[Out]#         0.00041738, 0.00039852, 0.00037877, 0.00035789, 0.00033625,
#[Out]#         0.00031491],
#[Out]#        [0.00066274, 0.00064378, 0.00061651, 0.00058549, 0.00055415,
#[Out]#         0.00052472, 0.00049837, 0.00047533, 0.0004551 , 0.00043668,
#[Out]#         0.00041882, 0.00040029, 0.0003801 , 0.00035771, 0.00033316,
#[Out]#         0.00030716],
#[Out]#        [0.00065848, 0.00063847, 0.00061058, 0.00057935, 0.00054812,
#[Out]#         0.00051909, 0.00049335, 0.00047105, 0.00045159, 0.00043385,
#[Out]#         0.00041643, 0.00039792, 0.00037712, 0.00035325, 0.00032604,
#[Out]#         0.00029588],
#[Out]#        [0.00064883, 0.00062901, 0.00060146, 0.00057066, 0.00053994,
#[Out]#         0.00051145, 0.00048628, 0.00046454, 0.00044556, 0.00042818,
#[Out]#         0.0004109 , 0.00039218, 0.00037066, 0.00034534, 0.00031571,
#[Out]#         0.00028182],
#[Out]#        [0.00063289, 0.00061474, 0.00058871, 0.00055926, 0.00052968,
#[Out]#         0.00050216, 0.00047775, 0.0004566 , 0.00043805, 0.00042089,
#[Out]#         0.00040361, 0.0003846 , 0.00036236, 0.00033572, 0.00030393,
#[Out]#         0.00026675],
#[Out]#        [0.00060985, 0.00059513, 0.00057211, 0.00054521, 0.00051773,
#[Out]#         0.00049187, 0.00046873, 0.00044851, 0.00043058, 0.00041379,
#[Out]#         0.00039662, 0.00037741, 0.00035461, 0.00032689, 0.0002933 ,
#[Out]#         0.0002533 ],
#[Out]#        [0.00057906, 0.00056984, 0.00055163, 0.00052882, 0.00050473,
#[Out]#         0.00048159, 0.00046058, 0.00044195, 0.0004252 , 0.00040921,
#[Out]#         0.00039253, 0.0003735 , 0.00035051, 0.00032212, 0.00028719,
#[Out]#         0.0002449 ],
#[Out]#        [0.00054002, 0.00053868, 0.00052743, 0.00051063, 0.00049159,
#[Out]#         0.00047262, 0.00045497, 0.00043902, 0.00042435, 0.00040997,
#[Out]#         0.00039449, 0.00037629, 0.00035373, 0.00032529, 0.00028963,
#[Out]#         0.00024565]])
from photutils import DAOStarFinder
std = filehandle[0].data.std() # crummy guess!!
daofind = DAOStarFinder(fwhm=3.0, threshold=4.*std)
starcat = daofind(filehandle[0].data - np.median(filehandle[0].data)) 
starcat
#[Out]# <Table length=306>
#[Out]#   id      xcentroid      ...        flux                mag        
#[Out]# int64      float64       ...      float64             float64      
#[Out]# ----- ------------------ ... ------------------ -------------------
#[Out]#     1  287.9700850298652 ...  6.457621293501058 -2.0251814306880984
#[Out]#     2  1304.852235218743 ... 2.0685111856434135 -0.7891446843020283
#[Out]#     3  697.4116669665292 ...  2.381043379974144 -0.9419182696039424
#[Out]#     4 1633.1442249028848 ... 1.4378440943787447 -0.3942794949820389
#[Out]#     5 1054.3503310555595 ... 2.9647567175065572  -1.179972654386196
#[Out]#     6 1659.5769719916764 ... 3.1769179812948596 -1.2550150069050916
#[Out]#     7 1304.4557964903947 ... 1.0701561795540757 -0.0736179090935071
#[Out]#     8 1665.9293754741275 ...  6.689247363387615 -2.0634431403405187
#[Out]#     9 1568.3300173689129 ...   4.01973648378026 -1.5104939589603954
#[Out]#    10 1279.8452151362637 ... 1.4642403116970348 -0.4140308978837884
#[Out]#   ...                ... ...                ...                 ...
#[Out]#   297 1917.8647117743872 ...  6.378414163028312  -2.011781788552261
#[Out]#   298  693.2974170967494 ...  2.380434796567463  -0.941640725103118
#[Out]#   299  65.63278618915696 ... 2.2893583140710763 -0.8992844266901113
#[Out]#   300  833.0293607623491 ... 2.9570605601481015 -1.1771505472544403
#[Out]#   301  65.94338658143386 ...  5.336654229501871  -1.818172662675076
#[Out]#   302   659.939368611174 ... 1.0487523440504145 -0.0516823613070828
#[Out]#   303  2006.256010558064 ... 1.3057055088794072 -0.2896130911024453
#[Out]#   304 1783.3036370430382 ...  6.467492916348213  -2.026839904297673
#[Out]#   305 1338.5532616480493 ...  7.250520101289022  -2.150922902295844
#[Out]#   306 1920.6323306541221 ... 1.2982350732718613 -0.2833833447613592
pl.figure(figsize=(12,12))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
pl.plot(starcat['xcentroid'], starcat['ycentroid'], 'wx')
pl.plot(table_coordinates.ra[brightstars],
        table_coordinates.dec[brightstars],
        transform=ax.get_transform('world'), marker='x', color='r', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
xc, yc = ww.all_world2pix(table_coordinates.ra, table_coordinates.dec, 0)
ra, dec = ww.all_pix2world(starcat['xcentroid'], starcat['ycentroid'], 0)*u.deg
starfind_coords = coordinates.SkyCoord(ra, dec, frame='fk5')
starfind_coords.shape, table_coordinates.shape
#[Out]# ((306,), (1716,))
match_index, match_distance, _ = coordinates.match_coordinates_sky(starfind_coords, table_coordinates)
pl.hist(match_distance.to(u.arcsec).value)
#[Out]# (array([ 13.,  29., 201.,  59.,   3.,   0.,   0.,   0.,   0.,   1.]),
#[Out]#  array([ 0.48936726,  1.73070483,  2.9720424 ,  4.21337998,  5.45471755,
#[Out]#          6.69605513,  7.9373927 ,  9.17873027, 10.42006785, 11.66140542,
#[Out]#         12.902743  ]),
#[Out]#  <BarContainer object of 10 artists>)
new_sky_coordinates = table_coordinates[match_index]
new_sky_coordinates_xy = ww.all_world2pix(new_sky_coordinates.ra, new_sky_coordinates.dec, 0)
pl.figure(figsize=(24,24))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
pl.plot(starcat['xcentroid'], starcat['ycentroid'], 'wx')
pl.plot(new_sky_coordinates_xy[0], new_sky_coordinates_xy[1], 'rx')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
from astropy.wcs.utils import fit_wcs_from_points
xy_starfind = np.array([starcat['xcentroid'], starcat['ycentroid']])
new_wcs = fit_wcs_from_points(xy_starfind, new_sky_coordinates, sip_degree=2)
new_wcs
#[Out]# WCS Keywords
#[Out]# 
#[Out]# Number of WCS axes: 2
#[Out]# CTYPE : 'RA---TAN-SIP'  'DEC--TAN-SIP'  
#[Out]# CRVAL : 290.92078535152535  14.506217880366655  
#[Out]# CRPIX : 1047.9203951629465  1010.5311861117924  
#[Out]# CD1_1 CD1_2  : -5.331401700064365e-05  -7.088451406175386e-08  
#[Out]# CD2_1 CD2_2  : 7.234694115497095e-08  -5.332017195715788e-05  
#[Out]# NAXIS : 2000.7783858533226  2028.2073632349282
new_ra, new_dec = new_wcs.wcs_pix2world(starcat['xcentroid'], starcat['ycentroid'], 0)*u.deg
visualization.quantity_support()
#[Out]# <astropy.visualization.units.quantity_support.<locals>.MplQuantityConverter at 0x2ae8506f8ac8>
pl.plot(new_ra, new_dec, 'x')
pl.plot(new_sky_coordinates.ra, new_sky_coordinates.dec, 'x')
#[Out]# [<matplotlib.lines.Line2D at 0x2ae85076deb8>]
ra_residual = (new_ra-new_sky_coordinates.ra).to(u.arcsec)
dec_residual = (new_dec-new_sky_coordinates.dec).to(u.arcsec)
pl.plot(ra_residual, dec_residual, 'x')
pl.grid()
bad_matches = (ra_residual < -2*u.arcsec) | (ra_residual > 2*u.arcsec) | (dec_residual > 1*u.arcsec)
bad_matches.sum(), len(bad_matches)
#[Out]# (70, 306)
xy_starfind.T.T.shape
#[Out]# (2, 306)
xy_starfind2 = xy_starfind.T[~bad_matches].T
new_sky_coordinates2 = new_sky_coordinates.T[~bad_matches].T
new_wcs2 = fit_wcs_from_points(xy_starfind2, new_sky_coordinates2, sip_degree=5)
new_ra2, new_dec2 = new_wcs2.wcs_pix2world(starcat['xcentroid'], starcat['ycentroid'], 0)*u.deg
ra_residual2 = (new_ra2-new_sky_coordinates.ra).to(u.arcsec)
dec_residual2 = (new_dec2-new_sky_coordinates.dec).to(u.arcsec)
pl.plot(ra_residual2, dec_residual2, 'x')
pl.grid()
new_wcs2
#[Out]# WCS Keywords
#[Out]# 
#[Out]# Number of WCS axes: 2
#[Out]# CTYPE : 'RA---TAN-SIP'  'DEC--TAN-SIP'  
#[Out]# CRVAL : 290.9207853485614  14.506229880371471  
#[Out]# CRPIX : 1046.6551484528022  1015.996237301712  
#[Out]# CD1_1 CD1_2  : -5.332665390824933e-05  -2.7992082944641182e-08  
#[Out]# CD2_1 CD2_2  : -1.8862170515565008e-08  -5.3289230035676716e-05  
#[Out]# NAXIS : 2000.7783858533226  2028.2073632349282
pl.figure(figsize=(24,24))
ax = pl.subplot(projection=new_wcs2)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
pl.plot(starcat['xcentroid'], starcat['ycentroid'], 'wx')
pl.plot(table_coordinates.ra,
        table_coordinates.dec,
        transform=ax.get_transform('world'), marker='x', color='r', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
#pl.quiver(new_ra.value, new_dec.value, ra_residual2.value, dec_residual2.value, color='w')
pl.quiver(new_ra.value[bad_matches], new_dec.value[bad_matches], ra_residual2.value[bad_matches], dec_residual2.value[bad_matches], color='r')
pl.quiver(new_ra.value[~bad_matches], new_dec.value[~bad_matches], ra_residual2.value[~bad_matches], dec_residual2.value[~bad_matches], color='w')
#[Out]# <matplotlib.quiver.Quiver at 0x2ae8508134a8>
ygrid, xgrid = np.mgrid[0:2048:128, 0:2048:128]
r1,d1 = ww.all_pix2world(xgrid, ygrid, 0)
r2,d2 = new_wcs2.all_pix2world(xgrid, ygrid, 0)
pl.quiver(xgrid, ygrid, r1-r2, d1-d2, color='w')
#[Out]# <matplotlib.quiver.Quiver at 0x2ae8509bf048>
ygrid, xgrid = np.mgrid[0:2048:128, 0:2048:128]
# this doesn't do anything because the original "ww" didn't have SIP coefficients (x1 == xgrid exactly)
x1,y1 = ww.sip_pix2foc(xgrid, ygrid, 0)
# `sip_pix2foc` returns locations relative to crpix, so we redefine x1,x2 to be relative to crpix
x1,y1 = xgrid - ww.wcs.crpix[0], ygrid - ww.wcs.crpix[1]
x2,y2 = new_wcs2.sip_pix2foc(xgrid, ygrid, 0)
pl.quiver(xgrid, ygrid, x1-x2, y1-y2, color='w')
#[Out]# <matplotlib.quiver.Quiver at 0x2ae850a37b00>
ww.wcs.crval
#[Out]# array([290.92254741,  14.50522928])
ww.wcs.crval[1] -= 1/3600
pl.figure(figsize=(24,24))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
axlims = ax.axis()
pl.plot(table_coordinates.ra[brightstars],
        table_coordinates.dec[brightstars],
        transform=ax.get_transform('world'), marker='x', color='w', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
ww.wcs.crval[1] += 1/3600
ww.wcs.crval[1] += 1/3600
pl.figure(figsize=(24,24))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
axlims = ax.axis()
pl.plot(table_coordinates.ra[brightstars],
        table_coordinates.dec[brightstars],
        transform=ax.get_transform('world'), marker='x', color='w', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
ww.wcs.crval[1] += 1/3600
pl.figure(figsize=(24,24))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
axlims = ax.axis()
pl.plot(table_coordinates.ra[brightstars],
        table_coordinates.dec[brightstars],
        transform=ax.get_transform('world'), marker='x', color='w', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
ww.wcs.crval[1] += 1/3600
pl.figure(figsize=(24,24))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
axlims = ax.axis()
pl.plot(table_coordinates.ra[brightstars],
        table_coordinates.dec[brightstars],
        transform=ax.get_transform('world'), marker='x', color='w', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
ww = WCS(filehandle[0].header)
ww.wcs.crval[1] += 3/3600
ww.wcs.crval[0] -= 2/3600


pl.figure(figsize=(24,24))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
axlims = ax.axis()
pl.plot(table_coordinates.ra[brightstars],
        table_coordinates.dec[brightstars],
        transform=ax.get_transform('world'), marker='x', color='w', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
ww = WCS(filehandle[0].header)
ww.wcs.crval[1] += 4/3600
ww.wcs.crval[0] -= 1.8/3600


pl.figure(figsize=(24,24))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
axlims = ax.axis()
pl.plot(table_coordinates.ra[brightstars],
        table_coordinates.dec[brightstars],
        transform=ax.get_transform('world'), marker='x', color='w', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
ww = WCS(filehandle[0].header)
ww.wcs.crval[1] += 4/3600
ww.wcs.crval[0] -= 1.8/3600


pl.figure(figsize=(24,24))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
axlims = ax.axis()
pl.plot(table_coordinates.ra[brightstars],
        table_coordinates.dec[brightstars],
        transform=ax.get_transform('world'), marker='x', color='k', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
# because the offset was so bad, I decided to try to fix the WCS a little before doing cross-matching
# the code below re-loads the WCS, then shifts it up by 4" and left by 1.8"
ww = WCS(filehandle[0].header)
ww.wcs.crval[1] += 4/3600
ww.wcs.crval[0] -= 1.8/3600


pl.figure(figsize=(24,24))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
axlims = ax.axis()
pl.plot(table_coordinates.ra[brightstars],
        table_coordinates.dec[brightstars],
        transform=ax.get_transform('world'), marker='x', color='k', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
from photutils import DAOStarFinder
std = filehandle[0].data.std() # crummy guess!!
daofind = DAOStarFinder(fwhm=3.0, threshold=4.*std)
starcat = daofind(filehandle[0].data - np.median(filehandle[0].data)) 
starcat
#[Out]# <Table length=306>
#[Out]#   id      xcentroid      ...        flux                mag        
#[Out]# int64      float64       ...      float64             float64      
#[Out]# ----- ------------------ ... ------------------ -------------------
#[Out]#     1  287.9700850298652 ...  6.457621293501058 -2.0251814306880984
#[Out]#     2  1304.852235218743 ... 2.0685111856434135 -0.7891446843020283
#[Out]#     3  697.4116669665292 ...  2.381043379974144 -0.9419182696039424
#[Out]#     4 1633.1442249028848 ... 1.4378440943787447 -0.3942794949820389
#[Out]#     5 1054.3503310555595 ... 2.9647567175065572  -1.179972654386196
#[Out]#     6 1659.5769719916764 ... 3.1769179812948596 -1.2550150069050916
#[Out]#     7 1304.4557964903947 ... 1.0701561795540757 -0.0736179090935071
#[Out]#     8 1665.9293754741275 ...  6.689247363387615 -2.0634431403405187
#[Out]#     9 1568.3300173689129 ...   4.01973648378026 -1.5104939589603954
#[Out]#    10 1279.8452151362637 ... 1.4642403116970348 -0.4140308978837884
#[Out]#   ...                ... ...                ...                 ...
#[Out]#   297 1917.8647117743872 ...  6.378414163028312  -2.011781788552261
#[Out]#   298  693.2974170967494 ...  2.380434796567463  -0.941640725103118
#[Out]#   299  65.63278618915696 ... 2.2893583140710763 -0.8992844266901113
#[Out]#   300  833.0293607623491 ... 2.9570605601481015 -1.1771505472544403
#[Out]#   301  65.94338658143386 ...  5.336654229501871  -1.818172662675076
#[Out]#   302   659.939368611174 ... 1.0487523440504145 -0.0516823613070828
#[Out]#   303  2006.256010558064 ... 1.3057055088794072 -0.2896130911024453
#[Out]#   304 1783.3036370430382 ...  6.467492916348213  -2.026839904297673
#[Out]#   305 1338.5532616480493 ...  7.250520101289022  -2.150922902295844
#[Out]#   306 1920.6323306541221 ... 1.2982350732718613 -0.2833833447613592
pl.figure(figsize=(12,12))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
pl.plot(starcat['xcentroid'], starcat['ycentroid'], 'wx')
pl.plot(table_coordinates.ra[brightstars],
        table_coordinates.dec[brightstars],
        transform=ax.get_transform('world'), marker='x', color='r', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
xc, yc = ww.all_world2pix(table_coordinates.ra, table_coordinates.dec, 0)
ra, dec = ww.all_pix2world(starcat['xcentroid'], starcat['ycentroid'], 0)*u.deg
starfind_coords = coordinates.SkyCoord(ra, dec, frame='fk5')
starfind_coords.shape, table_coordinates.shape
#[Out]# ((306,), (1716,))
match_index, match_distance, _ = coordinates.match_coordinates_sky(starfind_coords, table_coordinates)
pl.hist(match_distance.to(u.arcsec).value)
#[Out]# (array([234.,  65.,   4.,   0.,   1.,   0.,   0.,   0.,   1.,   1.]),
#[Out]#  array([0.04816839, 1.03560097, 2.02303355, 3.01046613, 3.9978987 ,
#[Out]#         4.98533128, 5.97276386, 6.96019644, 7.94762901, 8.93506159,
#[Out]#         9.92249417]),
#[Out]#  <BarContainer object of 10 artists>)
new_sky_coordinates = table_coordinates[match_index]
new_sky_coordinates_xy = ww.all_world2pix(new_sky_coordinates.ra, new_sky_coordinates.dec, 0)
pl.figure(figsize=(24,24))
ax = pl.subplot(projection=ww)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
pl.plot(starcat['xcentroid'], starcat['ycentroid'], 'wx')
pl.plot(new_sky_coordinates_xy[0], new_sky_coordinates_xy[1], 'rx')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
from astropy.wcs.utils import fit_wcs_from_points
xy_starfind = np.array([starcat['xcentroid'], starcat['ycentroid']])
new_wcs = fit_wcs_from_points(xy_starfind, new_sky_coordinates, sip_degree=2)
new_wcs
#[Out]# WCS Keywords
#[Out]# 
#[Out]# Number of WCS axes: 2
#[Out]# CTYPE : 'RA---TAN-SIP'  'DEC--TAN-SIP'  
#[Out]# CRVAL : 290.9207853485614  14.506229880371471  
#[Out]# CRPIX : 1045.7754298613622  1015.7409045073978  
#[Out]# CD1_1 CD1_2  : -5.3267256719998046e-05  -4.984211132715454e-09  
#[Out]# CD2_1 CD2_2  : 5.483835322691893e-09  -5.323166184964617e-05  
#[Out]# NAXIS : 2000.7783858533226  2028.2073632349282
new_ra, new_dec = new_wcs.wcs_pix2world(starcat['xcentroid'], starcat['ycentroid'], 0)*u.deg
visualization.quantity_support()
#[Out]# <astropy.visualization.units.quantity_support.<locals>.MplQuantityConverter at 0x2ae85107d7b8>
pl.plot(new_ra, new_dec, 'x')
pl.plot(new_sky_coordinates.ra, new_sky_coordinates.dec, 'x')
#[Out]# [<matplotlib.lines.Line2D at 0x2ae850ecd4a8>]
ra_residual = (new_ra-new_sky_coordinates.ra).to(u.arcsec)
dec_residual = (new_dec-new_sky_coordinates.dec).to(u.arcsec)
pl.plot(ra_residual, dec_residual, 'x')
pl.grid()
bad_matches = (ra_residual < -2*u.arcsec) | (ra_residual > 2*u.arcsec) | (dec_residual > 2*u.arcsec) | (dec_residual < -2*u.arcsec)
bad_matches.sum(), len(bad_matches)
#[Out]# (18, 306)
xy_starfind.T.T.shape
#[Out]# (2, 306)
filehandle[0].header['FILTER']
#[Out]# 'J'
ra, dec = ww.all_pix2world(starcat['xcentroid'], starcat['ycentroid'], 0)*u.deg
ra_residual = (new_ra-new_sky_coordinates.ra).to(u.arcsec)
dec_residual = (new_dec-new_sky_coordinates.dec).to(u.arcsec)
pl.plot(ra_residual, dec_residual, 'x')
pl.grid()
bad_matches = (ra_residual < -2*u.arcsec) | (ra_residual > 2*u.arcsec) | (dec_residual > 2*u.arcsec) | (dec_residual < -2*u.arcsec)
bad_matches.sum(), len(bad_matches)
#[Out]# (18, 306)
xy_starfind2 = xy_starfind.T[~bad_matches].T
new_sky_coordinates2 = new_sky_coordinates.T[~bad_matches].T
new_wcs2 = fit_wcs_from_points(xy_starfind2, new_sky_coordinates2, sip_degree=5)
new_ra2, new_dec2 = new_wcs2.wcs_pix2world(starcat['xcentroid'], starcat['ycentroid'], 0)*u.deg
ra_residual2 = (new_ra2-new_sky_coordinates.ra).to(u.arcsec)
dec_residual2 = (new_dec2-new_sky_coordinates.dec).to(u.arcsec)
pl.plot(ra_residual2, dec_residual2, 'x')
pl.grid()
new_wcs2
#[Out]# WCS Keywords
#[Out]# 
#[Out]# Number of WCS axes: 2
#[Out]# CTYPE : 'RA---TAN-SIP'  'DEC--TAN-SIP'  
#[Out]# CRVAL : 290.9207853485614  14.506229880371471  
#[Out]# CRPIX : 1046.3163236240405  1015.9667681102915  
#[Out]# CD1_1 CD1_2  : -5.333872977511008e-05  -2.094224209175517e-08  
#[Out]# CD2_1 CD2_2  : -9.090479506084803e-09  -5.3297185992530433e-05  
#[Out]# NAXIS : 2000.7783858533226  2028.2073632349282
new_wcs2
#[Out]# WCS Keywords
#[Out]# 
#[Out]# Number of WCS axes: 2
#[Out]# CTYPE : 'RA---TAN-SIP'  'DEC--TAN-SIP'  
#[Out]# CRVAL : 290.9207853485614  14.506229880371471  
#[Out]# CRPIX : 1046.3163236240405  1015.9667681102915  
#[Out]# CD1_1 CD1_2  : -5.333872977511008e-05  -2.094224209175517e-08  
#[Out]# CD2_1 CD2_2  : -9.090479506084803e-09  -5.3297185992530433e-05  
#[Out]# NAXIS : 2000.7783858533226  2028.2073632349282
pl.figure(figsize=(24,24))
ax = pl.subplot(projection=new_wcs2)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
pl.plot(starcat['xcentroid'], starcat['ycentroid'], 'wx')
pl.plot(table_coordinates.ra,
        table_coordinates.dec,
        transform=ax.get_transform('world'), marker='x', color='r', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
pl.figure(figsize=(24,24))
ax = pl.subplot(projection=new_wcs2)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
pl.plot(starcat['xcentroid'], starcat['ycentroid'], 'k+')
pl.plot(table_coordinates.ra,
        table_coordinates.dec,
        transform=ax.get_transform('world'), marker='x', color='r', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
pl.figure(figsize=(24,24))
ax = pl.subplot(projection=new_wcs2)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
pl.plot(starcat['xcentroid'], starcat['ycentroid'], 'wo', markeredgecolor='w', markerfacecolor='none')
pl.plot(table_coordinates.ra,
        table_coordinates.dec,
        transform=ax.get_transform('world'), marker='x', color='r', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
#pl.quiver(new_ra.value, new_dec.value, ra_residual2.value, dec_residual2.value, color='w')
pl.quiver(new_ra.value[bad_matches], new_dec.value[bad_matches], ra_residual2.value[bad_matches], dec_residual2.value[bad_matches], color='r')
pl.quiver(new_ra.value[~bad_matches], new_dec.value[~bad_matches], ra_residual2.value[~bad_matches], dec_residual2.value[~bad_matches], color='w')
#[Out]# <matplotlib.quiver.Quiver at 0x2ae8507549e8>
ygrid, xgrid = np.mgrid[0:2048:128, 0:2048:128]
r1,d1 = ww.all_pix2world(xgrid, ygrid, 0)
r2,d2 = new_wcs2.all_pix2world(xgrid, ygrid, 0)
pl.quiver(xgrid, ygrid, r1-r2, d1-d2, color='w')
#[Out]# <matplotlib.quiver.Quiver at 0x2ae84f988b38>
ygrid, xgrid = np.mgrid[0:2048:128, 0:2048:128]
# this doesn't do anything because the original "ww" didn't have SIP coefficients (x1 == xgrid exactly)
x1,y1 = ww.sip_pix2foc(xgrid, ygrid, 0)
# `sip_pix2foc` returns locations relative to crpix, so we redefine x1,x2 to be relative to crpix
x1,y1 = xgrid - ww.wcs.crpix[0], ygrid - ww.wcs.crpix[1]
x2,y2 = new_wcs2.sip_pix2foc(xgrid, ygrid, 0)
pl.quiver(xgrid, ygrid, x1-x2, y1-y2, color='w')
#[Out]# <matplotlib.quiver.Quiver at 0x2ae84f601f60>
xy_starfind2 = xy_starfind.T[~bad_matches].T
new_sky_coordinates2 = new_sky_coordinates.T[~bad_matches].T
new_wcs2 = fit_wcs_from_points(xy_starfind2, new_sky_coordinates2, sip_degree=4)
new_ra2, new_dec2 = new_wcs2.wcs_pix2world(starcat['xcentroid'], starcat['ycentroid'], 0)*u.deg
ra_residual2 = (new_ra2-new_sky_coordinates.ra).to(u.arcsec)
dec_residual2 = (new_dec2-new_sky_coordinates.dec).to(u.arcsec)
pl.plot(ra_residual2, dec_residual2, 'x')
pl.grid()
xy_starfind2 = xy_starfind.T[~bad_matches].T
new_sky_coordinates2 = new_sky_coordinates.T[~bad_matches].T
new_wcs2 = fit_wcs_from_points(xy_starfind2, new_sky_coordinates2, sip_degree=6)
new_ra2, new_dec2 = new_wcs2.wcs_pix2world(starcat['xcentroid'], starcat['ycentroid'], 0)*u.deg
ra_residual2 = (new_ra2-new_sky_coordinates.ra).to(u.arcsec)
dec_residual2 = (new_dec2-new_sky_coordinates.dec).to(u.arcsec)
pl.plot(ra_residual2, dec_residual2, 'x')
pl.grid()
xy_starfind2 = xy_starfind.T[~bad_matches].T
new_sky_coordinates2 = new_sky_coordinates.T[~bad_matches].T
new_wcs2 = fit_wcs_from_points(xy_starfind2, new_sky_coordinates2, sip_degree=3)
new_ra2, new_dec2 = new_wcs2.wcs_pix2world(starcat['xcentroid'], starcat['ycentroid'], 0)*u.deg
ra_residual2 = (new_ra2-new_sky_coordinates.ra).to(u.arcsec)
dec_residual2 = (new_dec2-new_sky_coordinates.dec).to(u.arcsec)
pl.plot(ra_residual2, dec_residual2, 'x')
pl.grid()
new_wcs2
#[Out]# WCS Keywords
#[Out]# 
#[Out]# Number of WCS axes: 2
#[Out]# CTYPE : 'RA---TAN-SIP'  'DEC--TAN-SIP'  
#[Out]# CRVAL : 290.9207853485614  14.506229880371471  
#[Out]# CRPIX : 1045.9486807512487  1016.101600741903  
#[Out]# CD1_1 CD1_2  : -5.399683343456797e-05  -1.7692217065600958e-09  
#[Out]# CD2_1 CD2_2  : 4.061043497272642e-08  -5.403636528255915e-05  
#[Out]# NAXIS : 2000.7783858533226  2028.2073632349282
pl.figure(figsize=(24,24))
ax = pl.subplot(projection=new_wcs2)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
pl.plot(starcat['xcentroid'], starcat['ycentroid'], 'wo', markeredgecolor='w', markerfacecolor='none')
pl.plot(table_coordinates.ra,
        table_coordinates.dec,
        transform=ax.get_transform('world'), marker='x', color='r', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
#pl.quiver(new_ra.value, new_dec.value, ra_residual2.value, dec_residual2.value, color='w')
pl.quiver(new_ra.value[bad_matches], new_dec.value[bad_matches], ra_residual2.value[bad_matches], dec_residual2.value[bad_matches], color='r')
pl.quiver(new_ra.value[~bad_matches], new_dec.value[~bad_matches], ra_residual2.value[~bad_matches], dec_residual2.value[~bad_matches], color='w')
#[Out]# <matplotlib.quiver.Quiver at 0x2ae84d616198>
ygrid, xgrid = np.mgrid[0:2048:128, 0:2048:128]
r1,d1 = ww.all_pix2world(xgrid, ygrid, 0)
r2,d2 = new_wcs2.all_pix2world(xgrid, ygrid, 0)
pl.quiver(xgrid, ygrid, r1-r2, d1-d2, color='w')
#[Out]# <matplotlib.quiver.Quiver at 0x2ae84ce18978>
ygrid, xgrid = np.mgrid[0:2048:128, 0:2048:128]
# this doesn't do anything because the original "ww" didn't have SIP coefficients (x1 == xgrid exactly)
x1,y1 = ww.sip_pix2foc(xgrid, ygrid, 0)
# `sip_pix2foc` returns locations relative to crpix, so we redefine x1,x2 to be relative to crpix
x1,y1 = xgrid - ww.wcs.crpix[0], ygrid - ww.wcs.crpix[1]
x2,y2 = new_wcs2.sip_pix2foc(xgrid, ygrid, 0)
pl.quiver(xgrid, ygrid, x1-x2, y1-y2, color='w')
#[Out]# <matplotlib.quiver.Quiver at 0x2ae84ca8f0f0>
ygrid, xgrid = np.mgrid[0:2048:128, 0:2048:128]
r1,d1 = ww.all_pix2world(xgrid, ygrid, 0)
r2,d2 = new_wcs2.all_pix2world(xgrid, ygrid, 0)
pl.quiver(xgrid, ygrid, r1-r2, d1-d2, color='w')
#[Out]# <matplotlib.quiver.Quiver at 0x2ae84a4c1e80>
ygrid, xgrid = np.mgrid[0:2048:128, 0:2048:128]
r1,d1 = ww.all_pix2world(xgrid, ygrid, 0)
r2,d2 = new_wcs2.all_pix2world(xgrid, ygrid, 0)
pl.quiver(xgrid, ygrid, r2-r1, d2-d1, color='w')
#[Out]# <matplotlib.quiver.Quiver at 0x2ae8506f8b38>
xy_starfind2 = xy_starfind.T[~bad_matches].T
new_sky_coordinates2 = new_sky_coordinates.T[~bad_matches].T
new_wcs2 = fit_wcs_from_points(xy_starfind2, new_sky_coordinates2, sip_degree=5)
new_ra2, new_dec2 = new_wcs2.wcs_pix2world(starcat['xcentroid'], starcat['ycentroid'], 0)*u.deg
ra_residual2 = (new_ra2-new_sky_coordinates.ra).to(u.arcsec)
dec_residual2 = (new_dec2-new_sky_coordinates.dec).to(u.arcsec)
pl.plot(ra_residual2, dec_residual2, 'x')
pl.grid()
new_wcs2
#[Out]# WCS Keywords
#[Out]# 
#[Out]# Number of WCS axes: 2
#[Out]# CTYPE : 'RA---TAN-SIP'  'DEC--TAN-SIP'  
#[Out]# CRVAL : 290.9207853485614  14.506229880371471  
#[Out]# CRPIX : 1046.3163236240405  1015.9667681102915  
#[Out]# CD1_1 CD1_2  : -5.333872977511008e-05  -2.094224209175517e-08  
#[Out]# CD2_1 CD2_2  : -9.090479506084803e-09  -5.3297185992530433e-05  
#[Out]# NAXIS : 2000.7783858533226  2028.2073632349282
pl.figure(figsize=(24,24))
ax = pl.subplot(projection=new_wcs2)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
pl.plot(starcat['xcentroid'], starcat['ycentroid'], 'wo', markeredgecolor='w', markerfacecolor='none')
pl.plot(table_coordinates.ra,
        table_coordinates.dec,
        transform=ax.get_transform('world'), marker='x', color='r', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
#pl.quiver(new_ra.value, new_dec.value, ra_residual2.value, dec_residual2.value, color='w')
pl.quiver(new_ra.value[bad_matches], new_dec.value[bad_matches], ra_residual2.value[bad_matches], dec_residual2.value[bad_matches], color='r')
pl.quiver(new_ra.value[~bad_matches], new_dec.value[~bad_matches], ra_residual2.value[~bad_matches], dec_residual2.value[~bad_matches], color='w')
#[Out]# <matplotlib.quiver.Quiver at 0x2ae850c96cc0>
ygrid, xgrid = np.mgrid[0:2048:128, 0:2048:128]
r1,d1 = ww.all_pix2world(xgrid, ygrid, 0)
r2,d2 = new_wcs2.all_pix2world(xgrid, ygrid, 0)
pl.quiver(xgrid, ygrid, r2-r1, d2-d1, color='w')
#[Out]# <matplotlib.quiver.Quiver at 0x2ae850d44cc0>
ygrid, xgrid = np.mgrid[0:2048:128, 0:2048:128]
# this doesn't do anything because the original "ww" didn't have SIP coefficients (x1 == xgrid exactly)
x1,y1 = ww.sip_pix2foc(xgrid, ygrid, 0)
# `sip_pix2foc` returns locations relative to crpix, so we redefine x1,x2 to be relative to crpix
x1,y1 = xgrid - ww.wcs.crpix[0], ygrid - ww.wcs.crpix[1]
x2,y2 = new_wcs2.sip_pix2foc(xgrid, ygrid, 0)
pl.quiver(xgrid, ygrid, x1-x2, y1-y2, color='w')
#[Out]# <matplotlib.quiver.Quiver at 0x2ae850890d68>
xy_starfind2 = xy_starfind.T[~bad_matches].T
new_sky_coordinates2 = new_sky_coordinates.T[~bad_matches].T
new_wcs2 = fit_wcs_from_points(xy_starfind2, new_sky_coordinates2, sip_degree=3)
new_ra2, new_dec2 = new_wcs2.wcs_pix2world(starcat['xcentroid'], starcat['ycentroid'], 0)*u.deg
ra_residual2 = (new_ra2-new_sky_coordinates.ra).to(u.arcsec)
dec_residual2 = (new_dec2-new_sky_coordinates.dec).to(u.arcsec)
pl.plot(ra_residual2, dec_residual2, 'x')
pl.grid()
new_wcs2
#[Out]# WCS Keywords
#[Out]# 
#[Out]# Number of WCS axes: 2
#[Out]# CTYPE : 'RA---TAN-SIP'  'DEC--TAN-SIP'  
#[Out]# CRVAL : 290.9207853485614  14.506229880371471  
#[Out]# CRPIX : 1045.9486807512487  1016.101600741903  
#[Out]# CD1_1 CD1_2  : -5.399683343456797e-05  -1.7692217065600958e-09  
#[Out]# CD2_1 CD2_2  : 4.061043497272642e-08  -5.403636528255915e-05  
#[Out]# NAXIS : 2000.7783858533226  2028.2073632349282
pl.figure(figsize=(24,24))
ax = pl.subplot(projection=new_wcs2)
pl.imshow(filehandle[0].data, norm=visualization.simple_norm(filehandle[0].data, min_percent=1, max_percent=99.9))
pl.plot(starcat['xcentroid'], starcat['ycentroid'], 'wo', markeredgecolor='w', markerfacecolor='none')
pl.plot(table_coordinates.ra,
        table_coordinates.dec,
        transform=ax.get_transform('world'), marker='x', color='r', linestyle='none')
ax.axis(axlims)
#[Out]# (-0.5, 2047.5, -0.5, 2047.5)
#pl.quiver(new_ra.value, new_dec.value, ra_residual2.value, dec_residual2.value, color='w')
pl.quiver(new_ra.value[bad_matches], new_dec.value[bad_matches], ra_residual2.value[bad_matches], dec_residual2.value[bad_matches], color='r')
pl.quiver(new_ra.value[~bad_matches], new_dec.value[~bad_matches], ra_residual2.value[~bad_matches], dec_residual2.value[~bad_matches], color='w')
#[Out]# <matplotlib.quiver.Quiver at 0x2ae8507aee10>
ygrid, xgrid = np.mgrid[0:2048:128, 0:2048:128]
r1,d1 = ww.all_pix2world(xgrid, ygrid, 0)
r2,d2 = new_wcs2.all_pix2world(xgrid, ygrid, 0)
pl.quiver(xgrid, ygrid, r2-r1, d2-d1, color='w')
#[Out]# <matplotlib.quiver.Quiver at 0x2ae8506b9fd0>
ygrid, xgrid = np.mgrid[0:2048:128, 0:2048:128]
# this doesn't do anything because the original "ww" didn't have SIP coefficients (x1 == xgrid exactly)
x1,y1 = ww.sip_pix2foc(xgrid, ygrid, 0)
# `sip_pix2foc` returns locations relative to crpix, so we redefine x1,x2 to be relative to crpix
x1,y1 = xgrid - ww.wcs.crpix[0], ygrid - ww.wcs.crpix[1]
x2,y2 = new_wcs2.sip_pix2foc(xgrid, ygrid, 0)
pl.quiver(xgrid, ygrid, x1-x2, y1-y2, color='w')
#[Out]# <matplotlib.quiver.Quiver at 0x2ae850b49080>
