Commit 538b21ee authored by Zhang Xin's avatar Zhang Xin
Browse files

Merge branch 'develop' into 'master'

merge develop into master (for release v2.0)

See merge request csst_sim/csst-simulation!13
parents 2953a065 1c871e69
Loading
Loading
Loading
Loading
−7.92 MiB

File deleted.

+514 −0

File changed and moved.

Preview size limit exceeded, changes collapsed.

+628 −0

File added.

Preview size limit exceeded, changes collapsed.

+24 −20
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ from scipy import interpolate

from ObservationSim.MockObject import CatalogBase, Star, Galaxy, Quasar

class Catalog_example(CatalogBase):
class Catalog(CatalogBase):
    """An user customizable class for reading in catalog(s) of objects and SEDs.
    
    NOTE: must inherit the "CatalogBase" abstract class
@@ -32,8 +32,7 @@ class Catalog_example(CatalogBase):
    load_norm_filt(obj):
        load the filter throughput for the input catalog's photometric system.
    """

    def __init__(self, config, chip, pointing, **kwargs):
    def __init__(self, config, chip, **kwargs):
        """Constructor method.
        
        Parameters
@@ -41,7 +40,7 @@ class Catalog_example(CatalogBase):
        config : dict
            configuration dictionary which is parsed from the input YAML file
        chip: ObservationSim.Instrument.Chip
            a ObservationSim.Instrument.Chip instance, can be used to identify the band etc.
            an ObservationSim.Instrument.Chip instance, can be used to identify the band etc.
        **kwargs : dict
            other needed input parameters (in key-value pairs), please modify corresponding
            initialization call in "ObservationSim.py" as you need.
@@ -52,12 +51,11 @@ class Catalog_example(CatalogBase):
        """
        
        super().__init__()
        self.cat_dir = os.path.join(config["data_dir"], config["input_path"]["cat_dir"])
        self.cat_dir = os.path.join(config["data_dir"], config["catalog_options"]["input_path"]["cat_dir"])
        self.chip = chip
        self.pointing = pointing
        if "star_cat" in config["input_path"] and config["input_path"]["star_cat"]:
            star_file = config["input_path"]["star_cat"]
            star_SED_file = config["SED_templates_path"]["star_SED"]
        if "star_cat" in config["catalog_options"]["input_path"] and config["catalog_options"]["input_path"]["star_cat"]
            star_file = config["catalog_options"]["input_path"]["star_cat"]
            star_SED_file = config["catalog_options"]["SED_templates_path"]["star_SED"]
            self.star_path = os.path.join(self.cat_dir, star_file)
            self.star_SED_path = os.path.join(config["data_dir"], star_SED_file)
        # NOTE: must call _load() method here to read in all objects
@@ -100,20 +98,23 @@ class Catalog_example(CatalogBase):
                NOTE: if that filter is not the corresponding CSST filter, the 
                load_norm_filt(obj) function must be implemented to load the filter
                throughput of that particular photometric system
            param["theta"] : float
                the position angle (in degrees)
            param["bfrac"] : float
                the bulge fraction
            param["hlr_bulge] : float
            param["hlr_bulge"] : float
                the half-light-radius of the bulge
            param["hlr_disk] : float
            param["hlr_disk"] : float
                the half-light-radius of the disk
             param["ell_bulge] : float
                the ellipticity of the bulge
             param["ell_disk] : float
                the ellipticity of the disk
             param["ell_tot] : float
                the total ellipticity
            param["e1_bulge"], param["e2_bulge"] : float
                the ellipticity of the bulge components
            param["e1_disk"], param["e2_disk"] : float
                the ellipticity of the disk components
            (Optional parameters):
            param['disk_sersic_idx']: float
                Sersic index for galaxy disk component
            param['bulge_sersic_idx']: float
                Sersic index for galaxy bulge component
            param['g1'], param['g2']: float
                Reduced weak lensing shear components (valid for shear type: catalog)
        the model of ObservationSim.MockObject.Galaxy class requires:
            Currently a Quasar is modeled as a point source, just like a Star.

@@ -122,6 +123,9 @@ class Catalog_example(CatalogBase):

        NOTE: All constructed objects should be appened to "self.objs".

        NOTE: Any other parameters can also be set within "param" dict:
            Used to calculate required quantities and/or SEDs etc.

        Parameters
        ----------
        **kwargs : dict

Catalog/FGS_Catalog.py

0 → 100644
+516 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading