Loading observation_sim/instruments/chip/effects.py +1 −1 Original line number Original line Diff line number Diff line Loading @@ -793,7 +793,7 @@ def ShutterEffectArr(GSImage, t_exp=150, t_shutter=1.3, dist_bearing=735, dt=1E- sizey = ymax-ymin+1 sizey = ymax-ymin+1 xnewgrid = np.mgrid[xmin:(xmin+sizex)] xnewgrid = np.mgrid[xmin:(xmin+sizex)] expeffect = interpolate.splev(xnewgrid, intp, der=0) expeffect = interpolate.splev(xnewgrid, intp, der=0) expeffect /= np.max(expeffect) expeffect /= t_exp exparrnormal = np.tile(expeffect, (sizey,1)) exparrnormal = np.tile(expeffect, (sizey,1)) # GSImage *= exparrnormal # GSImage *= exparrnormal Loading observation_sim/sim_steps/readout_output.py +4 −4 Original line number Original line Diff line number Diff line Loading @@ -86,10 +86,10 @@ def quantization_and_output(self, chip, filt, tel, pointing, catalog, obs_param) fname = os.path.join(self.chip_output.subdir, fname = os.path.join(self.chip_output.subdir, self.h_prim['FILENAME'] + '.fits') self.h_prim['FILENAME'] + '.fits') f_name_size = 68 # f_name_size = 68 if (len(self.h_prim['FILENAME']) > f_name_size): # if (len(self.h_prim['FILENAME']) > f_name_size): self.updateHeaderInfo(header_flag='prim', keys=['FILENAME'], values=[ # self.updateHeaderInfo(header_flag='prim', keys=['FILENAME'], values=[ self.h_prim['FILENAME'][0:f_name_size]]) # self.h_prim['FILENAME'][0:f_name_size]]) hdu1 = fits.PrimaryHDU(header=self.h_prim) hdu1 = fits.PrimaryHDU(header=self.h_prim) Loading tools/get_pointing.py +13 −9 Original line number Original line Diff line number Diff line Loading @@ -63,10 +63,15 @@ class Chip(object): ycen = self.cen_pix_y ycen = self.cen_pix_y if pix_scale == None: if pix_scale == None: pix_scale = self.pix_scale pix_scale = self.pix_scale # dudx = -np.cos(img_rot.rad) * pix_scale # dudy = -np.sin(img_rot.rad) * pix_scale # dvdx = -np.sin(img_rot.rad) * pix_scale # dvdy = +np.cos(img_rot.rad) * pix_scale dudx = -np.cos(img_rot.rad) * pix_scale dudx = -np.cos(img_rot.rad) * pix_scale dudy = -np.sin(img_rot.rad) * pix_scale dudy = +np.sin(img_rot.rad) * pix_scale dvdx = -np.sin(img_rot.rad) * pix_scale dvdx = -np.sin(img_rot.rad) * pix_scale dvdy = +np.cos(img_rot.rad) * pix_scale dvdy = -np.cos(img_rot.rad) * pix_scale # dudx = +np.sin(img_rot.rad) * pix_scale # dudx = +np.sin(img_rot.rad) * pix_scale # dudy = +np.cos(img_rot.rad) * pix_scale # dudy = +np.cos(img_rot.rad) * pix_scale Loading Loading @@ -139,12 +144,11 @@ def getobsPA(ra, dec): angle = math.acos(np.dot(l1l2cross,pdl2cross)/(np.linalg.norm(l1l2cross)*np.linalg.norm(pdl2cross))) angle = math.acos(np.dot(l1l2cross,pdl2cross)/(np.linalg.norm(l1l2cross)*np.linalg.norm(pdl2cross))) angle = (angle)/math.pi*180 angle = (angle)/math.pi*180 angle = angle + 90 # if (ra>90 and ra< 270): if (ra<90 or ra> 270): # angle=-angle angle=-angle return angle return angle # @jit() # @jit() def getSelectPointingList(center = [60,-40], radius = 2): def getSelectPointingList(center = [60,-40], radius = 2): points = np.loadtxt('sky.dat') points = np.loadtxt('sky.dat') Loading Loading @@ -261,7 +265,7 @@ def findPointingbyChipID(chipID = 8, ra = 60., dec = -40.): if __name__ == "__main__": if __name__ == "__main__": tchip, tra, tdec = 8, 60., -40. tchip, tra, tdec = 13, 60., -40. pointing = findPointingbyChipID(chipID=tchip, ra=tra, dec=tdec) pointing = findPointingbyChipID(chipID=tchip, ra=tra, dec=tdec) print("[ra_center, dec_center, image_rot]: ", pointing) print("[ra_center, dec_center, image_rot]: ", pointing) tools/target_location_check.py +7 −2 Original line number Original line Diff line number Diff line Loading @@ -119,10 +119,15 @@ def getTanWCS(ra, dec, img_rot, pix_scale=0.074): """ """ xcen, ycen = 0, 0 xcen, ycen = 0, 0 img_rot = img_rot * galsim.degrees img_rot = img_rot * galsim.degrees # dudx = -np.cos(img_rot.rad) * pix_scale # dudy = -np.sin(img_rot.rad) * pix_scale # dvdx = -np.sin(img_rot.rad) * pix_scale # dvdy = +np.cos(img_rot.rad) * pix_scale dudx = -np.cos(img_rot.rad) * pix_scale dudx = -np.cos(img_rot.rad) * pix_scale dudy = -np.sin(img_rot.rad) * pix_scale dudy = +np.sin(img_rot.rad) * pix_scale dvdx = -np.sin(img_rot.rad) * pix_scale dvdx = -np.sin(img_rot.rad) * pix_scale dvdy = +np.cos(img_rot.rad) * pix_scale dvdy = -np.cos(img_rot.rad) * pix_scale moscen = galsim.PositionD(x=xcen, y=ycen) moscen = galsim.PositionD(x=xcen, y=ycen) sky_center = galsim.CelestialCoord( sky_center = galsim.CelestialCoord( Loading Loading
observation_sim/instruments/chip/effects.py +1 −1 Original line number Original line Diff line number Diff line Loading @@ -793,7 +793,7 @@ def ShutterEffectArr(GSImage, t_exp=150, t_shutter=1.3, dist_bearing=735, dt=1E- sizey = ymax-ymin+1 sizey = ymax-ymin+1 xnewgrid = np.mgrid[xmin:(xmin+sizex)] xnewgrid = np.mgrid[xmin:(xmin+sizex)] expeffect = interpolate.splev(xnewgrid, intp, der=0) expeffect = interpolate.splev(xnewgrid, intp, der=0) expeffect /= np.max(expeffect) expeffect /= t_exp exparrnormal = np.tile(expeffect, (sizey,1)) exparrnormal = np.tile(expeffect, (sizey,1)) # GSImage *= exparrnormal # GSImage *= exparrnormal Loading
observation_sim/sim_steps/readout_output.py +4 −4 Original line number Original line Diff line number Diff line Loading @@ -86,10 +86,10 @@ def quantization_and_output(self, chip, filt, tel, pointing, catalog, obs_param) fname = os.path.join(self.chip_output.subdir, fname = os.path.join(self.chip_output.subdir, self.h_prim['FILENAME'] + '.fits') self.h_prim['FILENAME'] + '.fits') f_name_size = 68 # f_name_size = 68 if (len(self.h_prim['FILENAME']) > f_name_size): # if (len(self.h_prim['FILENAME']) > f_name_size): self.updateHeaderInfo(header_flag='prim', keys=['FILENAME'], values=[ # self.updateHeaderInfo(header_flag='prim', keys=['FILENAME'], values=[ self.h_prim['FILENAME'][0:f_name_size]]) # self.h_prim['FILENAME'][0:f_name_size]]) hdu1 = fits.PrimaryHDU(header=self.h_prim) hdu1 = fits.PrimaryHDU(header=self.h_prim) Loading
tools/get_pointing.py +13 −9 Original line number Original line Diff line number Diff line Loading @@ -63,10 +63,15 @@ class Chip(object): ycen = self.cen_pix_y ycen = self.cen_pix_y if pix_scale == None: if pix_scale == None: pix_scale = self.pix_scale pix_scale = self.pix_scale # dudx = -np.cos(img_rot.rad) * pix_scale # dudy = -np.sin(img_rot.rad) * pix_scale # dvdx = -np.sin(img_rot.rad) * pix_scale # dvdy = +np.cos(img_rot.rad) * pix_scale dudx = -np.cos(img_rot.rad) * pix_scale dudx = -np.cos(img_rot.rad) * pix_scale dudy = -np.sin(img_rot.rad) * pix_scale dudy = +np.sin(img_rot.rad) * pix_scale dvdx = -np.sin(img_rot.rad) * pix_scale dvdx = -np.sin(img_rot.rad) * pix_scale dvdy = +np.cos(img_rot.rad) * pix_scale dvdy = -np.cos(img_rot.rad) * pix_scale # dudx = +np.sin(img_rot.rad) * pix_scale # dudx = +np.sin(img_rot.rad) * pix_scale # dudy = +np.cos(img_rot.rad) * pix_scale # dudy = +np.cos(img_rot.rad) * pix_scale Loading Loading @@ -139,12 +144,11 @@ def getobsPA(ra, dec): angle = math.acos(np.dot(l1l2cross,pdl2cross)/(np.linalg.norm(l1l2cross)*np.linalg.norm(pdl2cross))) angle = math.acos(np.dot(l1l2cross,pdl2cross)/(np.linalg.norm(l1l2cross)*np.linalg.norm(pdl2cross))) angle = (angle)/math.pi*180 angle = (angle)/math.pi*180 angle = angle + 90 # if (ra>90 and ra< 270): if (ra<90 or ra> 270): # angle=-angle angle=-angle return angle return angle # @jit() # @jit() def getSelectPointingList(center = [60,-40], radius = 2): def getSelectPointingList(center = [60,-40], radius = 2): points = np.loadtxt('sky.dat') points = np.loadtxt('sky.dat') Loading Loading @@ -261,7 +265,7 @@ def findPointingbyChipID(chipID = 8, ra = 60., dec = -40.): if __name__ == "__main__": if __name__ == "__main__": tchip, tra, tdec = 8, 60., -40. tchip, tra, tdec = 13, 60., -40. pointing = findPointingbyChipID(chipID=tchip, ra=tra, dec=tdec) pointing = findPointingbyChipID(chipID=tchip, ra=tra, dec=tdec) print("[ra_center, dec_center, image_rot]: ", pointing) print("[ra_center, dec_center, image_rot]: ", pointing)
tools/target_location_check.py +7 −2 Original line number Original line Diff line number Diff line Loading @@ -119,10 +119,15 @@ def getTanWCS(ra, dec, img_rot, pix_scale=0.074): """ """ xcen, ycen = 0, 0 xcen, ycen = 0, 0 img_rot = img_rot * galsim.degrees img_rot = img_rot * galsim.degrees # dudx = -np.cos(img_rot.rad) * pix_scale # dudy = -np.sin(img_rot.rad) * pix_scale # dvdx = -np.sin(img_rot.rad) * pix_scale # dvdy = +np.cos(img_rot.rad) * pix_scale dudx = -np.cos(img_rot.rad) * pix_scale dudx = -np.cos(img_rot.rad) * pix_scale dudy = -np.sin(img_rot.rad) * pix_scale dudy = +np.sin(img_rot.rad) * pix_scale dvdx = -np.sin(img_rot.rad) * pix_scale dvdx = -np.sin(img_rot.rad) * pix_scale dvdy = +np.cos(img_rot.rad) * pix_scale dvdy = -np.cos(img_rot.rad) * pix_scale moscen = galsim.PositionD(x=xcen, y=ycen) moscen = galsim.PositionD(x=xcen, y=ycen) sky_center = galsim.CelestialCoord( sky_center = galsim.CelestialCoord( Loading