<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.main.</span></span><spanclass="sig-name descname"><spanclass="pre">deduplicate_names_add_count</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">names</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">list</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.main.deduplicate_names_add_count"title="Permalink to this definition"></a></dt>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.main.</span></span><spanclass="sig-name descname"><spanclass="pre">main</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">argv</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.main.main"title="Permalink to this definition"></a></dt>
<dd><p>Command line interface of csst_cpic_sim</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>argv</strong> (<em>list</em>) – input arguments. Default is None. If None, sys.argv is used.</p>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.main.</span></span><spanclass="sig-name descname"><spanclass="pre">observation_simulation_from_config</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">obs_file</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">config_file</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.main.observation_simulation_from_config"title="Permalink to this definition"></a></dt>
<dd><p>Run observation simulation from config file</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>obs_file</strong> (<em>str</em>) – observation file or folder.</p></li>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.main.</span></span><spanclass="sig-name descname"><spanclass="pre">quick_run_v2</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">target_str</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">str</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">band</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">str</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">expt</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">float</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">emgain</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">float</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">nframe</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">int</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">skybg</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">Optional</span><spanclass="p"><spanclass="pre">[</span></span><spanclass="pre">float</span><spanclass="p"><spanclass="pre">]</span></span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">None</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">rotation</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">float</span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">0</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">shift</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">list</span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">[0,</span><spanclass="pre">0]</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">emset_input</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">bool</span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">False</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">cr_frame</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">bool</span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">True</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">camera_effect</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">bool</span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">True</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">prograss_bar</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">False</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">output</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">'./'</span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">ndarray</span></span></span><aclass="headerlink"href="#csst_cpic_sim.main.quick_run_v2"title="Permalink to this definition"></a></dt>
<dd><p>A quick run function for CPIC.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>target_str</strong> (<em>str</em>) – target string. See the input of <cite>target.target_file_load</cite> for more details.</p></li>
<li><p><strong>band</strong> (<em>str</em>) – band name</p></li>
<li><p><strong>expt</strong> (<em>float</em>) – exposure time in unit of second</p></li>
<li><p><strong>emgain</strong> (<em>float</em>) – EM gain value. Note that emgain is not the same as emset, controled by emset_input keyword.</p></li>
<li><p><strong>nframe</strong> (<em>int</em>) – number of frames</p></li>
<li><p><strong>skybg</strong> (<em>float</em><em> or </em><em>None</em>) – sky background in unit of magnitude. If None, sky background will not be set.</p></li>
<li><p><strong>rotation</strong> (<em>float</em>) – rotation of the telescope. in unit of degree. 0 means North is up.</p></li>
<li><p><strong>shift</strong> (<em>list</em>) – target shift in unit of arcsec</p></li>
<li><p><strong>emset_input</strong> (<em>bool</em>) – if True, emgain paramter is emset. Else, emgain is set using emgain parameter.</p></li>
<li><p><strong>cr_frame</strong> (<em>bool</em>) – if True, cosmic ray frame will be added to the image.</p></li>
<li><p><strong>camera_effect</strong> (<em>bool</em>) – if True, camera effect will be added to the image.</p></li>
<li><p><strong>prograss_bar</strong> (<em>bool</em>) – if True, a prograss_bar will be shown.</p></li>
<li><p><strong>output</strong> (<em>str</em>) – the output directory.</p></li>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.main.</span></span><spanclass="sig-name descname"><spanclass="pre">vis_observation</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="pre">target:</span><spanclass="pre">dict,</span><spanclass="pre">skybg:</span><spanclass="pre">float,</span><spanclass="pre">expt:</span><spanclass="pre">float,</span><spanclass="pre">nframe:</span><spanclass="pre">int,</span><spanclass="pre">band:</span><spanclass="pre">str,</span><spanclass="pre">emset:</span><spanclass="pre">int,</span><spanclass="pre">obsid:</span><spanclass="pre">int</span><spanclass="pre">=</span><spanclass="pre">41000000000,</span><spanclass="pre">rotation:</span><spanclass="pre">float</span><spanclass="pre">=</span><spanclass="pre">0,</span><spanclass="pre">shift:</span><spanclass="pre">list</span><spanclass="pre">=</span><spanclass="pre">[0,</span><spanclass="pre">0],</span><spanclass="pre">gnc_info:</span><spanclass="pre">dict</span><spanclass="pre">=</span><spanclass="pre">{},</span><spanclass="pre">csst_format:</span><spanclass="pre">bool</span><spanclass="pre">=</span><spanclass="pre">True,</span><spanclass="pre">camera=<csst_cpic_sim.camera.CpicVisEmccd</span><spanclass="pre">object>,</span><spanclass="pre">crmaker=<csst_cpic_sim.camera.CosmicRayFrameMaker</span><spanclass="pre">object>,</span><spanclass="pre">nsample:</span><spanclass="pre">int</span><spanclass="pre">=</span><spanclass="pre">1,</span><spanclass="pre">emgain=None,</span><spanclass="pre">prograss_bar=None,</span><spanclass="pre">output='./'</span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">ndarray</span></span></span><aclass="headerlink"href="#csst_cpic_sim.main.vis_observation"title="Permalink to this definition"></a></dt>
<dd><p>Observation simulation main process on visable band using EMCCD.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>target</strong> (<em>dict</em>) – target dictionary. See the input of <cite>target.spectrum_generator</cite> for more details.</p></li>
<li><p><strong>skybg</strong> (<em>float</em>) – sky background in unit of magnitude/arcsec^2</p></li>
<li><p><strong>expt</strong> (<em>float</em>) – exposure time in unit of second</p></li>
<li><p><strong>nframe</strong> (<em>int</em>) – number of frames</p></li>
<li><p><strong>band</strong> (<em>str</em>) – band name</p></li>
<li><p><strong>emset</strong> (<em>int</em>) – EM gain setting value. 1023(0x3FF) for ~1.0× EM gain.</p></li>
<li><p><strong>obsid</strong> (<em>int</em>) – observation ID. Start from 4 for CPIC, 01 for science observation. See the input of io.obsid_parser for more details.</p></li>
<li><p><strong>rotation</strong> (<em>float</em>) – rotation of the telescope. in unit of degree. 0 means North is up.</p></li>
<li><p><strong>shift</strong> (<em>list</em>) – target shift in unit of arcsec</p></li>
<li><p><strong>gnc_info</strong> (<em>dict</em>) – gnc_info dictionary. See the input of io.primary_hdu for more details.</p></li>
<li><p><strong>csst_format</strong> (<em>bool</em>) – if True, the output fits file will be in the csst format.</p></li>
<li><p><strong>crmaker</strong> (<aclass="reference internal"href="#csst_cpic_sim.camera.CosmicRayFrameMaker"title="csst_cpic_sim.camera.CosmicRayFrameMaker"><em>CosmicRayFrameMaker</em></a>) – CosmicRayFrameMaker object. See the input of camera.CosmicRayFrameMaker for more details.</p></li>
<li><p><strong>nsample</strong> (<em>int</em>) – number of samples for wide bandpass.</p></li>
<li><p><strong>emgain</strong> (<em>float</em><em> or </em><em>None</em>) – if None, emgain are set using emset parameter. Else, emgain are set using emgain parameter.</p></li>
<li><p><strong>prograss_bar</strong> (<em>bool</em>) – if True, a prograss_bar will be shown.</p></li>
<li><p><strong>output</strong> (<em>str</em>) – the output directory.</p></li>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.target.</span></span><spanclass="sig-name descname"><spanclass="pre">AlbedoCat</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">phase</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">float</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">metallicity</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">float</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">f_sed</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">float</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.target.AlbedoCat"title="Permalink to this definition"></a></dt>
<p>Generate albedo spectrum from the planet reflection model in Batalha et al. 2018</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>phase</strong> (<em>float</em>) – [degree], The phase angle of the planet, range from 0 to 180.</p></li>
<li><p><strong>metallicity</strong> (<em>float</em>) – The metallicity of the planet. log(Z/Zsun), range from 0 to 2.</p></li>
<li><p><strong>f_sed</strong> (<em>float</em>) – The sedimentation efficiency of the cloud. log(f_sed), range from -2 to 2. 2 is for cloud free case.</p></li>
</ul>
</dd>
</dl>
<pclass="rubric">Notes</p>
<p>f_sed is only reliable between -2 and log10(6) and the cloud free case (2).
Values between log10(6) and 2 are interpolated from the cloud free case (2) and log10(6).</p>
<p>Color Classification of Extrasolar Giant Planets: Prospects and Cautions
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.target.</span></span><spanclass="sig-name descname"><spanclass="pre">TargetOjbect</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">info</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">cstar</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.target.TargetOjbect"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">x</span></span><aclass="headerlink"href="#csst_cpic_sim.target.TargetOjbect.x"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">y</span></span><aclass="headerlink"href="#csst_cpic_sim.target.TargetOjbect.y"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">ra</span></span><aclass="headerlink"href="#csst_cpic_sim.target.TargetOjbect.ra"title="Permalink to this definition"></a></dt>
<dd><p>ra string for center star, such as ‘15d23m05s’</p>
<spanclass="sig-name descname"><spanclass="pre">dec</span></span><aclass="headerlink"href="#csst_cpic_sim.target.TargetOjbect.dec"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">distance</span></span><aclass="headerlink"href="#csst_cpic_sim.target.TargetOjbect.distance"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">image</span></span><aclass="headerlink"href="#csst_cpic_sim.target.TargetOjbect.image"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">spectrum</span></span><aclass="headerlink"href="#csst_cpic_sim.target.TargetOjbect.spectrum"title="Permalink to this definition"></a></dt>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.target.</span></span><spanclass="sig-name descname"><spanclass="pre">bcc_spectrum</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">coe_cloud</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">float</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">coe_metalicity</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">float</span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">ArraySpectralElement</span></span></span><aclass="headerlink"href="#csst_cpic_sim.target.bcc_spectrum"title="Permalink to this definition"></a></dt>
<dd><p>Albedo spectrum of planet using BCC model (Batalha et al. 2018),</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>coe_cloud</strong> (<em>float</em>) – The sedimentation efficiency of the cloud. log(f_sed), range from -2 to 2. 2 is for cloud free case.</p></li>
<li><p><strong>coe_metalicity</strong> (<em>float</em>) – The metallicity of the planet. log(Z/Zsun), range from 0 to 2.</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p>albedo spectrum of the planet</p>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.target.</span></span><spanclass="sig-name descname"><spanclass="pre">detect_template_path</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">template</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">str</span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">str</span></span></span><aclass="headerlink"href="#csst_cpic_sim.target.detect_template_path"title="Permalink to this definition"></a></dt>
<dd><p>Find template file in catalog folder or current folder.</p>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.target.</span></span><spanclass="sig-name descname"><spanclass="pre">extract_target_x_y</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">target</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">dict</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">ra0</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">Optional</span><spanclass="p"><spanclass="pre">[</span></span><spanclass="pre">str</span><spanclass="p"><spanclass="pre">]</span></span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">None</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">dec0</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">Optional</span><spanclass="p"><spanclass="pre">[</span></span><spanclass="pre">str</span><spanclass="p"><spanclass="pre">]</span></span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">None</span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">tuple</span></span></span><aclass="headerlink"href="#csst_cpic_sim.target.extract_target_x_y"title="Permalink to this definition"></a></dt>
<dd><p>extract x, y of target from target dict</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>target</strong> (<em>dict</em>) – target dict. must contain either (ra, dec) or (pangle, spearation)</p></li>
<li><p><strong>ra0</strong> (<em>str</em>) – ra of center star. must be provided if (ra, dec) of target is used</p></li>
<li><p><strong>dec0</strong> (<em>str</em>) – dec of center star. must be provided if (ra, dec) of target is used</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><strong>x, y</strong> – x, y of target in arcsec</p>
</dd>
<dtclass="field-odd">Return type</dt>
<ddclass="field-odd"><p>float</p>
</dd>
<dtclass="field-even">Raises</dt>
<ddclass="field-even"><ulclass="simple">
<li><p><strong>ValueError</strong> – if (ra, dec) of target is used but (ra, dec) of center star is not provided.</p></li>
<li><p><strong>ValueError</strong> – one of (ra, dec) or (pangle, spearation) is not provided.</p></li>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.target.</span></span><spanclass="sig-name descname"><spanclass="pre">hybrid_albedo_spectrum</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">coe_b</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">float</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">coe_r</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">float</span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">ArraySpectralElement</span></span></span><aclass="headerlink"href="#csst_cpic_sim.target.hybrid_albedo_spectrum"title="Permalink to this definition"></a></dt>
<dd><p>Albedo spectrum of planet using hybrid-jupiter-neptune model (Lacy et al. 2018)
jupiter and neptune spectrum is from Karkoschka’s 1994</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>coe_b</strong> (<em>float</em>) – coefficient of blue spectrum, 1 for jupiter, 0 for neptune</p></li>
<li><p><strong>coe_r</strong> (<em>float</em>) – coefficient of red spectrum, 1 for jupiter, 0 for neptune</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p>albedo spectrum of the planet</p>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.target.</span></span><spanclass="sig-name descname"><spanclass="pre">planet_contrast</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">planet_x_au</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">float</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">planet_y_au</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">float</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">phase_angle</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">float</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">radius</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">float</span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">float</span></span></span><aclass="headerlink"href="#csst_cpic_sim.target.planet_contrast"title="Permalink to this definition"></a></dt>
<dd><p>calculate the contrast of a planet</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>planet_x_au</strong> (<em>float</em>) – x position of the planet in au</p></li>
<li><p><strong>planet_y_au</strong> (<em>float</em>) – y position of the planet in au</p></li>
<li><p><strong>phase_angle</strong> (<em>float</em>) – phase angle of the planet in degree</p></li>
<li><p><strong>radius</strong> (<em>float</em>) – radius of the planet in jupiter radius</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><strong>contrast</strong> – contrast of the planet</p>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.target.</span></span><spanclass="sig-name descname"><spanclass="pre">spectrum_generator</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">targets</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">dict</span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">list</span></span></span><aclass="headerlink"href="#csst_cpic_sim.target.spectrum_generator"title="Permalink to this definition"></a></dt>
<dd><p>generate the spectrum due to the input target list</p>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.target.</span></span><spanclass="sig-name descname"><spanclass="pre">standard_spectrum</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">magnitude</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">float</span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">ArraySourceSpectrum</span></span></span><aclass="headerlink"href="#csst_cpic_sim.target.standard_spectrum"title="Permalink to this definition"></a></dt>
<dd><p>Standard spectrum of magnitude system.
For example, the standard_spectrum of vega megnitude is vega spectrum.
The standard spectrum of ab magnitude is a flat spectrum.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>magnitude</strong> (<em>float</em>) – magnitude of the standard spectrum</p>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.target.</span></span><spanclass="sig-name descname"><spanclass="pre">star_photlam</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">magnitude</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">float</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">sptype</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">str</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">is_blackbody</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">bool</span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">False</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">mag_input_band</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">str</span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">'f661'</span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">ArraySourceSpectrum</span></span></span><aclass="headerlink"href="#csst_cpic_sim.target.star_photlam"title="Permalink to this definition"></a></dt>
<dd><p>genrate flux spectrum of a star by its observal magnitude and spectral type</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>magnitude</strong> (<em>float</em>) – magnitude of the star</p></li>
<li><p><strong>sptype</strong> (<em>str</em>) – spectral type of the star</p></li>
<li><p><strong>is_blackbody</strong> (<em>bool</em>) – if True, use blackbody spectrum instead of ck04model</p></li>
<li><p><strong>mag_input_band</strong> (<em>str</em>) – bandpass of the input magnitude, default is f661</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p>spectrum of the star in photlam unit</p>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.target.</span></span><spanclass="sig-name descname"><spanclass="pre">target_file_load</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">target</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">Union</span><spanclass="p"><spanclass="pre">[</span></span><spanclass="pre">dict</span><spanclass="p"><spanclass="pre">,</span></span><spanclass="w"></span><spanclass="pre">str</span><spanclass="p"><spanclass="pre">]</span></span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">dict</span></span></span><aclass="headerlink"href="#csst_cpic_sim.target.target_file_load"title="Permalink to this definition"></a></dt>
<dd><p>Generate target dict from file, string or dict.</p>
<li><p><strong>target</strong> – dictionary of target. Format of input</p></li>
</ul>
</dd>
</dl>
<divclass="admonition note">
<pclass="admonition-title">Note</p>
<p>If target is a string start with <ahref="#id1"><spanclass="problematic"id="id2">*</span></a>, it will be treated as a formatted string.
e.g. “<ahref="#id3"><spanclass="problematic"id="id4">*</span></a>5.1/25.3(1.3,1.5)/22.1(2.3,-4.5)” which means a central object
with magnitude 5.1, and two substellar with magnitude 25.3 and 22.1, respectively.
The spectrum of each object is standard refernece spectrum of ABmag.
The first number in the parenthesis is the x position in arcsec, and the second is the y position.</p>
<p>If target is a string without <ahref="#id5"><spanclass="problematic"id="id6">*</span></a>, it will be treated as file name. And find the file in catalog folder.
The file need to be in yaml format.
And end with .yaml (note .yml not work). If not .yaml will be added.</p>
<p>If target is a dict, it will be returned directly.</p>
<p>If all the above conditions are not met, an empty dict will be returned.</p>
</div>
</dd></dl>
</section>
<sectionid="csst-cpic-sim-optics-module">
<h2>csst_cpic_sim.optics module<aclass="headerlink"href="#csst-cpic-sim-optics-module"title="Permalink to this heading"></a></h2>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.optics.</span></span><spanclass="sig-name descname"><spanclass="pre">filter_throughput</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">filter_name</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.optics.filter_throughput"title="Permalink to this definition"></a></dt>
<dd><p>Totally throughput of the each CPIC band.
Including the throughput of the filter, telescope, cpic, and camera QE.
If the filter_name is not supported, return the throughput of the default filter(f661).</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>filter_name</strong> (<em>str</em>) – The name of the filter.
One of [‘f565’, ‘f661’(default), ‘f743’, ‘f883’, ‘f940’, ‘f1265’, ‘f1425’, ‘f1542’]</p>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p>The throughput of the filter.</p>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.optics.</span></span><spanclass="sig-name descname"><spanclass="pre">focal_mask</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">image</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">iwa</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">platescale</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">throughtput</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">1e-06</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.optics.focal_mask"title="Permalink to this definition"></a></dt>
<dd><p>Mask the image outside the inner working angle.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>image</strong> (<em>np.ndarray</em>) – The image to be masked.</p></li>
<li><p><strong>iwa</strong> (<em>float</em>) – The inner working angle. Unit: arcsec.</p></li>
<li><p><strong>platescale</strong> (<em>float</em>) – The platescale of the image. Unit: arcsec/pixel.</p></li>
<li><p><strong>throughtput</strong> (<em>float</em>) – The throughtput of the mask. The default is 1e-6.</p></li>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.camera.</span></span><spanclass="sig-name descname"><spanclass="pre">CRobj</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">flux</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">angle</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">sigma</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">length</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.camera.CRobj"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">flux</span></span><aclass="headerlink"href="#csst_cpic_sim.camera.CRobj.flux"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">angle</span></span><aclass="headerlink"href="#csst_cpic_sim.camera.CRobj.angle"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">sigma</span></span><aclass="headerlink"href="#csst_cpic_sim.camera.CRobj.sigma"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">length</span></span><aclass="headerlink"href="#csst_cpic_sim.camera.CRobj.length"title="Permalink to this definition"></a></dt>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.camera.</span></span><spanclass="sig-name descname"><spanclass="pre">CosmicRayFrameMaker</span></span><aclass="headerlink"href="#csst_cpic_sim.camera.CosmicRayFrameMaker"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">make_CR</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">length</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">sigma</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">seed</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">-</span><spanclass="pre">1</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.camera.CosmicRayFrameMaker.make_CR"title="Permalink to this definition"></a></dt>
<dd><p>make a image of cosmic ray with given length and sigma.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>length</strong> (<em>int</em>) – The length of the cosmic ray in pixel.</p></li>
<li><p><strong>sigma</strong> (<em>float</em>) – The width of the cosmic ray in pixel.</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><strong>output</strong> – The image of cosmic ray.</p>
<spanclass="sig-name descname"><spanclass="pre">make_cr_frame</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">shape</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">expt</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">seed</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">-</span><spanclass="pre">1</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.camera.CosmicRayFrameMaker.make_cr_frame"title="Permalink to this definition"></a></dt>
<dd><p>make a cosmic ray frame.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>shape</strong> (<em>list</em>) – The size of the image in pixel.</p></li>
<li><p><strong>expt</strong> (<em>float</em>) – The exposure time in second.</p></li>
<li><p><strong>seed</strong> (<em>int</em><em>, </em><em>optional</em>) – The random seed. The default is -1. If seed is -1, the seed will be randomly selected.</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><strong>image</strong> – The cosmic ray frame.</p>
<spanclass="sig-name descname"><spanclass="pre">random_CR_parameter</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">expt</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">pixsize</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.camera.CosmicRayFrameMaker.random_CR_parameter"title="Permalink to this definition"></a></dt>
<dd><p>randomly generate cosmic ray parameters, including number, length, flux, sigma and angle.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>expt</strong> (<em>float</em>) – The exposure time in second.</p></li>
<li><p><strong>pixsize</strong> (<em>list</em>) – The size of the image in pixel.</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><strong>CRs</strong> – A list of cosmic ray objects.</p>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.camera.</span></span><spanclass="sig-name descname"><spanclass="pre">CpicVisEmccd</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">config_dict</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.camera.CpicVisEmccd"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">switch</span></span><aclass="headerlink"href="#csst_cpic_sim.camera.CpicVisEmccd.switch"title="Permalink to this definition"></a></dt>
<dd><p>A dictionary to switch on/off the camera effects.</p>
<spanclass="sig-name descname"><spanclass="pre">bias_frame</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.camera.CpicVisEmccd.bias_frame"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">config_init</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.camera.CpicVisEmccd.config_init"title="Permalink to this definition"></a></dt>
<dd><p>initialize the camera.
If the config is set, call this function to update the config.</p>
<spanclass="sig-name descname"><spanclass="pre">em_fix_fuc_fit</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">emgain</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.camera.CpicVisEmccd.em_fix_fuc_fit"title="Permalink to this definition"></a></dt>
<dd><p>Calculate the emgain fix coeficient to fix the gamma distribution.
The coeficient is from fixing of ideal emgain distribution.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>emgain</strong> (<em>float</em>) – The emgain.</p>
<spanclass="sig-name descname"><spanclass="pre">emgain_set</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">em_set</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">ccd_temp</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">self_update</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">True</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.camera.CpicVisEmccd.emgain_set"title="Permalink to this definition"></a></dt>
<dd><p>Set emgain from em set value.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>em_set</strong> (<em>int</em>) – em set value. 3FF is about 1.17×, 200 is about 1000×.</p></li>
<li><p><strong>ccd_temp</strong> (<em>float</em><em>, </em><em>optional</em>) – CCD temperature. If not given, use the current ccd temperature.</p></li>
<li><p><strong>self_update</strong> (<em>bool</em><em>, </em><em>optional</em>) – if True, update the emgain and emset. Default is True.
<spanclass="sig-name descname"><spanclass="pre">emregester_blooming</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">image</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">max_iteration</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">5</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.camera.CpicVisEmccd.emregester_blooming"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">nonlinear_effect</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">image</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.camera.CpicVisEmccd.nonlinear_effect"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">readout</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">image_focal</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">em_set</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">expt_set</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">image_cosmic_ray</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">False</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">emgain</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.camera.CpicVisEmccd.readout"title="Permalink to this definition"></a></dt>
<dd><p>From focal planet image to ccd output.
Interface function for emccd. Simulate the readout process.</p>
<li><p><strong>em_set</strong> (<em>int</em>) – emgain set value.</p></li>
<li><p><strong>expt_set</strong> (<em>float</em>) – exposure time set value. Unit: s (0 mains 1ms)</p></li>
<li><p><strong>image_cosmic_ray</strong> (<em>np.ndarray</em><em>, </em><em>optional</em>) – cosmic ray image. Unit: photon-electron/pixel</p></li>
<li><p><strong>emgain</strong> (<em>float</em><em>, </em><em>optional</em>) – if not None, use the given emgain. Else, calculate the emgain using em_set</p></li>
<spanclass="sig-name descname"><spanclass="pre">time_syn</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">t</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">readout</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">True</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">initial</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">False</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.camera.CpicVisEmccd.time_syn"title="Permalink to this definition"></a></dt>
<dd><p>time synchronization and update the system time and ccd temperature</p>
<li><p><strong>readout</strong> (<em>bool</em><em>, </em><em>optional</em>) – If the camera is readout before time synchronization, set readout to True
if True, the ccd temperature will increase, otherwise, it will decrease</p></li>
<li><p><strong>initial</strong> (<em>bool</em><em>, </em><em>optional</em>) – If inital is True, the ccd will be intialized to the cooler temperature</p></li>
<spanclass="sig-name descname"><spanclass="pre">vertical_blooming</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">image</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.camera.CpicVisEmccd.vertical_blooming"title="Permalink to this definition"></a></dt>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.camera.</span></span><spanclass="sig-name descname"><spanclass="pre">sky_frame_maker</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">band</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">skybg</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">platescale</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">shape</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.camera.sky_frame_maker"title="Permalink to this definition"></a></dt>
<dd><p>generate a sky background frame.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>band</strong> (<em>str</em>) – The band of the sky background.</p></li>
<li><p><strong>skybg</strong> (<em>str</em>) – The sky background file name.</p></li>
<li><p><strong>platescale</strong> (<em>float</em>) – The platescale of the camera in arcsec/pixel.</p></li>
<li><p><strong>shape</strong> (<em>tuple</em>) – The shape of the output frame. (y, x)</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><strong>sky_bkg_frame</strong> – The sky background frame.</p>
</dd>
<dtclass="field-odd">Return type</dt>
<ddclass="field-odd"><p>numpy.ndarray</p>
</dd>
</dl>
</dd></dl>
</section>
<sectionid="csst-cpic-sim-io-module">
<h2>csst_cpic_sim.io module<aclass="headerlink"href="#csst-cpic-sim-io-module"title="Permalink to this heading"></a></h2>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.io.</span></span><spanclass="sig-name descname"><spanclass="pre">check_and_update_fits_header</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">header</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.io.check_and_update_fits_header"title="Permalink to this definition"></a></dt>
<dd><p>Check the header keywords and update the description according to the data model.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>header</strong> (<em>astropy.io.fits.header.Header</em>) – The header to be checked.</p>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.io.</span></span><spanclass="sig-name descname"><spanclass="pre">datetime_obj_to_mjd</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">time_obj</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.io.datetime_obj_to_mjd"title="Permalink to this definition"></a></dt>
<dd><p>transfer datetime object to mean julian date (MJD).</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>time_obj</strong> (<em>datetime.datetime</em>) – The datetime object.</p>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p>The mean julian date (MJD).</p>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.io.</span></span><spanclass="sig-name descname"><spanclass="pre">frame_header</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">obs_info</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">index</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">primary_header</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">camera_dict</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.io.frame_header"title="Permalink to this definition"></a></dt>
<dd><p>Generate the header for a single frame.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>obs_info</strong> (<em>dict</em>) – Dictionary of parameters. See <cite>save_fits</cite> function.</p></li>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.io.</span></span><spanclass="sig-name descname"><spanclass="pre">obsid_parser</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">obsid</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">int</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.io.obsid_parser"title="Permalink to this definition"></a></dt>
<dd><p>Parse the obsid to get the obstype.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>obsid</strong> (<em>str</em>) – The obsid of the observation.
Obsid must be 11 digits and start with 5 for CPIC.</p>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p>The obstype of the observation.</p>
</dd>
<dtclass="field-odd">Return type</dt>
<ddclass="field-odd"><p>str</p>
</dd>
<dtclass="field-even">Raises</dt>
<ddclass="field-even"><p><strong>ValueError</strong> – If the obsid is not 11 digits or does not start with 5.</p>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.io.</span></span><spanclass="sig-name descname"><spanclass="pre">primary_hdu</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">obs_info</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">dict</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">gnc_info</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">dict</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">filename_output</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">False</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.io.primary_hdu"title="Permalink to this definition"></a></dt>
<dd><p>Generate the primary hdu of the fits file.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>obs_info</strong> (<em>dict</em>) – The parameters of the observation. See <cite>save_fits</cite> function.</p></li>
<li><p><strong>gnc_info</strong> (<em>dict</em>) – The gnc information of the observation.</p></li>
<li><p><strong>filename_output</strong> (<em>bool</em><em> (</em><em>optional</em><em>)</em>) – If True, the folder and the filename will be returned.</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><ulclass="simple">
<li><p><em>fits.PrimaryHDU</em> – The primary hdu of the fits file.</p></li>
<li><p><em>str, str</em> – The folder and filename of the fits file. Only returned if filename_output is True.</p></li>
</ul>
</p>
</dd>
</dl>
<pclass="rubric">Notes</p>
<p>The gnc_info dict should contain the information of orbit and observation.
these informations are used to genrated the hdu header. Refer to the data model for more information.</p>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.io.</span></span><spanclass="sig-name descname"><spanclass="pre">save_fits</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">images</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">obs_info</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">gnc_info</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">camera_dict</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">{}</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">csst_format</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">True</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">output_folder</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">'./'</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.io.save_fits"title="Permalink to this definition"></a></dt>
<dd><p>Save the image to a fits file.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>images</strong> (<em>numpy.ndarray</em>) – Image array to be saved.</p></li>
<li><p><strong>obs_info</strong> (<em>dict</em>) – <p>Dictionary of observation informations.
Must contain the following keys</p>
<ul>
<li><dlclass="simple">
<dt>band: str</dt><dd><ul>
<li><p>Band of the image.</p></li>
</ul>
</dd>
</dl>
</li>
<li><dlclass="simple">
<dt>expt: float</dt><dd><ul>
<li><p>Exposure time of the each image.</p></li>
</ul>
</dd>
</dl>
</li>
<li><dlclass="simple">
<dt>nframe: int</dt><dd><ul>
<li><p>Number of frames in the image.</p></li>
</ul>
</dd>
</dl>
</li>
<li><dlclass="simple">
<dt>emgain: int</dt><dd><ul>
<li><p>EM gain of the camera.</p></li>
</ul>
</dd>
</dl>
</li>
<li><dlclass="simple">
<dt>obsid: str</dt><dd><ul>
<li><p>Observation ID. Obsid must be 11 digits and start with 5 for CPIC. See pharse_obsid() for details.</p></li>
</ul>
</dd>
</dl>
</li>
<li><dlclass="simple">
<dt>rotation: float</dt><dd><ul>
<li><p>Rotation angle of the image.</p></li>
</ul>
</dd>
</dl>
</li>
<li><dlclass="simple">
<dt>shift: list</dt><dd><ul>
<li><p>Shift of the image.</p></li>
</ul>
</dd>
</dl>
</li>
</ul>
</p></li>
<li><p><strong>gnc_info</strong> (<em>dict</em>) – Dictionary of GNC information.
Contains the keywords in the primary header. See primary_hdu() for details.</p></li>
<li><p><strong>csst_format</strong> (<em>bool</em><em>, </em><em>optional</em>) – Whether to save the fits file in CSST format, by default True.</p></li>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.io.</span></span><spanclass="sig-name descname"><spanclass="pre">save_fits_simple</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">images</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">obs_info</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">output_folder</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">'./'</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.io.save_fits_simple"title="Permalink to this definition"></a></dt>
<dd><p>Save the image to a fits file with a simple header to TMP directory.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>images</strong> (<em>numpy.ndarray</em>) – Image array to be written.</p></li>
<li><p><strong>obs_info</strong> (<em>dict</em>) – Dictionary of observation informations. See <cite>save_fits</cite> function.</p></li>
</ul>
</dd>
<dtclass="field-even">Return type</dt>
<ddclass="field-even"><p>Filename of the saved fits file.</p>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.io.</span></span><spanclass="sig-name descname"><spanclass="pre">set_up_logger</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">log_dir</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.io.set_up_logger"title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</section>
<sectionid="csst-cpic-sim-config-module">
<h2>csst_cpic_sim.config module<aclass="headerlink"href="#csst-cpic-sim-config-module"title="Permalink to this heading"></a></h2>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.config.</span></span><spanclass="sig-name descname"><spanclass="pre">iso_time</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">time</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.config.iso_time"title="Permalink to this definition"></a></dt>
<dd><p>Transfer relative time to iso time format</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>time</strong> (<em>str</em><em> or </em><em>float</em>) – The relative time in seconds.</p>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.config.</span></span><spanclass="sig-name descname"><spanclass="pre">load_refdata_path</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">config_aim</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.config.load_refdata_path"title="Permalink to this definition"></a></dt>
<dd><p>Load refdata path.
The refdata path is stored in config_aim file. If not found, set it.</p>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.config.</span></span><spanclass="sig-name descname"><spanclass="pre">relative_time</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">time</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.config.relative_time"title="Permalink to this definition"></a></dt>
<dd><p>Transfer iso time format to relative time in seconds</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>time</strong> (<em>str</em><em> or </em><em>float</em>) – The iso time format.</p>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p>The relative time in seconds.</p>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.config.</span></span><spanclass="sig-name descname"><spanclass="pre">replace_cpism_refdata</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">config</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">dict</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">output</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">str</span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">'$'</span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">None</span></span></span><aclass="headerlink"href="#csst_cpic_sim.config.replace_cpism_refdata"title="Permalink to this definition"></a></dt>
<dd><p>Replace the cpism_refdata in the config.
In the config file, we use ${cpism_refdata} to indicate the cpism_refdata.
This function is used to replace the cpism_refdata in the config, or replace back.</p>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.config.</span></span><spanclass="sig-name descname"><spanclass="pre">setup_config</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">new_config</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.config.setup_config"title="Permalink to this definition"></a></dt>
<dd><p>Set up config from a dict.
Some of the configs need to calcuate.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>new_config</strong> (<em>dict</em>) – new config dict.</p>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.config.</span></span><spanclass="sig-name descname"><spanclass="pre">which_focalplane</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">band</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.config.which_focalplane"title="Permalink to this definition"></a></dt>
<dd><p>Return the name of the focalplane which the band belongs to.
right now only support vis</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>band</strong> (<em>str</em>) – The name of the band.</p>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p>The name of the focalplane.
‘vis’ or ‘nir’ or ‘wfs’</p>
</dd>
<dtclass="field-odd">Return type</dt>
<ddclass="field-odd"><p>str</p>
</dd>
<dtclass="field-even">Raises</dt>
<ddclass="field-even"><p><strong>ValueError</strong> – If the band is not in [‘f565’, ‘f661’, ‘f743’, ‘f883’, ‘f940’, ‘f1265’, ‘f1425’, ‘f1542’, ‘wfs’]</p>
</dd>
</dl>
</dd></dl>
</section>
<sectionid="csst-cpic-sim-utils-module">
<h2>csst_cpic_sim.utils module<aclass="headerlink"href="#csst-cpic-sim-utils-module"title="Permalink to this heading"></a></h2>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.utils.</span></span><spanclass="sig-name descname"><spanclass="pre">Logger</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">filename</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">level</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">'INFO'</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.utils.Logger"title="Permalink to this definition"></a></dt>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.utils.</span></span><spanclass="sig-name descname"><spanclass="pre">psf_imshow</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">psf</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">vmin</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">1e-08</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">vmax</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">0.1</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">log</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">True</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">region</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">1</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.utils.psf_imshow"title="Permalink to this definition"></a></dt>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.utils.</span></span><spanclass="sig-name descname"><spanclass="pre">random_seed_select</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">seed</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">-</span><spanclass="pre">1</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.utils.random_seed_select"title="Permalink to this definition"></a></dt>
<dd><p>Select a random seed for numpy.random and return it.</p>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.</span></span><spanclass="sig-name descname"><spanclass="pre">CosmicRayFrameMaker</span></span><aclass="headerlink"href="#csst_cpic_sim.CosmicRayFrameMaker"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">make_CR</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">length</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">sigma</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">seed</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">-</span><spanclass="pre">1</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.CosmicRayFrameMaker.make_CR"title="Permalink to this definition"></a></dt>
<dd><p>make a image of cosmic ray with given length and sigma.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>length</strong> (<em>int</em>) – The length of the cosmic ray in pixel.</p></li>
<li><p><strong>sigma</strong> (<em>float</em>) – The width of the cosmic ray in pixel.</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><strong>output</strong> – The image of cosmic ray.</p>
<spanclass="sig-name descname"><spanclass="pre">make_cr_frame</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">shape</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">expt</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">seed</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">-</span><spanclass="pre">1</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.CosmicRayFrameMaker.make_cr_frame"title="Permalink to this definition"></a></dt>
<dd><p>make a cosmic ray frame.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>shape</strong> (<em>list</em>) – The size of the image in pixel.</p></li>
<li><p><strong>expt</strong> (<em>float</em>) – The exposure time in second.</p></li>
<li><p><strong>seed</strong> (<em>int</em><em>, </em><em>optional</em>) – The random seed. The default is -1. If seed is -1, the seed will be randomly selected.</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><strong>image</strong> – The cosmic ray frame.</p>
<spanclass="sig-name descname"><spanclass="pre">random_CR_parameter</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">expt</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">pixsize</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.CosmicRayFrameMaker.random_CR_parameter"title="Permalink to this definition"></a></dt>
<dd><p>randomly generate cosmic ray parameters, including number, length, flux, sigma and angle.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>expt</strong> (<em>float</em>) – The exposure time in second.</p></li>
<li><p><strong>pixsize</strong> (<em>list</em>) – The size of the image in pixel.</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><strong>CRs</strong> – A list of cosmic ray objects.</p>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.</span></span><spanclass="sig-name descname"><spanclass="pre">extract_target_x_y</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">target</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">dict</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">ra0</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">Optional</span><spanclass="p"><spanclass="pre">[</span></span><spanclass="pre">str</span><spanclass="p"><spanclass="pre">]</span></span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">None</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">dec0</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">Optional</span><spanclass="p"><spanclass="pre">[</span></span><spanclass="pre">str</span><spanclass="p"><spanclass="pre">]</span></span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">None</span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">tuple</span></span></span><aclass="headerlink"href="#csst_cpic_sim.extract_target_x_y"title="Permalink to this definition"></a></dt>
<dd><p>extract x, y of target from target dict</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>target</strong> (<em>dict</em>) – target dict. must contain either (ra, dec) or (pangle, spearation)</p></li>
<li><p><strong>ra0</strong> (<em>str</em>) – ra of center star. must be provided if (ra, dec) of target is used</p></li>
<li><p><strong>dec0</strong> (<em>str</em>) – dec of center star. must be provided if (ra, dec) of target is used</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><strong>x, y</strong> – x, y of target in arcsec</p>
</dd>
<dtclass="field-odd">Return type</dt>
<ddclass="field-odd"><p>float</p>
</dd>
<dtclass="field-even">Raises</dt>
<ddclass="field-even"><ulclass="simple">
<li><p><strong>ValueError</strong> – if (ra, dec) of target is used but (ra, dec) of center star is not provided.</p></li>
<li><p><strong>ValueError</strong> – one of (ra, dec) or (pangle, spearation) is not provided.</p></li>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.</span></span><spanclass="sig-name descname"><spanclass="pre">focal_mask</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">image</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">iwa</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">platescale</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">throughtput</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">1e-06</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.focal_mask"title="Permalink to this definition"></a></dt>
<dd><p>Mask the image outside the inner working angle.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>image</strong> (<em>np.ndarray</em>) – The image to be masked.</p></li>
<li><p><strong>iwa</strong> (<em>float</em>) – The inner working angle. Unit: arcsec.</p></li>
<li><p><strong>platescale</strong> (<em>float</em>) – The platescale of the image. Unit: arcsec/pixel.</p></li>
<li><p><strong>throughtput</strong> (<em>float</em>) – The throughtput of the mask. The default is 1e-6.</p></li>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.</span></span><spanclass="sig-name descname"><spanclass="pre">planet_contrast</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">planet_x_au</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">float</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">planet_y_au</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">float</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">phase_angle</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">float</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">radius</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">float</span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">float</span></span></span><aclass="headerlink"href="#csst_cpic_sim.planet_contrast"title="Permalink to this definition"></a></dt>
<dd><p>calculate the contrast of a planet</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>planet_x_au</strong> (<em>float</em>) – x position of the planet in au</p></li>
<li><p><strong>planet_y_au</strong> (<em>float</em>) – y position of the planet in au</p></li>
<li><p><strong>phase_angle</strong> (<em>float</em>) – phase angle of the planet in degree</p></li>
<li><p><strong>radius</strong> (<em>float</em>) – radius of the planet in jupiter radius</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><strong>contrast</strong> – contrast of the planet</p>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.</span></span><spanclass="sig-name descname"><spanclass="pre">quick_run_v2</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">target_str</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">str</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">band</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">str</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">expt</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">float</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">emgain</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">float</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">nframe</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">int</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">skybg</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">Optional</span><spanclass="p"><spanclass="pre">[</span></span><spanclass="pre">float</span><spanclass="p"><spanclass="pre">]</span></span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">None</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">rotation</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">float</span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">0</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">shift</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">list</span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">[0,</span><spanclass="pre">0]</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">emset_input</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">bool</span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">False</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">cr_frame</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">bool</span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">True</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">camera_effect</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">bool</span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">True</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">prograss_bar</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">False</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">output</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">'./'</span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">ndarray</span></span></span><aclass="headerlink"href="#csst_cpic_sim.quick_run_v2"title="Permalink to this definition"></a></dt>
<dd><p>A quick run function for CPIC.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>target_str</strong> (<em>str</em>) – target string. See the input of <cite>target.target_file_load</cite> for more details.</p></li>
<li><p><strong>band</strong> (<em>str</em>) – band name</p></li>
<li><p><strong>expt</strong> (<em>float</em>) – exposure time in unit of second</p></li>
<li><p><strong>emgain</strong> (<em>float</em>) – EM gain value. Note that emgain is not the same as emset, controled by emset_input keyword.</p></li>
<li><p><strong>nframe</strong> (<em>int</em>) – number of frames</p></li>
<li><p><strong>skybg</strong> (<em>float</em><em> or </em><em>None</em>) – sky background in unit of magnitude. If None, sky background will not be set.</p></li>
<li><p><strong>rotation</strong> (<em>float</em>) – rotation of the telescope. in unit of degree. 0 means North is up.</p></li>
<li><p><strong>shift</strong> (<em>list</em>) – target shift in unit of arcsec</p></li>
<li><p><strong>emset_input</strong> (<em>bool</em>) – if True, emgain paramter is emset. Else, emgain is set using emgain parameter.</p></li>
<li><p><strong>cr_frame</strong> (<em>bool</em>) – if True, cosmic ray frame will be added to the image.</p></li>
<li><p><strong>camera_effect</strong> (<em>bool</em>) – if True, camera effect will be added to the image.</p></li>
<li><p><strong>prograss_bar</strong> (<em>bool</em>) – if True, a prograss_bar will be shown.</p></li>
<li><p><strong>output</strong> (<em>str</em>) – the output directory.</p></li>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.</span></span><spanclass="sig-name descname"><spanclass="pre">sky_frame_maker</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">band</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">skybg</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">platescale</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">shape</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#csst_cpic_sim.sky_frame_maker"title="Permalink to this definition"></a></dt>
<dd><p>generate a sky background frame.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>band</strong> (<em>str</em>) – The band of the sky background.</p></li>
<li><p><strong>skybg</strong> (<em>str</em>) – The sky background file name.</p></li>
<li><p><strong>platescale</strong> (<em>float</em>) – The platescale of the camera in arcsec/pixel.</p></li>
<li><p><strong>shape</strong> (<em>tuple</em>) – The shape of the output frame. (y, x)</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><strong>sky_bkg_frame</strong> – The sky background frame.</p>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.</span></span><spanclass="sig-name descname"><spanclass="pre">spectrum_generator</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">targets</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">dict</span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">list</span></span></span><aclass="headerlink"href="#csst_cpic_sim.spectrum_generator"title="Permalink to this definition"></a></dt>
<dd><p>generate the spectrum due to the input target list</p>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.</span></span><spanclass="sig-name descname"><spanclass="pre">star_photlam</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">magnitude</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">float</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">sptype</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">str</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">is_blackbody</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">bool</span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">False</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">mag_input_band</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">str</span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">'f661'</span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">ArraySourceSpectrum</span></span></span><aclass="headerlink"href="#csst_cpic_sim.star_photlam"title="Permalink to this definition"></a></dt>
<dd><p>genrate flux spectrum of a star by its observal magnitude and spectral type</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>magnitude</strong> (<em>float</em>) – magnitude of the star</p></li>
<li><p><strong>sptype</strong> (<em>str</em>) – spectral type of the star</p></li>
<li><p><strong>is_blackbody</strong> (<em>bool</em>) – if True, use blackbody spectrum instead of ck04model</p></li>
<li><p><strong>mag_input_band</strong> (<em>str</em>) – bandpass of the input magnitude, default is f661</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p>spectrum of the star in photlam unit</p>
<spanclass="sig-prename descclassname"><spanclass="pre">csst_cpic_sim.</span></span><spanclass="sig-name descname"><spanclass="pre">vis_observation</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="pre">target:</span><spanclass="pre">dict,</span><spanclass="pre">skybg:</span><spanclass="pre">float,</span><spanclass="pre">expt:</span><spanclass="pre">float,</span><spanclass="pre">nframe:</span><spanclass="pre">int,</span><spanclass="pre">band:</span><spanclass="pre">str,</span><spanclass="pre">emset:</span><spanclass="pre">int,</span><spanclass="pre">obsid:</span><spanclass="pre">int</span><spanclass="pre">=</span><spanclass="pre">41000000000,</span><spanclass="pre">rotation:</span><spanclass="pre">float</span><spanclass="pre">=</span><spanclass="pre">0,</span><spanclass="pre">shift:</span><spanclass="pre">list</span><spanclass="pre">=</span><spanclass="pre">[0,</span><spanclass="pre">0],</span><spanclass="pre">gnc_info:</span><spanclass="pre">dict</span><spanclass="pre">=</span><spanclass="pre">{},</span><spanclass="pre">csst_format:</span><spanclass="pre">bool</span><spanclass="pre">=</span><spanclass="pre">True,</span><spanclass="pre">camera=<csst_cpic_sim.camera.CpicVisEmccd</span><spanclass="pre">object>,</span><spanclass="pre">crmaker=<csst_cpic_sim.camera.CosmicRayFrameMaker</span><spanclass="pre">object>,</span><spanclass="pre">nsample:</span><spanclass="pre">int</span><spanclass="pre">=</span><spanclass="pre">1,</span><spanclass="pre">emgain=None,</span><spanclass="pre">prograss_bar=None,</span><spanclass="pre">output='./'</span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">ndarray</span></span></span><aclass="headerlink"href="#csst_cpic_sim.vis_observation"title="Permalink to this definition"></a></dt>
<dd><p>Observation simulation main process on visable band using EMCCD.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>target</strong> (<em>dict</em>) – target dictionary. See the input of <cite>target.spectrum_generator</cite> for more details.</p></li>
<li><p><strong>skybg</strong> (<em>float</em>) – sky background in unit of magnitude/arcsec^2</p></li>
<li><p><strong>expt</strong> (<em>float</em>) – exposure time in unit of second</p></li>
<li><p><strong>nframe</strong> (<em>int</em>) – number of frames</p></li>
<li><p><strong>band</strong> (<em>str</em>) – band name</p></li>
<li><p><strong>emset</strong> (<em>int</em>) – EM gain setting value. 1023(0x3FF) for ~1.0× EM gain.</p></li>
<li><p><strong>obsid</strong> (<em>int</em>) – observation ID. Start from 4 for CPIC, 01 for science observation. See the input of io.obsid_parser for more details.</p></li>
<li><p><strong>rotation</strong> (<em>float</em>) – rotation of the telescope. in unit of degree. 0 means North is up.</p></li>
<li><p><strong>shift</strong> (<em>list</em>) – target shift in unit of arcsec</p></li>
<li><p><strong>gnc_info</strong> (<em>dict</em>) – gnc_info dictionary. See the input of io.primary_hdu for more details.</p></li>
<li><p><strong>csst_format</strong> (<em>bool</em>) – if True, the output fits file will be in the csst format.</p></li>
<li><p><strong>crmaker</strong> (<aclass="reference internal"href="#csst_cpic_sim.CosmicRayFrameMaker"title="csst_cpic_sim.CosmicRayFrameMaker"><em>CosmicRayFrameMaker</em></a>) – CosmicRayFrameMaker object. See the input of camera.CosmicRayFrameMaker for more details.</p></li>
<li><p><strong>nsample</strong> (<em>int</em>) – number of samples for wide bandpass.</p></li>
<li><p><strong>emgain</strong> (<em>float</em><em> or </em><em>None</em>) – if None, emgain are set using emset parameter. Else, emgain are set using emgain parameter.</p></li>
<li><p><strong>prograss_bar</strong> (<em>bool</em>) – if True, a prograss_bar will be shown.</p></li>
<li><p><strong>output</strong> (<em>str</em>) – the output directory.</p></li>