Commit b7f8c4fa authored by GZhao's avatar GZhao
Browse files

V2.0 developing initial

parent 6a5baa03
Pipeline #4230 failed with stage
in 0 seconds
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
使用教程
===========
仿真程序上手
-------------------------
.. toctree::
:maxdepth: 1
快速开始 </notebooks/0_main_example.ipynb>
程序模块使用说明
----------------------
.. toctree::
:maxdepth: 1
目标仿真模块 </notebooks/1_target_example.ipynb>
焦面模块 </notebooks/2_focus_example.ipynb>
观测效应仿真模块 </notebooks/3_obs_effect.ipynb>
相机仿真模块 </notebooks/4_camera_example.ipynb>
点扩散函数仿真模块 </notebooks/5_psf_example.ipynb>
import setuptools
import CpicImgSim
setuptools.setup(
name='csst_cpic_sim',
version='1.0.0',
name='CpicImgSim',
version=CpicImgSim.__version__,
author='CSST Team',
author_email='gzhao@niaot.ac.cn',
description='The CSST CPIC Simulation', # short description
......@@ -17,9 +18,9 @@ setuptools.setup(
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Scientific/Engineering :: Astronomy"
],
package_dir={'csst_cpic_sim': 'csst_cpic_sim'},
package_dir={'CpicImgSim': 'CpicImgSim'},
include_package_data=False,
install_requires=['numpy', 'scipy', 'astropy', 'pysynphot', 'hcipy', 'pandas'],
install_requires=['numpy', 'scipy', 'astropy', 'pysynphot', 'hcipy'],
python_requires='>=3.8',
)
[run]
branch = True
source = CpicImgSim
使用python运行unittest:
python -m unittest
使用coverage运行unittest
coverage run -m unittest
生成html报告
coverage html
\ No newline at end of file
import unittest
from csst_cpic_sim.camera import EMCCD
from CpicImgSim.camera import EMCCD
import numpy as np
......@@ -69,4 +69,17 @@ class TestEMCCD(unittest.TestCase):
if __name__ == '__main__':
unittest.main()
# unittest.main()
from CpicImgSim.camera import CPIC_VIS_EMCCD
emccd = CPIC_VIS_EMCCD()
emccd.emgain_fun(1023, -30)
bias_images = []
for _ in range(10):
bias = emccd.bias_frame(show=True)
bias_images.append(bias)
bias_images = np.array(bias_images)
from astropy.io import fits
fits.writeto("bias.fits", bias_images)
import unittest
from csst_cpic_sim.camera import CosmicRayFrameMaker, sky_frame_maker
from csst_cpic_sim.target import star_photlam
from csst_cpic_sim.optics import filter_throughput
from CpicImgSim.camera import CosmicRayFrameMaker, sky_frame_maker
from CpicImgSim.target import star_photlam
from CpicImgSim.optics import filter_throughput
import numpy as np
......
import unittest
from unittest import mock
from csst_cpic_sim.io import obsid_parser, primary_hdu, frame_header, save_fits_simple
import csst_cpic_sim.io as io
from CpicImgSim.io import obsid_parser, primary_hdu, frame_header, save_fits_simple
import CpicImgSim.io as io
from astropy.io import fits
import numpy as np
import yaml
......
import unittest
from csst_cpic_sim import observation_simulation, quick_run
from CpicImgSim import observation_simulation, quick_run
class TestMain(unittest.TestCase):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment