Commit 22bb38f4 authored by xin's avatar xin
Browse files

modify header keyword and some value; fix spec bug, shift 1 pixel

parent 379dedfb
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -332,7 +332,7 @@ def generatePrimaryHeader(xlen = 9216, ylen = 9232, pointNum = '1', ra = 60, dec
    h_prim['TIME'] = time_obs[0:2]+':'+time_obs[2:4]+':'+time_obs[4:6]
    h_prim['TIME'] = time_obs[0:2]+':'+time_obs[2:4]+':'+time_obs[4:6]
    h_prim['DATE-OBS'] = '20'+date[0:2]+'-' + date[2:4]+'-'+date[4:6]
    h_prim['DATE-OBS'] = '20'+date[0:2]+'-' + date[2:4]+'-'+date[4:6]
    h_prim['TIME-OBS'] = time_obs[0:2]+':'+time_obs[2:4]+':'+time_obs[4:6]
    h_prim['TIME-OBS'] = time_obs[0:2]+':'+time_obs[2:4]+':'+time_obs[4:6]
    h_prim['DETECTOR'] = 'CCD'+CCDID[k-1].rjust(2,'0')
    h_prim['DETECTOR'] = 'CHIP'+CCDID[k-1].rjust(2,'0')
    h_prim['RA_OBJ'] = ra
    h_prim['RA_OBJ'] = ra
    h_prim['DEC_OBJ'] = dec
    h_prim['DEC_OBJ'] = dec
    h_prim['OBJECT'] = '1'+ pointNum.rjust(8,'0')
    h_prim['OBJECT'] = '1'+ pointNum.rjust(8,'0')
@@ -341,8 +341,8 @@ def generatePrimaryHeader(xlen = 9216, ylen = 9232, pointNum = '1', ra = 60, dec
    h_prim['EXPTIME'] = exptime
    h_prim['EXPTIME'] = exptime
    
    
    # Define file types
    # Define file types
    file_type = {'SCI':'sci', 'BIAS':'zero', 'DARK':'dark', 'FLAT':'flat', 'CRS':'cosmic_ray', 'CRD':'cosmic_ray'}
    file_type = {'SCI':'sci', 'BIAS':'bias', 'DARK':'dark', 'FLAT':'flat', 'CRS':'cosmic_ray', 'CRD':'cosmic_ray'}
    h_prim['FILETYPE'] = file_type[im_type]
    h_prim['OBSTYPE'] = file_type[im_type]


    co = coord.SkyCoord(ra, dec, unit='deg')
    co = coord.SkyCoord(ra, dec, unit='deg')


+1 −1
Original line number Original line Diff line number Diff line
XTENSION= 'IMAGE   '           / Image extension                                BITPIX  =                   16 / array data type                                NAXIS   =                    2 / number of array dimensions                     NAXIS1  =                 9216 / length of first array axis                     NAXIS2  =                 9232 / length of second array axis                    PCOUNT  =                    0                                                  GCOUNT  =                    1                                                  EXTNAME = 'SCI     '                                                            EXTVER  =                    1                                                  BSCALE  =                    1                                                  BZERO   =                32768                                                  BUNIT   = 'ADU     '                                                            COMMENT ==================================================================      COMMENT CCD chip information                                                    COMMENT ==================================================================      NCHAN   =                   16 / Number of readout channels                     NCHAN1  =                    8 / Number of horizintal channels                  NCHAN2  =                    2 / Number of vertical channels                    DETSIZE = '[1:9216:9232]'      / detector size                                  BIASSEC = '[9216:9217,9232:9234]' / bias section                                CCDCHIP =                    6 / CCD chip ID                                    CCDLABEL= 'y-1     '           / CCD chip label                                 PSCAN1  =                   27 / horizontal prescan width                       PSCAN2  =                    8 / vertical prescan height                        OSCAN1  =                   16 / horizontal overscan width                      OSCAN2  =                    8 / vertical overscan height                       FILTER  = 'y       '           / filter name                                    COMMENT ==================================================================      COMMENT WORLD COORDINATE SYSTEM AND RELATED PARAMETERS                          COMMENT ==================================================================      WCSDIM  =                    2 / Number of World Coordinate System axes         EQUINOX =               2000.0 / Epoch (year)                                   CRPIX1  =             -10017.0 / Coordinate reference pixel of x                CRPIX2  =              24876.0 / Coordinate reference pixel of y                CRVAL1  =            62.228226 / Coordinate reference value of x                CRVAL2  =           -42.316932 / Coordinate reference value of y                CTYPE1  = 'RA---TAN'           / the coordinate type                            CTYPE2  = 'DEC--TAN'           / the coordinate type                            CD1_1   = 1.88602083707394E-05 / partial of first axis coordinate of x          CD2_1   = -8.1745583617600E-06 / partial of first axis coordinate of y          CD1_2   = 8.17455836176000E-06 / partial of second axis coordinate of x         CD2_2   = 1.88602083707394E-05 / partial of second axis coordinate of y         POS_ANG =                 30.0 / Positon angle of detector array                COMMENT ==================================================================      COMMENT Readout information                                                     COMMENT ==================================================================      GAIN1   =                  1.1 / CCD gain                                       RDNOISE1=                  5.0 / read noise                                     READTIME=                 40.0 / read time (sec)                                RDSPEED =                 10.0 / read speed (in MHz)                            CHIPTEMP=               -100.0 / chip temperature (in K)                        COMMENT ==================================================================      COMMENT Other information                                                       COMMENT ==================================================================      CHECKSUM= '''abcde'''          / SHA256 checksum of global headers              END                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
XTENSION= 'IMAGE   '           / Image extension                                BITPIX  =                   16 / array data type                                NAXIS   =                    2 / number of array dimensions                     NAXIS1  =                 9216 / length of first array axis                     NAXIS2  =                 9232 / length of second array axis                    PCOUNT  =                    0                                                  GCOUNT  =                    1                                                  EXTNAME = 'SCI     '                                                            EXTVER  =                    1                                                  BSCALE  =                    1                                                  BZERO   =                32768                                                  BUNIT   = 'ADU     '                                                            COMMENT ==================================================================      COMMENT CCD chip information                                                    COMMENT ==================================================================      NCHAN   =                   16 / Number of readout channels                     NCHAN1  =                    8 / Number of horizintal channels                  NCHAN2  =                    2 / Number of vertical channels                    DETSIZE = '[1:9216:9232]'      / detector size                                  BIASSEC = '[9216:9217,9232:9234]' / bias section                                CCDCHIP =                    6 / CCD chip ID                                    CCDLABEL= 'y-1     '           / CCD chip label                                 PSCAN1  =                   27 / horizontal prescan width                       PSCAN2  =                    8 / vertical prescan height                        OSCAN1  =                   16 / horizontal overscan width                      OSCAN2  =                    8 / vertical overscan height                       FILTER  = 'y       '           / filter name                                    COMMENT ==================================================================      COMMENT WORLD COORDINATE SYSTEM AND RELATED PARAMETERS                          COMMENT ==================================================================      WCSDIM  =                    2 / Number of World Coordinate System axes         EQUINOX =               2000.0 / Epoch (year)                                   CRPIX1  =             -10017.0 / Coordinate reference pixel of x                CRPIX2  =              24876.0 / Coordinate reference pixel of y                CRVAL1  =            62.228226 / Coordinate reference value of x                CRVAL2  =           -42.316932 / Coordinate reference value of y                CTYPE1  = 'RA---TAN'           / the coordinate type                            CTYPE2  = 'DEC--TAN'           / the coordinate type                            CD1_1   = 1.88602083707394E-05 / partial of first axis coordinate of x          CD2_1   = -8.1745583617600E-06 / partial of first axis coordinate of y          CD1_2   = 8.17455836176000E-06 / partial of second axis coordinate of x         CD2_2   = 1.88602083707394E-05 / partial of second axis coordinate of y         POS_ANG =                 30.0 / Positon angle of detector array                COMMENT ==================================================================      COMMENT Readout information                                                     COMMENT ==================================================================      GAIN1   =                  1.1 / CCD gain                                       RDNOISE1=                  5.0 / read noise                                     READTIME=                 40.0 / read time (sec)                                RDSPEED =                 10.0 / read speed (in MHz)                            CHIPTEMP=                173.0 / chip temperature (in K)                        COMMENT ==================================================================      COMMENT Other information                                                       COMMENT ==================================================================      CHECKSUM= '''abcde'''          / SHA256 checksum of global headers              END                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

+2 −0
Original line number Original line Diff line number Diff line
@@ -313,7 +313,9 @@ class Chip(FocalPlane):
            time_obs=time_obs,
            time_obs=time_obs,
            exptime=exptime)
            exptime=exptime)
        hdu1 = fits.PrimaryHDU(header=h_prim)
        hdu1 = fits.PrimaryHDU(header=h_prim)
        hdu1.add_checksum()
        hdu2 = fits.ImageHDU(img.array, header=h_ext)
        hdu2 = fits.ImageHDU(img.array, header=h_ext)
        hdu2.add_checksum()
        hdu1 = fits.HDUList([hdu1, hdu2])
        hdu1 = fits.HDUList([hdu1, hdu2])
        fname = os.path.join(output_dir, h_prim['FILENAME']+'.fits')
        fname = os.path.join(output_dir, h_prim['FILENAME']+'.fits')
        hdu1.writeto(fname, output_verify='ignore', overwrite=True)
        hdu1.writeto(fname, output_verify='ignore', overwrite=True)
+1 −1
Original line number Original line Diff line number Diff line
@@ -306,7 +306,7 @@ class Galaxy(MockObject):
            gal = gal.shear(gal_shear)
            gal = gal.shear(gal_shear)
            gal = galsim.Convolve(psf, gal)
            gal = galsim.Convolve(psf, gal)


            starImg = gal.drawImage(wcs=real_wcs_local)
            starImg = gal.drawImage(wcs=real_wcs_local, offset=offset)


            origin_star = [y_nominal - (starImg.center.y - starImg.ymin),
            origin_star = [y_nominal - (starImg.center.y - starImg.ymin),
                           x_nominal - (starImg.center.x - starImg.xmin)]
                           x_nominal - (starImg.center.x - starImg.xmin)]
Loading