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

deprecated files deleted

parent 0697a198
import os
import numpy as np
from Config import ReadConfig
from datetime import datetime
work_dir = "/public/home/fangyuedong/test/CSST/test/"
data_dir = "/data/simudata/CSSOSDataProductsSims/data/"
config_file = os.path.join(work_dir, "ObservationSim.cfg")
config = ReadConfig(config_file)
exp_time = float(config['exp_time'])
# Read Pointing list
pointing_file = os.path.join(data_dir, "pointing10_20210202.dat")
f = open(pointing_file, 'r')
for _ in range(1):
header = f.readline()
iline = 0
pRA = []
pDEC = []
for line in f:
line = line.strip()
columns = line.split()
pRA.append(float(columns[0]))
pDEC.append(float(columns[1]))
f.close()
pRA = np.array(pRA)
pDEC = np.array(pDEC)
# Create calibration pointings
ncal = 1 # Define the number of calibration pointings
pointing_type = ['MS']*len(pRA)
pRA = np.append(pRA[:ncal], pRA)
pDEC = np.append(pDEC[:ncal], pDEC)
pointing_type = ['CAL']*ncal + pointing_type
# Calculate starting time(s)
t0 = datetime(2021, 5, 25, 12, 0, 0)
t = datetime.timestamp(t0)
timestamp_obs = []
delta_t = 10 # Time elapsed between exposures (minutes)
for i in range(len(pointing_type)):
timestamp_obs.append(t)
if pointing_type[i] == 'CAL':
t += 3 * delta_t * 60 # 3 calibration exposure
elif pointing_type[i] == 'MS':
t += delta_t * 60
timestamp_obs = np.array(timestamp_obs)
pointing_type = np.array(pointing_type)
# Define the range of pointing list
# pRange = range(0, 2)
pRange = [1, 22]
\ No newline at end of file
comput101
comput102
comput103
comput104
comput105
comput106
comput107
comput108
comput109
comput110
comput111
comput112
comput113
smp1
admin
import os
import numpy as np
from Pointing import *
# Make directories
imgDir = os.path.join(work_dir, config["mockImgDir"])
if not os.path.exists(imgDir):
os.system("mkdir %s"%imgDir)
prefix = "MSC_"
for pointing_ID in range(len(pRA)):
if pointing_ID not in pRange:
continue
fname = prefix + str(pointing_ID).rjust(7, '0')
subImgDir = os.path.join(imgDir, fname)
if not os.path.exists(subImgDir):
os.system("mkdir %s"%subImgDir)
\ No newline at end of file
import yaml
if __name__ == '__main__':
stream = open("config_sim.yaml", 'r')
# dictionary = yaml.load(stream)
dictionary = yaml.load(stream, Loader=yaml.SafeLoader)
# print(dictionary)
for key, value in dictionary.items():
print (key + " : " + str(value))
with open("config_sim.yaml", "r") as stream:
try:
dictionary = yaml.safe_load(stream)
for key, value in dictionary.items():
print (key + " : " + str(value))
except yaml.YAMLError as exc:
print(exc)
\ No newline at end of file
##################################################
# Default configuration for CSSOS simulation #
# CSST-Sim Group, 2021/01/04, version 0.2 #
# #
##################################################
# Observation setting
date_obs 210525 # Observation date [yymmdd]
time_obs 120000 # Observation time [hhmmss]
exp_time 150. # Exposure time [seconds]
ra_center 60.0 # Telesscope pointing center [degree] (Default)
dec_center -40.0
psf_rcont 0.15,0.8 # Radius of the 80% flux concentration (for a Gaussian PSF)
image_rot -113.4333 # Image orientation [degree]
sigma_spin 0.0 # Image spin [degree]
rotateEll 0.0 # Rotate the intrinsic ellipticity by a given angle
# (currently only support 0.0, 45.0, 90.0, 135.0 [degree])
survey_type Photometric # Survey simulation option:
# 'Photometric': only run sims for photometric chips
# 'Spectroscopic': only run sims for spectroscopic chps
# 'All': run sims for all chips
psf_model Interp # Which PSF model to use:
# 'Gauss': simple gaussin profile
# 'Interp': Interpolated PSF from measured data
#===========================================================
# Instrument effects
#===========================================================
field_dist y # Y/N: Whether to add field distortion
add_back y # Y/N: Whether to add sky background
add_dark y # Y/N: Whether to add dark noise
add_readout y # Y/N: Whether to add read-out (Gaussian) noise
add_bias y # Y/N: Whether to add bias-level to image
shutter_effect y # Y/N: Whether to apply shutter effect
shutter_output n # Y/N: Whether to export shutter effect 16-bit image (<=65535)
flat_fielding y # Y/N: Whether to add flat-fielding effect
bias_output y # Y/N: Whether to export bias frames
dark_output y # Y/N: Whether to export the combined dark current file
flat_output y # Y/N: Whether to export the combined flat-field file
prnu_effect y # Y/N: Whether to apply PRNU effect
prnu_output n # Y/N: Whether to export the PRNU (pixel-to-pixel flat-fielding) file
non_linear n # Y/N: Whether to apply non-linearity
cosmic_ray y # Y/N: Whether to add cosmic-ray
cray_differ y # Y/N: Different cosmic-ray for calibration files or not
cte_trail y # Y/N: Whether to simulate CTE trails
saturbloom y # Y/N: Whether to simulate Saturation and Blooming
add_badcolumns y # Y/N: Whether to add bad columns
add_hotpixels y # Y/N: Whether to add hot pixels
add_deadpixels y # Y/N: Whether to add dead(dark) pixels
readout16 n # Y/N: Whether to export as 16 subimages (channels) with pre- and over-scan
bright_fatter y # Y/N: Whether to add brighter-fatter (also electron diffusion) effects
df_strength 2.3 # Sillicon sensor diffusion strength
bias_level 500 # e-/pixel
gain 1.1 # Gain
full_well 90000 # Full well level [e-]
NBias 1 # Number of frames to be exported
NDark 1 # Number of frames to be exported
NFlat 1 # Number of frames to be exported
dark_exptime 300 # Exposure time for dark current frame
flat_exptime 150 # Exposure time for flat field frame
readout_time 40 # Time for read-out by each channel
#===========================================================
# Shear method
#===========================================================
shear_method constant # Only two methods are provided to generate mock shear field:
# 'constant': all galaxies are assigned a constant reduced shear,
# but with different betas (orientations)
# 'extra' : from catalog(s) (not available yet)
# Constant shear field
reduced_g1 0.026 # g1 component when 'shear_method'='constant'
reduced_g2 0.015 # g2 component when 'shear_method'='constant'
reShear E # Representation of the shear vertor
# Extra shear file
# shear_cat mockShear.cat # Extra provided shear catalog (currently not used)
#===========================================================
# Output directories
#===========================================================
mockImgDir TEST # Name of subdirectory to save the mock image
#===========================================================
# Random Seeds
#===========================================================
seed_mock 12345678 # Seed for generating random values of ra, dec and av
seed_star 121212121 # Seed for generating random redshift, sed_type for stars
seed_gal 212121212 # Seed for generating random redshift, sed_type for galaxies
seed_Av 121212 # Seed for generating random intrinsic extinction
seed_poisson 20210601 # Seed for Poisson noise
seed_CR 20210317 # Seed for generating random cosmic ray map
seed_flat 20210101 # Seed for generating random flat field
seed_prnu 20210102 # Seed for photo-response non-uniformity
seed_skynoise 20210201 # Seed for sky noise
seed_gainNonUniform 20210202 # Seed for Gain nonuniformity
seed_biasNonUniform 20210203 # Seed for Bias nonuniformity
seed_rnNonUniform 20210204 # Seed for ReadNoise nonuniformity
seed_badcolumns 20240309 # Initial Seed for Bad Columns
seed_defective 20210304 # Seed for Defective(bad) pixels
seed_readout 20210601 # Seed for Read-out gaussian noise
\ No newline at end of file
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