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

Merge branch 'master' into 'release_v3.0'

release_v3.3.1

See merge request !37
parents 31c306af 53dc436c
......@@ -311,7 +311,8 @@ class Catalog(CatalogBase):
param['bulgemass'] = gals['bulgemass'][igals]
param['diskmass'] = gals['diskmass'][igals]
param['size'] = gals['size'][igals]
np.random.seed(int(pix_id)+cat_id+igals)
param['size'] = (gals['size'][igals] * ((1.+gals['redshift'][igals])**(0.4))) * np.random.uniform(0.7, 1.3)
if param['size'] > self.max_size:
self.max_size = param['size']
......
......@@ -73,7 +73,7 @@ class ChipOutput(object):
self.hdr += additional_column_names
def create_output_file(self):
if self.pointing_type == 'WIDE' or self.pointing_type == 'DEEP':
if self.pointing_type == 'WIDE' or self.pointing_type == 'DEEP' or self.pointing_type == 'CALF' or self.pointing_type == 'CALSP' or self.pointing_type == 'CALSS':
self.cat = open(os.path.join(self.subdir, self.cat_name), "w")
self.logger.info("Creating catalog file %s ...\n" %
(os.path.join(self.subdir, self.cat_name)))
......
......@@ -556,6 +556,10 @@ def generateExtensionHeader(chip, xlen=9216, ylen=9232, ra=60, dec=-40, pa=-23.4
h_ext['GAIN14'] = chip.gain_channel[13]
h_ext['GAIN15'] = chip.gain_channel[14]
h_ext['GAIN16'] = chip.gain_channel[15]
h_ext['PSCAN1'] = chip.prescan_x
h_ext['PSCAN2'] = chip.prescan_y
h_ext['OSCAN1'] = chip.overscan_x
h_ext['OSCAN2'] = chip.overscan_y
h_ext['RON01'] = readout
h_ext['RON02'] = readout
h_ext['RON03'] = readout
......
......@@ -36,7 +36,7 @@ MMAG_MARK_B 30
# Trace description
#
DYDX_ORDER_B 0
DYDX_B_0 82.91782550095616 -0.017450074030956903 -0.00034211980919903514 -5.229479577962483e-10 6.618188334096981e-10 4.5712407536340074e-11
DYDX_B_0 82.91742083784611 -0.0174512487471819 -0.00034120894910458606 -1.298330068637783e-10 4.340249496308753e-10 1.0373044457577981e-11
#
# X and Y Offsets
#
......@@ -46,8 +46,8 @@ YOFF_B 0.0
# Dispersion solution
#
DISP_ORDER_B 1
DLDP_B_0 7763276.642055119 -20266.736198394356 1255.309384604854 5.066171367500259 1.2647000472616756 -0.25632575767112603
DLDP_B_1 -143465.8971715863 684.9306681233783 -157.3534822656011 -0.2303808137854618 0.03539958163679847 0.005924035996712881
DLDP_B_0 448897.8581289202 -69.05924554341267 -200.37444114671905 0.04003968509481386 -0.027512617424472103 5.068370683947331e-05
DLDP_B_1 10160.6234805349 4.430359702933667 0.09374704569926708 -0.000854410958383644 -2.8642365418529523e-05 -2.659603621537505e-06
#
SENSITIVITY_B GU2.Throughput.0st.fits
#
......
......@@ -36,7 +36,7 @@ MMAG_MARK_B 30
# Trace description
#
DYDX_ORDER_B 0
DYDX_B_0 80.91986075321823 -0.01744761042150647 -0.0003580191107231064 -2.627009138987314e-10 -6.375179298238856e-10 2.763897714355112e-09
DYDX_B_0 80.93796454255751 -0.017461724678154614 -0.00035745607061872265 1.586088715327381e-09 2.83632657494108e-10 2.4337528594084163e-09
#
# X and Y Offsets
#
......@@ -46,8 +46,8 @@ YOFF_B 0.0
# Dispersion solution
#
DISP_ORDER_B 1
DLDP_B_0 52318605.038736925 -49905.61041920374 -325.3071290800653 11.683982888283492 -0.734011022951611 0.0798352458204433
DLDP_B_1 -1489154.0375472226 1428.4941310271706 32.346965719777806 -0.3034273708620226 -0.01153922199462758 -0.0009324181582693394
DLDP_B_0 560974.2568255321 4.836837898676734 -270.2027083117478 0.00017749467347293046 -3.42705736301515e-05 -2.4253188230594427e-06
DLDP_B_1 15499.999999924863 8.661894315733124e-11 5.382306809541636e-12 -1.7061292984259495e-14 -6.679353210055169e-15 1.0401633823282333e-15
#
SENSITIVITY_B GU4.Throughput.0st.fits
#
......
......@@ -20,7 +20,7 @@ def add_prescan_overscan(self, chip, filt, tel, pointing, catalog, obs_param):
if obs_param["add_dark"] is True:
ny = int(chip.npix_y/2)
base_dark = (ny-1)*(chip.readout_time/ny)*chip.dark_noise
chip.img.array[(chip.prescan_y+ny):-(chip.prescan_y+ny), :] = base_dark
chip.img.array[(chip.prescan_y+ny):-(chip.prescan_y+ny), :] += base_dark
return chip, filt, tel, pointing
......
......@@ -76,7 +76,7 @@ with open("requirements.txt", "r") as f:
]
setup(name='csst_msc_sim',
version='3.3.0',
version='3.3.1',
packages=find_packages(),
# install_requires=[
# # 'numpy>=1.18.5',
......
......@@ -130,7 +130,7 @@ def cal_FoVcenter_1P_ecliptic(lon_ecl_FieldCenter, lat_ecl_FieldCenter, chipID=1
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., pa=23.5):
chip = Chip(chipID)
h_ext = ImageHeader.generateExtensionHeader(
......
import os
import sys
import numpy as np
from astropy.io import fits
PRESCAN_X, IMAGE_X, OVERSCAN_X = 27, 1152, 71
PRESCAN_Y, IMAGE_Y, OVERSCAN_Y = 0, 4616, 84
BLOCK_WIDTH = PRESCAN_X + IMAGE_X + OVERSCAN_X
def process_single_file(filename):
with fits.open(filename) as hdul:
data = hdul[1].data
data = data[PRESCAN_Y:PRESCAN_Y + IMAGE_Y, :]
blocks = [data[:, i * BLOCK_WIDTH + PRESCAN_X:(i + 1) * BLOCK_WIDTH - OVERSCAN_X] for i in range(16)]
blocks_a = np.concatenate(blocks[:4], axis=1)
blocks_b = np.concatenate([np.fliplr(b) for b in blocks[4:8]], axis=1)
blocks_c = np.concatenate([np.flipud(np.fliplr(b)) for b in blocks[11:7:-1]], axis=1)
blocks_d = np.concatenate([np.flipud(b) for b in blocks[15:11:-1]], axis=1)
blocks_dc = np.concatenate([blocks_d, blocks_c], axis=1)
blocks_ab = np.concatenate([blocks_a, blocks_b], axis=1)
blocks_final = np.concatenate([blocks_ab, blocks_dc], axis=0)
output_path = os.path.splitext(fn)[0]+'_cropping.fits'
fits.writeto(output_path, blocks_final, overwrite=True)
print(f"OK:{output_path}")
if __name__ == "__main__":
if len(sys.argv) > 1:
fn = sys.argv[1]
else:
fn = 'CSST_MSC_MS_WIDE_20281024132057_20281024132327_10100484833_08_L0_V01.fits'
process_single_file(fn)
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