Commit 877d689f authored by Zhang Xin's avatar Zhang Xin
Browse files

new formation msc-I0 data

parent 0f700d31
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@
# ok to pass either way or both, as long as they are consistent
work_dir: "/public/home/fangyuedong/project/workplace/"
run_name: "ext_on"
data_set: "csst-msc-c9-25sqdeg-v_test"

# Project cycle and run counter are used to name the outputs
project_cycle: 9
+4 −3
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ def parse_args():
    return parser.parse_args()


def generate_pointing_list(config, pointing_filename=None, data_dir=None):
def generate_pointing_list(config, pointing_filename=None, data_dir=None, dataset = ''):
    pointing_list = []

    # Only valid when the pointing list does not contain time stamp column
@@ -63,7 +63,7 @@ def generate_pointing_list(config, pointing_filename=None, data_dir=None):
                continue
            line = line.strip()
            columns = line.split()
            pointing = Pointing(obs_config_file=obs_config_file)
            pointing = Pointing(obs_config_file=obs_config_file, dataset=dataset)
            pointing.read_pointing_columns(columns=columns, id=ipoint)
            t += delta_t * 60.
            pointing_list.append(pointing)
@@ -83,7 +83,8 @@ def generate_pointing_list(config, pointing_filename=None, data_dir=None):
            timestamp=t,
            exp_time=exp_time,
            pointing_type='SCI',
            obs_config_file=obs_config_file
            obs_config_file=obs_config_file, 
            dataset=dataset
        )
        t += delta_t * 60.
        pointing_list.append(pointing)
+2 −1
Original line number Diff line number Diff line
@@ -28,7 +28,8 @@ class ChipOutput(object):
            sat_vel=[pointing.sat_vx, pointing.sat_vy, pointing.sat_vz],
            project_cycle=self.config["project_cycle"],
            run_counter=self.config["run_counter"],
            chip_name=self.chip_label)
            chip_name=self.chip_label,
            dataset=pointing.dataset)

        obs_id = _util.get_obs_id(img_type=self.pointing_type, project_cycle=config["project_cycle"], run_counter=config[
                                  "run_counter"], pointing_id=pointing.obs_id, pointing_type_code=pointing.pointing_type_code)
+9 −7
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ import observation_sim.instruments._util as _util


class Pointing(object):
    def __init__(self, id=0, ra=0., dec=0., img_pa=0., timestamp=1621915200, sat_x=0., sat_y=0., sat_z=0., sun_x=0., sun_y=0., sun_z=0., sat_vx=0., sat_vy=0., sat_vz=0., exp_time=150., pointing_type='SCI', pointing_type_code='101', pointing_id='00000001', obs_config_file=None, t_shutter_open=1.3, t_shutter_close=1.3):
    def __init__(self, id=0, ra=0., dec=0., img_pa=0., timestamp=1621915200, sat_x=0., sat_y=0., sat_z=0., sun_x=0., sun_y=0., sun_z=0., sat_vx=0., sat_vy=0., sat_vz=0., exp_time=150., pointing_type='SCI', pointing_type_code='101', pointing_id='00000001', obs_config_file=None, t_shutter_open=1.3, t_shutter_close=1.3, dataset = 'csst-msc-c9-25sqdeg-v3'):
        self.id = id
        self.ra = ra
        self.dec = dec
@@ -41,6 +41,7 @@ class Pointing(object):
                self.pointing_type_code = self.obs_param["obs_type_code"]
            if self.obs_param["obs_id"]:
                self.obs_id = str(self.obs_param["obs_id"])
        self.dataset = dataset

    def get_full_depth_exptime(self, filter_type):
        if self.survey_field_type == 'WIDE':
@@ -114,12 +115,13 @@ class Pointing(object):
                os.makedirs(run_dir, exist_ok=True)
            except OSError:
                pass
        self.output_prefix = get_obs_id(
            img_type=self.pointing_type,
            project_cycle=overall_config["project_cycle"],
            run_counter=overall_config["run_counter"],
            pointing_id=self.obs_id,
            pointing_type_code=self.pointing_type_code)
        # self.output_prefix = get_obs_id(
        #     img_type=self.pointing_type,
        #     project_cycle=overall_config["project_cycle"],
        #     run_counter=overall_config["run_counter"],
        #     pointing_id=self.obs_id,
        #     pointing_type_code=self.pointing_type_code)
        self.output_prefix = self.pointing_type_code+self.obs_id
        self.output_dir = os.path.join(run_dir, self.output_prefix)
        if not os.path.exists(self.output_dir):
            try:
+8 −6
Original line number Diff line number Diff line
@@ -355,7 +355,7 @@ def WCS_def(xlen=9216, ylen=9232, gapy=898.0, gapx1=534, gapx2=1309, ra_ref=60,


# TODO project_cycle is temporary, is not in header defined, delete in future
def generatePrimaryHeader(xlen=9216, ylen=9232, pointing_id='00000001', pointing_type_code='101', ra=60, dec=-40, pixel_scale=0.074, time_pt=None, im_type='SCI', exptime=150., sat_pos=[0., 0., 0.], sat_vel=[0., 0., 0.], project_cycle=6, run_counter=0, chip_name="01"):
def generatePrimaryHeader(xlen=9216, ylen=9232, pointing_id='00000001', pointing_type_code='101', ra=60, dec=-40, pixel_scale=0.074, time_pt=None, im_type='SCI', exptime=150., sat_pos=[0., 0., 0.], sat_vel=[0., 0., 0.], project_cycle=6, run_counter=0, chip_name="01", obstype = 'WIDE', dataset='csst-msc-c9-25sqdeg-v3'):

    # array_size1, array_size2, flux, sigma = int(argv[1]), int(argv[2]), 1000.0, 5.0

@@ -416,8 +416,9 @@ def generatePrimaryHeader(xlen=9216, ylen=9232, pointing_id='00000001', pointing

    # # OBS_id = '1'+ obs_type[im_type] + str(int(project_cycle)) + pointNum.rjust(7,'0')
    # OBS_id = '1'+ obs_type[im_type] + str(int(project_cycle)) + str(int(run_counter)).rjust(2, '0') + pointNum.rjust(5,'0')
    OBS_id = get_obs_id(img_type=im_type, project_cycle=project_cycle, run_counter=run_counter,
                        pointing_id=pointing_id, pointing_type_code=pointing_type_code)
    # OBS_id = get_obs_id(img_type=im_type, project_cycle='project_cycle', run_counter=run_counter,
    #                     pointing_id=pointing_id, pointing_type_code=pointing_type_code)
    OBS_id = pointing_type_code+pointing_id

    # h_prim['OBJECT'] = str(int(project_cycle)) + pointNum.rjust(7, '0')
    h_prim['OBJECT'] = pointing_id
@@ -429,8 +430,9 @@ def generatePrimaryHeader(xlen=9216, ylen=9232, pointing_id='00000001', pointing
    # file_type = {'SCI':'SCIE', 'BIAS':'BIAS', 'DARK':'DARK', 'FLAT':'FLAT', 'CRS':'CRS', 'CRD':'CRD','CALS':'CALS','CALF':'CALF'}
    # h_prim['FILETYPE'] = file_type[im_type]
    # h_prim['FILETYPE'] = get_file_type(img_type=im_type)
    h_prim['FILETYPE'] = im_type

    # h_prim['FILETYPE'] = im_type
    h_prim['OBSTYPE'] = obstype
    h_prim['DATASET']  = dataset
    co = coord.SkyCoord(ra, dec, unit='deg')

    ra_hms = format(co.ra.hms.h, '02.0f') + format(co.ra.hms.m,
@@ -469,7 +471,7 @@ def generatePrimaryHeader(xlen=9216, ylen=9232, pointing_id='00000001', pointing
        end_time_str[11:13] + end_time_str[14:16] + end_time_str[17:19]
    # h_prim['FILENAME'] = 'CSST_MSC_MS_' + im_type + '_' + file_start_time + '_' + file_end_time + '_' + OBS_id + '_' + CCDID[
    #     k - 1].rjust(2, '0') + '_L0_V01'
    h_prim['FILENAME'] = 'CSST_MSC_MS_' + h_prim['FILETYPE'] + '_' + \
    h_prim['FILENAME'] = 'CSST_MSC_MS_' + im_type + '_' + \
        file_start_time + '_' + file_end_time + \
        '_' + OBS_id + '_' + chip_name + '_L0_V01'

Loading