Commit df22b3b0 authored by Fang Yuedong's avatar Fang Yuedong
Browse files

Merge branch 'master' into 'release_v3.0'

Release version v3.2.0

See merge request !33
parents 1b4f4012 428f2c1e
......@@ -79,7 +79,7 @@ for iobj in range(nobj):
if True:
fn = "psf_{:}.{:}.{:}.fits".format(chipID, iobj, i)
if fn != None:
if fn is not None:
if os.path.exists(fn):
os.remove(fn)
hdu = fitsio.PrimaryHDU()
......
......@@ -2,7 +2,7 @@
# get_pointing
# PURPOSE:
# Return the pointing of CSST from a given [ra, dec]
# CALLING:
# CALLING:
# pointing = findPointingbyChipID(chipID=tchip, ra=tra, dec=tdec)
# INPUTS:
# chipID - chip-# of CSST, int
......@@ -13,8 +13,8 @@
# HISTORY:
# Written by Xin Zhang, 23 Apr. 2023
# Included by csst-simulation, C.W. 25 Apr. 2023
#
#
#
#
from tkinter.tix import INTEGER
import astropy.coordinates as coord
......@@ -25,6 +25,7 @@ import galsim
import math
# from numba import jit
class Chip(object):
def __init__(self, chipID):
self.chipID = chipID
......@@ -41,9 +42,9 @@ class Chip(object):
self.npix_x = 9216
self.npix_y = 9232
self.pix_scale = 0.074
self.pix_scale = 0.074
def getTanWCS(self, ra, dec, img_rot, pix_scale = None, xcen=None, ycen=None, logger=None):
def getTanWCS(self, ra, dec, img_rot, pix_scale=None, xcen=None, ycen=None, logger=None):
""" Get the WCS of the image mosaic using Gnomonic/TAN projection
Parameter:
......@@ -57,11 +58,12 @@ class Chip(object):
WCS of the focal plane
"""
if logger is not None:
logger.info(" Construct the wcs of the entire image mosaic using Gnomonic/TAN projection")
if (xcen == None) or (ycen == None):
logger.info(
" Construct the wcs of the entire image mosaic using Gnomonic/TAN projection")
if (xcen is None) or (ycen is None):
xcen = self.cen_pix_x
ycen = self.cen_pix_y
if pix_scale == None:
if pix_scale is None:
pix_scale = self.pix_scale
# dudx = -np.cos(img_rot.rad) * pix_scale
# dudy = -np.sin(img_rot.rad) * pix_scale
......@@ -72,23 +74,24 @@ class Chip(object):
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.sin(img_rot.rad) * pix_scale
# dudy = +np.cos(img_rot.rad) * pix_scale
# dvdx = -np.cos(img_rot.rad) * pix_scale
# dvdy = +np.sin(img_rot.rad) * pix_scale
moscen = galsim.PositionD(x=xcen, y=ycen)
sky_center = galsim.CelestialCoord(ra=ra*galsim.degrees, dec=dec*galsim.degrees)
sky_center = galsim.CelestialCoord(
ra=ra*galsim.degrees, dec=dec*galsim.degrees)
affine = galsim.AffineTransform(dudx, dudy, dvdx, dvdy, origin=moscen)
WCS = galsim.TanWCS(affine, sky_center, units=galsim.arcsec)
return WCS
def getChipRowCol(self, chipID):
rowID = ((chipID - 1) % 5) + 1
colID = 6 - ((chipID - 1) // 5)
return rowID, colID
def getChipCenter(self):
"""Calculate the edges in pixel for a given CCD chip on the focal plane
NOTE: There are 5*4 CCD chips in the focus plane for photometric observation.
......@@ -99,8 +102,6 @@ class Chip(object):
A galsim BoundsD object
"""
chipID = self.chipID
rowID, colID = self.getChipRowCol(chipID)
......@@ -125,37 +126,42 @@ class Chip(object):
return galsim.PositionD(xcen, ycen)
def transRaDec2D(ra, dec):
x1 = np.cos(dec / 57.2957795) * np.cos(ra / 57.2957795);
y1 = np.cos(dec / 57.2957795) * np.sin(ra / 57.2957795);
z1 = np.sin(dec / 57.2957795);
x1 = np.cos(dec / 57.2957795) * np.cos(ra / 57.2957795)
y1 = np.cos(dec / 57.2957795) * np.sin(ra / 57.2957795)
z1 = np.sin(dec / 57.2957795)
return np.array([x1, y1, z1])
def getobsPA(ra, dec):
l1 = np.array([0,0,1])
l1 = np.array([0, 0, 1])
l2 = transRaDec2D(ra, dec)
polar_ec = coord.SkyCoord(0*u.degree, 90*u.degree,frame='barycentrictrueecliptic')
polar_ec = coord.SkyCoord(0*u.degree, 90*u.degree,
frame='barycentrictrueecliptic')
polar_eq = polar_ec.transform_to('icrs')
# print(polar_eq.ra.value,polar_eq.dec.value)
polar_d = transRaDec2D(polar_eq.ra.value, polar_eq.dec.value)
l1l2cross = np.cross(l2,l1)
pdl2cross = np.cross(l2,polar_d)
angle = math.acos(np.dot(l1l2cross,pdl2cross)/(np.linalg.norm(l1l2cross)*np.linalg.norm(pdl2cross)))
l1l2cross = np.cross(l2, l1)
pdl2cross = np.cross(l2, polar_d)
angle = math.acos(np.dot(l1l2cross, pdl2cross) /
(np.linalg.norm(l1l2cross)*np.linalg.norm(pdl2cross)))
angle = (angle)/math.pi*180
angle = angle + 90
if (ra<90 or ra> 270):
angle=-angle
if (ra < 90 or ra > 270):
angle = -angle
return angle
# @jit()
def getSelectPointingList(center = [60,-40], radius = 2):
def getSelectPointingList(center=[60, -40], radius=2):
points = np.loadtxt('sky.dat')
center = center#ra dec
radius = radius # degree
center = center # ra dec
radius = radius # degree
radii_dec = 1
radii_ra = 1/math.cos(math.pi*center[1]/180)
......@@ -163,7 +169,8 @@ def getSelectPointingList(center = [60,-40], radius = 2):
if radii_ra > 180:
radii_ra = 180
c_eclip = coord.SkyCoord(points[:,2]*u.degree, points[:,1]*u.degree,frame='barycentrictrueecliptic')
c_eclip = coord.SkyCoord(
points[:, 2]*u.degree, points[:, 1]*u.degree, frame='barycentrictrueecliptic')
c_equtor = c_eclip.transform_to('icrs')
# print(np.min((c_equtor.ra*u.degree).value), np.max((c_equtor.ra*u.degree).value))
......@@ -174,13 +181,15 @@ def getSelectPointingList(center = [60,-40], radius = 2):
ra_range_lo = center[0]-radii_ra
ra_range_hi = center[0]+radii_ra
if ra_range_lo< 0:
ids1 = ((c_equtor.ra*u.degree).value<ra_range_hi) | ((c_equtor.ra*u.degree).value>360+ra_range_lo)
if ra_range_lo < 0:
ids1 = ((c_equtor.ra*u.degree).value <
ra_range_hi) | ((c_equtor.ra*u.degree).value > 360+ra_range_lo)
elif ra_range_hi > 360:
ids1 = ((c_equtor.ra*u.degree).value>ra_range_lo) | ((c_equtor.ra*u.degree).value<ra_range_hi-360)
ids1 = ((c_equtor.ra*u.degree).value >
ra_range_lo) | ((c_equtor.ra*u.degree).value < ra_range_hi-360)
else:
ids1 = ((c_equtor.ra*u.degree).value > ra_range_lo) & ((c_equtor.ra*u.degree).value < ra_range_hi)
ids1 = ((c_equtor.ra*u.degree).value >
ra_range_lo) & ((c_equtor.ra*u.degree).value < ra_range_hi)
dec_range_lo = center[1]-radii_dec
if center[1]-radii_dec < -90:
......@@ -189,7 +198,7 @@ def getSelectPointingList(center = [60,-40], radius = 2):
dec_range_hi = center[1]+radii_dec
if center[1]+radii_dec > 90:
dec_range_hi = 90
ids3 = (c_equtor[ids1].dec*u.degree).value > dec_range_lo
ids4 = (c_equtor[ids1][ids3].dec*u.degree).value < dec_range_hi
......@@ -198,25 +207,24 @@ def getSelectPointingList(center = [60,-40], radius = 2):
p_result = np.zeros([num, 5])
i = 0
for p,p_ in zip(points[ids1][ids3][ids4],c_equtor[ids1][ids3][ids4]):
for p, p_ in zip(points[ids1][ids3][ids4], c_equtor[ids1][ids3][ids4]):
ra = (p_.ra*u.degree).value
dec = (p_.dec*u.degree).value
# print(ra, dec)
lon = p[2]
lat = p[1]
p_result[i,0] = ra
p_result[i,1] = dec
p_result[i,2] = lon
p_result[i,3] = lat
p_result[i,4] = getobsPA(ra, dec) + 90
p_result[i, 0] = ra
p_result[i, 1] = dec
p_result[i, 2] = lon
p_result[i, 3] = lat
p_result[i, 4] = getobsPA(ra, dec) + 90
i = i + 1
return p_result
return p_result
def findPointingbyChipID(chipID = 8, ra = 60., dec = -40.):
def findPointingbyChipID(chipID=8, ra=60., dec=-40.):
"""_summary_
Args:
......@@ -226,9 +234,9 @@ def findPointingbyChipID(chipID = 8, ra = 60., dec = -40.):
Returns:
_type_: [ra, dec, rotation angle]
"""
"""
chip_center = [ra, dec]
p_list = getSelectPointingList(center = chip_center)
p_list = getSelectPointingList(center=chip_center)
pchip = Chip(chipID)
p_num = p_list.shape[0]
......@@ -238,10 +246,10 @@ def findPointingbyChipID(chipID = 8, ra = 60., dec = -40.):
r_ra = ra
r_dec = dec
r_rot = 0.
for i in np.arange(0,p_num,1):
ra_n = p_list[i,0]
dec_n = p_list[i,1]
rot = p_list[i,4]*galsim.degrees
for i in np.arange(0, p_num, 1):
ra_n = p_list[i, 0]
dec_n = p_list[i, 1]
rot = p_list[i, 4]*galsim.degrees
chip_wcs = pchip.getTanWCS(ra_n, dec_n, rot)
c_center = pchip.getChipCenter()
......@@ -257,15 +265,14 @@ def findPointingbyChipID(chipID = 8, ra = 60., dec = -40.):
r_ra = ra_n
r_dec = dec_n
r_rot = rot.deg
if min_d == max_value:
print("RA:%f,Dec:%f不在指向范围内,请于巡天规划序列比对!!!!!"%(ra, dec))
print("RA:%f,Dec:%f不在指向范围内,请于巡天规划序列比对!!!!!" % (ra, dec))
return [r_ra, r_dec , r_rot]
return [r_ra, r_dec, r_rot]
if __name__ == "__main__":
tchip, tra, tdec = 13, 60., -40.
pointing = findPointingbyChipID(chipID=tchip, ra=tra, dec=tdec)
print("[ra_center, dec_center, image_rot]: ", pointing)
from pylab import *
import math, sys, numpy as np
import math
import sys
import numpy as np
import astropy.coordinates as coord
from astropy.coordinates import SkyCoord
from astropy import wcs, units as u
......@@ -14,8 +16,9 @@ def transRaDec2D(ra, dec):
z1 = np.sin(dec / 57.2957795)
return np.array([x1, y1, z1])
def ecl2radec(lon_ecl, lat_ecl):
## convert from ecliptic coordinates to equatorial coordinates
# convert from ecliptic coordinates to equatorial coordinates
c_ecl = SkyCoord(
lon=lon_ecl * u.degree, lat=lat_ecl * u.degree, frame="barycentrictrueecliptic"
)
......@@ -25,25 +28,26 @@ def ecl2radec(lon_ecl, lat_ecl):
def radec2ecl(ra, dec):
## convert from equatorial coordinates to ecliptic coordinates
# convert from equatorial coordinates to ecliptic coordinates
c_eq = SkyCoord(ra=ra * u.degree, dec=dec * u.degree, frame="icrs")
c_ecl = c_eq.transform_to("barycentrictrueecliptic")
lon_ecl, lat_ecl = c_ecl.lon.degree, c_ecl.lat.degree
return lon_ecl, lat_ecl
def cal_FoVcenter_1P_equatorial(ra_FieldCenter, dec_FieldCenter, chipID = 1, pa = -23.5):
### [ra_FieldCenter, dec_FieldCenter] is the center ra, dec of calibration fileds, such as: NEP, NGC 6397, etc.
### [ra_ChipCenter, dec_ChipCenter] is the center ra, dec of the Chip center.
### [ra_PointCenter, dec_PointCenter] is the telescope pointing center.
## Calculate PA angle
def cal_FoVcenter_1P_equatorial(ra_FieldCenter, dec_FieldCenter, chipID=1, pa=-23.5):
# [ra_FieldCenter, dec_FieldCenter] is the center ra, dec of calibration fileds, such as: NEP, NGC 6397, etc.
# [ra_ChipCenter, dec_ChipCenter] is the center ra, dec of the Chip center.
# [ra_PointCenter, dec_PointCenter] is the telescope pointing center.
# Calculate PA angle
chip = Chip(chipID)
h_ext = ImageHeader.generateExtensionHeader(
chip=chip,
xlen=chip.npix_x,
ylen=chip.npix_y,
ra=(ra_FieldCenter * u.degree).value,
ra=(ra_FieldCenter * u.degree).value,
dec=(dec_FieldCenter * u.degree).value,
pa=pa,
gain=chip.gain,
......@@ -54,7 +58,7 @@ def cal_FoVcenter_1P_equatorial(ra_FieldCenter, dec_FieldCenter, chipID = 1, pa
pixel_size=chip.pix_size,
xcen=chip.x_cen,
ycen=chip.y_cen,
)
)
# assume that the telescope point to the sky center; then abtain the chip center under this situation; then calculate the differenc between the assumed telescope center and chip center; then add this difference to the sky center
......@@ -75,24 +79,25 @@ def cal_FoVcenter_1P_equatorial(ra_FieldCenter, dec_FieldCenter, chipID = 1, pa
return ra_PointCenter, dec_PointCenter, lon_ecl_PointCenter, lat_ecl_PointCenter
def cal_FoVcenter_1P_ecliptic(lon_ecl_FieldCenter, lat_ecl_FieldCenter, chipID = 1, pa = -23.5):
### [ra_FieldCenter, dec_FieldCenter] is the center ra, dec of calibration fileds, such as: NEP, NGC 6397, etc.
### [ra_ChipCenter, dec_ChipCenter] is the center ra, dec of the Chip center.
### [ra_PointCenter, dec_PointCenter] is the telescope pointing center.
def cal_FoVcenter_1P_ecliptic(lon_ecl_FieldCenter, lat_ecl_FieldCenter, chipID=1, pa=-23.5):
# [ra_FieldCenter, dec_FieldCenter] is the center ra, dec of calibration fileds, such as: NEP, NGC 6397, etc.
# [ra_ChipCenter, dec_ChipCenter] is the center ra, dec of the Chip center.
# [ra_PointCenter, dec_PointCenter] is the telescope pointing center.
ra_FieldCenter, dec_FieldCenter = ecl2radec(
lon_ecl_FieldCenter, lat_ecl_FieldCenter
)
## Calculate PA angle
# Calculate PA angle
chip = Chip(chipID)
h_ext = ImageHeader.generateExtensionHeader(
chip=chip,
xlen=chip.npix_x,
ylen=chip.npix_y,
ra=(ra_FieldCenter * u.degree).value,
ra=(ra_FieldCenter * u.degree).value,
dec=(dec_FieldCenter * u.degree).value,
pa=pa,
gain=chip.gain,
......@@ -103,7 +108,7 @@ def cal_FoVcenter_1P_ecliptic(lon_ecl_FieldCenter, lat_ecl_FieldCenter, chipID =
pixel_size=chip.pix_size,
xcen=chip.x_cen,
ycen=chip.y_cen,
)
)
# assume that the telescope point to the sky center; then abtain the chip center under this situation; then calculate the differenc between the assumed telescope center and chip center; then add this difference to the sky center
......@@ -124,14 +129,15 @@ def cal_FoVcenter_1P_ecliptic(lon_ecl_FieldCenter, lat_ecl_FieldCenter, chipID =
return ra_PointCenter, dec_PointCenter, lon_ecl_PointCenter, lat_ecl_PointCenter
def getChipCenterRaDec(chipID = 1, p_ra = 60., p_dec = -40.):
def getChipCenterRaDec(chipID=1, p_ra=60., p_dec=-40.):
chip = Chip(chipID)
h_ext = ImageHeader.generateExtensionHeader(
chip=chip,
xlen=chip.npix_x,
ylen=chip.npix_y,
ra=(p_ra * u.degree).value,
ra=(p_ra * u.degree).value,
dec=(p_dec * u.degree).value,
pa=pa,
gain=chip.gain,
......@@ -142,24 +148,25 @@ def getChipCenterRaDec(chipID = 1, p_ra = 60., p_dec = -40.):
pixel_size=chip.pix_size,
xcen=chip.x_cen,
ycen=chip.y_cen,
)
)
wcs_h = wcs.WCS(h_ext)
pixs = np.array([[4608, 4616]])
world_point = wcs_h.wcs_pix2world(pixs, 0)
RA_chip, Dec_chip = world_point[0][0], world_point[0][1]
return RA_chip, Dec_chip
if __name__ == '__main__':
ra_input, dec_input = 270.00000, 66.56000 # NEP
pa = 23.5
# chipid = 2
for chipid in np.arange(1,31,1):
for chipid in np.arange(1, 31, 1):
ra, dec, lon_ecl, lat_ecl = cal_FoVcenter_1P_equatorial(
ra_input, dec_input,chipID=chipid, pa=pa)
ra_input, dec_input, chipID=chipid, pa=pa)
print("chip id is %d, chip center [ra,dec] is [%f, %f], pointing center calculated [ra,dec] is [%f, %f]"%(chipid, ra_input, dec_input, ra, dec))
#for check the result
print("chip id is %d, chip center [ra,dec] is [%f, %f], pointing center calculated [ra,dec] is [%f, %f]" % (
chipid, ra_input, dec_input, ra, dec))
# for check the result
# testRA, testDec = getChipCenterRaDec(chipID = chipid, p_ra = ra, p_dec = dec)
# print(ra_input-testRA, dec_input-testDec)
from flask import Flask, render_template, request, redirect
import yaml
import ast
app = Flask(__name__)
key_type_map = {
'obs_type': str,
'obs_type_code': str,
'obs_id': str,
'run_chips': list,
'call_sequence': {
'scie_obs': {
'shutter_effect': bool,
'flat_fielding': bool,
'field_dist': bool,
},
'sky_background': {
'shutter_effect': bool,
'flat_fielding': bool,
'enable_straylight_model': bool,
'flat_level': None,
'flat_level_filt': None,
},
'PRNU_effect': {},
'cosmic_rays': {
'save_cosmic_img': bool,
},
'poisson_and_dark': {
'add_dark': bool,
},
'bright_fatter': {},
'detector_defects': {
'hot_pixels': bool,
'dead_pixels': bool,
'bad_columns': bool,
},
'nonlinearity': {},
'blooming': {},
'prescan_overscan': {
'add_dark': bool,
},
'bias': {
'bias_16channel': bool,
},
'readout_noise': {},
'gain': {
'gain_16channel': bool,
},
'quantization_and_output': {
'format_output': bool,
},
},
}
def convert_dict_values(d, key_type_map):
for key, value in d.items():
if isinstance(value, dict):
convert_dict_values(value, key_type_map[key])
elif key in key_type_map:
if key_type_map[key] is int:
d[key] = int(value)
if key_type_map[key] is float:
d[key] = float(value)
if key_type_map[key] is bool:
if d[key].lower() == 'yes' or d[key].lower() == 'true':
d[key] = True
else:
d[key] = False
if key_type_map[key] is str:
d[key] = str(value)
if key_type_map[key] is list:
d[key] = ast.literal_eval(value)
if key_type_map[key] is None:
d[key] = None
def load_yaml():
with open('templates/obs_config_SCI.yaml', 'r') as file:
return yaml.safe_load(file)
def save_yaml(data):
convert_dict_values(data, key_type_map)
with open('config_reset/obs_config_SCI_reset.yaml', 'w') as file:
yaml.dump(data, file, default_flow_style=False, sort_keys=False)
def render_form(data, parent_key=''):
form_html = ''
for key, value in data.items():
full_key = f"{parent_key}.{key}" if parent_key else key
if isinstance(value, dict): # 处理字典
form_html += f"<div class='block'><h2>{key}</h2>{render_form(value, full_key)}</div>"
else:
form_html += f"<label for='{full_key}'>{key}:</label>"
form_html += f"<input type='text' id='{full_key}' name='{full_key}' value='{value}'><br>"
return form_html
@app.route('/', methods=['GET', 'POST'])
def index():
if request.method == 'POST':
data = load_yaml()
for key in request.form:
keys = key.split('.')
temp = data
for k in keys[:-1]:
temp = temp[k]
temp[keys[-1]] = request.form[key]
save_yaml(data)
return redirect('/')
data = load_yaml()
form_html = render_form(data)
return render_template('index_obs.html', form_html=form_html)
if __name__ == '__main__':
app.run(debug=True)
from flask import Flask, render_template, request, redirect
import yaml
import ast
app = Flask(__name__)
key_type_map = {
'work_dir': str,
'run_name': str,
'project_cycle': int,
'run_counter': int,
'run_option': {
'out_cat_only': bool,
},
'catalog_options': {
'input_path': {
'cat_dir': str,
'star_cat': str,
'galaxy_cat': str,
},
'SED_templates_path': {
'star_SED': str,
'galaxy_SED': str,
'AGN_SED': str,
},
'star_only': bool,
'galaxy_only': bool,
'rotateEll': float,
'enable_mw_ext_gal': bool,
'planck_ebv_map': str,
},
'obs_setting': {
'pointing_file': str,
'obs_config_file': str,
'run_pointings': list,
'enable_astrometric_model': bool,
'cut_in_band': str,
'mag_sat_margin': float,
'mag_lim_margin': float,
},
'psf_setting': {
'psf_model': str,
'psf_pho_dir': str,
'psf_sls_dir': str,
},
'shear_setting': {
'shear_type': str,
'reduced_g1': float,
'reduced_g2': float,
},
'output_setting': {
'output_format': str,
'shutter_output': bool,
'prnu_output': bool,
},
'random_seeds': {
'seed_poisson': int,
'seed_CR': int,
'seed_flat': int,
'seed_prnu': int,
'seed_gainNonUniform': int,
'seed_biasNonUniform': int,
'seed_rnNonUniform': int,
'seed_badcolumns': int,
'seed_defective': int,
'seed_readout': int,
},
}
def convert_dict_values(d, key_type_map):
for key, value in d.items():
if isinstance(value, dict):
convert_dict_values(value, key_type_map[key])
elif key in key_type_map:
if key_type_map[key] is int:
d[key] = int(value)
if key_type_map[key] is float:
d[key] = float(value)
if key_type_map[key] is bool:
if d[key].lower() == 'yes' or d[key].lower() == 'true':
d[key] = True
else:
d[key] = False
if key_type_map[key] is str:
d[key] = str(value)
if key_type_map[key] is list:
d[key] = ast.literal_eval(value)
def load_yaml():
with open('templates/config_overall.yaml', 'r') as file:
return yaml.safe_load(file)
def save_yaml(data):
convert_dict_values(data, key_type_map)
with open('config_reset/config_overall_reset.yaml', 'w') as file:
yaml.dump(data, file, default_flow_style=False, sort_keys=False)
def render_form(data, parent_key=''):
form_html = ''
for key, value in data.items():
full_key = f"{parent_key}.{key}" if parent_key else key
if isinstance(value, dict): # 处理字典
form_html += f"<div class='block'><h2>{key}</h2>{render_form(value, full_key)}</div>"
else:
form_html += f"<label for='{full_key}'>{key}:</label>"
form_html += f"<input type='text' id='{full_key}' name='{full_key}' value='{value}'><br>"
return form_html
@app.route('/', methods=['GET', 'POST'])
def index():
if request.method == 'POST':
data = load_yaml()
for key in request.form:
keys = key.split('.')
temp = data
for k in keys[:-1]:
temp = temp[k]
temp[keys[-1]] = request.form[key]
save_yaml(data)
return redirect('/')
data = load_yaml()
form_html = render_form(data)
return render_template('index_overall.html', form_html=form_html)
if __name__ == '__main__':
app.run(debug=True)
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -26,7 +26,7 @@ def focalPlaneInf(ra_target, dec_target, ra_point, dec_point, image_rot=-113.433
float, in unit of degrees;
image_rot : orientation of the camera with respect the sky;
float, in unit of degrees;
NOTE: image_rot=-113.4333 is the default value
NOTE: image_rot=-113.4333 is the default value
in current CSST image simulation;
figout : location of the target object in the focal plane;
str
......@@ -36,7 +36,7 @@ def focalPlaneInf(ra_target, dec_target, ra_point, dec_point, image_rot=-113.433
the pointing center (ra_point dec_point) of the telescope
1) open a terminal
2) type >> python TargetLocationCheck.py ra_target dec_target ra_point dec_point
or type >> python TargetLocationCheck.py ra_target dec_target ra_point dec_point -image_rot=floatNum
or type >> python TargetLocationCheck.py ra_target dec_target ra_point dec_point -image_rot=floatNum
or type >> python TargetLocationCheck.py ra_target dec_target ra_point dec_point -image_rot=floatNum -figout=FigureName
"""
print("^_^ Input target coordinate: [Ra, Dec] = [%10.6f, %10.6f]" % (
......@@ -105,7 +105,7 @@ def ccdParam():
def getTanWCS(ra, dec, img_rot, pix_scale=0.074):
"""
"""
Get the WCS of the image mosaic using Gnomonic/TAN projection
Parameter:
ra, dec: float
......@@ -221,8 +221,8 @@ def ccdLayout(xpixTar, ypixTar, figout="ccdLayout.pdf"):
ax.text(ix0+500, iy0+1500, "%s#%s" %
(fType, ischip), fontsize=12, color="grey")
ax.plot(xpixTar, ypixTar, "r*", ms=12)
ax.set_xlabel("$X\,[\mathrm{pixels}]$", fontsize=20)
ax.set_ylabel("$Y\,[\mathrm{pixels}]$", fontsize=20)
ax.set_xlabel(r"$X\,[\mathrm{pixels}]$", fontsize=20)
ax.set_ylabel(r"$Y\,[\mathrm{pixels}]$", fontsize=20)
ax.invert_yaxis()
ax.axis('off')
plt.savefig(figout)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment