Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csst-sims
csst_msc_sim
Commits
fc33cf07
Commit
fc33cf07
authored
Apr 20, 2024
by
JX
😵
Browse files
Merge remote-tracking branch 'origin/develop'
parents
edd720e6
59814d64
Pipeline
#4233
passed with stage
in 0 seconds
Changes
32
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
requirements.txt
0 → 100644
View file @
fc33cf07
numpy
==1.26.4
astropy
==6.0.1
scipy
==1.11.4
GalSim
==2.5.2
PyYAML
==6.0.1
mpi4py
==3.1.6
sep
==1.2.1
healpy
==1.16.6
h5py
==3.11.0
Cython
==3.0.6
numba
==0.59.1
psutil
==5.9.8
toml
==0.10.2
lmfit
==1.2.2
\ No newline at end of file
run_sim.py
View file @
fc33cf07
from
ObservationSim.ObservationSim
import
Observation
from
ObservationSim.ObservationSim
import
Observation
from
ObservationSim._util
import
parse_args
,
make_run_dirs
,
generate_pointing_list
from
ObservationSim._util
import
parse_args
,
make_run_dirs
,
generate_pointing_list
from
pkg_resources
import
get_distribut
ion
from
importlib.metadata
import
vers
ion
import
os
import
os
import
yaml
import
yaml
import
shutil
import
shutil
...
@@ -24,7 +24,7 @@ def run_sim():
...
@@ -24,7 +24,7 @@ def run_sim():
None
None
"""
"""
# Get version of CSSTSim Package
# Get version of CSSTSim Package
__version__
=
get_distribut
ion
(
"CSSTSim"
)
.
version
__version__
=
vers
ion
(
"CSSTSim"
)
# Get run datetime
# Get run datetime
now
=
datetime
.
datetime
.
now
()
now
=
datetime
.
datetime
.
now
()
...
@@ -97,9 +97,7 @@ def run_sim():
...
@@ -97,9 +97,7 @@ def run_sim():
obs
=
Observation
(
config
=
config
,
Catalog
=
None
,
work_dir
=
config
[
'work_dir'
],
data_dir
=
config
[
'data_dir'
])
obs
=
Observation
(
config
=
config
,
Catalog
=
None
,
work_dir
=
config
[
'work_dir'
],
data_dir
=
config
[
'data_dir'
])
# Run simulation
# Run simulation
obs
.
runExposure_MPI_PointingList
(
obs
.
runExposure_MPI_PointingList
(
pointing_list
=
pointing_list
)
pointing_list
=
pointing_list
,
use_mpi
=
config
[
"run_option"
][
"use_mpi"
])
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
run_sim
()
run_sim
()
setup.py
View file @
fc33cf07
...
@@ -58,23 +58,32 @@ cti_module = [CTypes('ObservationSim.Instrument.Chip.libCTI.libmoduleCTI',
...
@@ -58,23 +58,32 @@ cti_module = [CTypes('ObservationSim.Instrument.Chip.libCTI.libmoduleCTI',
# name = "slssim_disperse",
# name = "slssim_disperse",
# ext_modules = cythonize(extensions),
# ext_modules = cythonize(extensions),
# )
# )
# 读取依赖列表requirements.txt
# 忽略#开头或者版本号不明确指定的条目
with
open
(
"requirements.txt"
,
"r"
)
as
f
:
requirements
=
[
req
.
strip
()
for
req
in
f
.
readlines
()
if
not
req
.
startswith
(
"#"
)
and
req
.
__contains__
(
"=="
)
]
setup
(
name
=
'CSSTSim'
,
setup
(
name
=
'CSSTSim'
,
version
=
'2.1.0'
,
version
=
'2.1.0'
,
packages
=
find_packages
(),
packages
=
find_packages
(),
install_requires
=
[
# install_requires=[
# 'numpy>=1.18.5',
# # 'numpy>=1.18.5',
# 'galsim>=2.2.4',
# # 'galsim>=2.2.4',
# 'pyyaml>=5.3.1',
# # 'pyyaml>=5.3.1',
# 'astropy>=4.0.1',
# # 'astropy>=4.0.1',
# 'scipy>=1.5.0',
# # 'scipy>=1.5.0',
# 'mpi4py>=3.0.3',
# # 'mpi4py>=3.0.3',
# 'sep>=1.0.3',
# # 'sep>=1.0.3',
# 'healpy>=1.14.0',
# # 'healpy>=1.14.0',
# 'h5py>=2.10.0',
# # 'h5py>=2.10.0',
# 'Cython>=0.29.21',
# # 'Cython>=0.29.21',
# 'numba>=0.50.1'
# # 'numba>=0.50.1'
],
# ],
package_data
=
{
package_data
=
{
'ObservationSim.Astrometry.lib'
:
[
'libshao.so'
],
'ObservationSim.Astrometry.lib'
:
[
'libshao.so'
],
'ObservationSim.Instrument.Chip.libBF'
:
[
'libmoduleBF.so'
],
'ObservationSim.Instrument.Chip.libBF'
:
[
'libmoduleBF.so'
],
...
@@ -89,11 +98,14 @@ setup(name='CSSTSim',
...
@@ -89,11 +98,14 @@ setup(name='CSSTSim',
'ObservationSim.Instrument.data.sls_conf'
:
[
'*.conf'
,
'*.fits'
],
'ObservationSim.Instrument.data.sls_conf'
:
[
'*.conf'
,
'*.fits'
],
'ObservationSim.Instrument.data.flatCube'
:
[
'*.fits'
],
'ObservationSim.Instrument.data.flatCube'
:
[
'*.fits'
],
'Catalog.data'
:
[
'*.fits'
,
'*.so'
],
'Catalog.data'
:
[
'*.fits'
,
'*.so'
],
'ObservationSim.Config.Header'
:[
'*.
header
'
,
'*.lst'
],
'ObservationSim.Config.Header'
:[
'*.
fits
'
,
'*.lst'
],
'ObservationSim.Straylight.data'
:
[
'*.dat'
],
'ObservationSim.Straylight.data'
:
[
'*.dat'
],
'ObservationSim.Straylight.data.sky'
:
[
'*.dat'
],
'ObservationSim.Straylight.data.sky'
:
[
'*.dat'
],
'ObservationSim.Straylight.lib'
:
[
'*'
],
'ObservationSim.Straylight.lib'
:
[
'*'
],
},
},
python_requires
=
">=3.11"
,
# Python版本要求
install_requires
=
requirements
,
ext_modules
=
cythonize
(
extensions
)
+
df_module
+
cti_module
,
ext_modules
=
cythonize
(
extensions
)
+
df_module
+
cti_module
,
cmdclass
=
{
'build_ext'
:
build_ext
}
cmdclass
=
{
'build_ext'
:
build_ext
}
)
)
tests/testData/csst_fz_gc0/config_C6.yaml
View file @
fc33cf07
...
@@ -24,7 +24,6 @@ pointing_file: "pointing_radec_246.5_40.dat"
...
@@ -24,7 +24,6 @@ pointing_file: "pointing_radec_246.5_40.dat"
# Whether to use MPI
# Whether to use MPI
run_option
:
run_option
:
use_mpi
:
YES
# NOTE: "n_threads" paramters is currently not used in the backend
# NOTE: "n_threads" paramters is currently not used in the backend
# simulation codes. It should be implemented later in the web frontend
# simulation codes. It should be implemented later in the web frontend
# in order to config the number of threads to request from NAOC cluster
# in order to config the number of threads to request from NAOC cluster
...
...
tests/test_BF_CTE.py
View file @
fc33cf07
...
@@ -80,7 +80,7 @@ class detModule_coverage(unittest.TestCase):
...
@@ -80,7 +80,7 @@ class detModule_coverage(unittest.TestCase):
def
__init__
(
self
,
methodName
=
'runTest'
):
def
__init__
(
self
,
methodName
=
'runTest'
):
super
(
detModule_coverage
,
self
).
__init__
(
methodName
)
super
(
detModule_coverage
,
self
).
__init__
(
methodName
)
##self.dataPath = "/public/home/chengliang/CSSOSDataProductsSims/csst-simulation/tests/UNIT_TEST_DATA" ##os.path.join(os.getenv('UNIT_TEST_DATA_ROOT'), 'csst_fz_gc1')
##self.dataPath = "/public/home/chengliang/CSSOSDataProductsSims/csst-simulation/tests/UNIT_TEST_DATA" ##os.path.join(os.getenv('UNIT_TEST_DATA_ROOT'), 'csst_fz_gc1')
self
.
dataPath
=
os
.
path
.
join
(
os
.
getenv
(
'UNIT_TEST_DATA_ROOT'
),
'csst_fz_msc'
)
self
.
dataPath
=
os
.
path
.
join
(
os
.
getenv
(
'UNIT_TEST_DATA_ROOT'
),
'csst_
msc_sim/csst_
fz_msc'
)
self
.
iccd
=
1
self
.
iccd
=
1
...
...
tests/test_PSFmodule.py
View file @
fc33cf07
...
@@ -39,7 +39,7 @@ def defineFilt(chip):
...
@@ -39,7 +39,7 @@ def defineFilt(chip):
class
PSFInterpModule_coverage
(
unittest
.
TestCase
):
class
PSFInterpModule_coverage
(
unittest
.
TestCase
):
def
__init__
(
self
,
methodName
=
'runTest'
):
def
__init__
(
self
,
methodName
=
'runTest'
):
super
(
PSFInterpModule_coverage
,
self
).
__init__
(
methodName
)
super
(
PSFInterpModule_coverage
,
self
).
__init__
(
methodName
)
self
.
dataPath
=
os
.
path
.
join
(
os
.
getenv
(
'UNIT_TEST_DATA_ROOT'
),
'csst_fz_msc'
)
self
.
dataPath
=
os
.
path
.
join
(
os
.
getenv
(
'UNIT_TEST_DATA_ROOT'
),
'csst_
msc_sim/csst_
fz_msc'
)
self
.
iccd
=
8
self
.
iccd
=
8
def
test_loadPSFSet
(
self
):
def
test_loadPSFSet
(
self
):
...
...
tests/test_SpecDisperse.py
View file @
fc33cf07
...
@@ -145,16 +145,22 @@ class TestSpecDisperse(unittest.TestCase):
...
@@ -145,16 +145,22 @@ class TestSpecDisperse(unittest.TestCase):
def
__init__
(
self
,
methodName
=
'runTest'
):
def
__init__
(
self
,
methodName
=
'runTest'
):
super
(
TestSpecDisperse
,
self
).
__init__
(
methodName
)
super
(
TestSpecDisperse
,
self
).
__init__
(
methodName
)
self
.
filePath
(
'csst_
fz_gc0
'
)
self
.
filePath
(
'csst_
msc_sim/test_sls_and_straylight
'
)
# self.conff = conff
# self.conff = conff
# self.throughputf = throughputf
# self.throughputf = throughputf
def
filePath
(
self
,
file_name
):
def
filePath
(
self
,
file_name
):
fn
=
os
.
path
.
join
(
os
.
getenv
(
'UNIT_TEST_DATA_ROOT'
),
file_name
)
fn
=
os
.
path
.
join
(
os
.
getenv
(
'UNIT_TEST_DATA_ROOT'
),
file_name
)
self
.
conff
=
os
.
path
.
join
(
fn
,
'CSST_GI2.conf'
)
self
.
conff
=
os
.
path
.
join
(
fn
,
'CSST_GI2.conf'
)
self
.
throughputf
=
os
.
path
.
join
(
fn
,
'GI.Throughput.1st.fits'
)
self
.
throughputf
=
os
.
path
.
join
(
fn
,
'GI.Throughput.1st.fits'
)
self
.
testDir
=
fn
self
.
testDir
=
fn
self
.
outDataFn
=
os
.
path
.
join
(
fn
,
'output'
)
if
os
.
path
.
isdir
(
self
.
outDataFn
):
pass
else
:
os
.
mkdir
(
self
.
outDataFn
)
def
test_rotate901
(
self
):
def
test_rotate901
(
self
):
m
=
np
.
array
([[
1
,
2
,
3
,
4
,
5
],[
6
,
7
,
8
,
9
,
10
],[
11
,
12
,
13
,
14
,
15
],[
16
,
17
,
18
,
19
,
20
],[
21
,
22
,
23
,
24
,
25
]])
m
=
np
.
array
([[
1
,
2
,
3
,
4
,
5
],[
6
,
7
,
8
,
9
,
10
],[
11
,
12
,
13
,
14
,
15
],[
16
,
17
,
18
,
19
,
20
],[
21
,
22
,
23
,
24
,
25
]])
...
@@ -231,16 +237,16 @@ class TestSpecDisperse(unittest.TestCase):
...
@@ -231,16 +237,16 @@ class TestSpecDisperse(unittest.TestCase):
ids1
=
wave_pix
[
ids
]
>
6500
ids1
=
wave_pix
[
ids
]
>
6500
print
(
'Spec disperse flux test'
)
print
(
'Spec disperse flux test'
)
self
.
assertTrue
(
np
.
mean
((
wave_flux
[
ids
][
ids1
]
-
sed_i
(
wave_pix
[
ids
][
ids1
]))
/
sed_i
(
wave_pix
[
ids
][
ids1
]))
<
0.004
)
self
.
assertTrue
(
np
.
mean
((
wave_flux
[
ids
][
ids1
]
-
sed_i
(
wave_pix
[
ids
][
ids1
]))
/
sed_i
(
wave_pix
[
ids
][
ids1
]))
<
0.004
)
plt
.
figure
()
#
plt.figure()
plt
.
plot
(
wave_pix
,
wave_flux
)
#
plt.plot(wave_pix, wave_flux)
plt
.
plot
(
sed
[
'WAVELENGTH'
],
sed
[
'FLUX'
])
#
plt.plot(sed['WAVELENGTH'], sed['FLUX'])
plt
.
xlim
(
6200
,
10000
)
#
plt.xlim(6200, 10000)
plt
.
ylim
(
1
,
3
)
#
plt.ylim(1, 3)
plt
.
yscale
(
'log'
)
#
plt.yscale('log')
plt
.
xlabel
(
'$\lambda$'
)
#
plt.xlabel('$\lambda$')
plt
.
ylabel
(
'$F\lambda$'
)
#
plt.ylabel('$F\lambda$')
plt
.
legend
([
'extracted'
,
'input'
])
#
plt.legend(['extracted', 'input'])
plt
.
show
()
#
plt.show()
def
test_Specdistperse2
(
self
):
def
test_Specdistperse2
(
self
):
...
@@ -303,16 +309,16 @@ class TestSpecDisperse(unittest.TestCase):
...
@@ -303,16 +309,16 @@ class TestSpecDisperse(unittest.TestCase):
self
.
assertTrue
(
fwhmx
/
deltLamda_pix
*
pix_scale
-
psf_fwhm
<
np
.
abs
(
0.02
))
self
.
assertTrue
(
fwhmx
/
deltLamda_pix
*
pix_scale
-
psf_fwhm
<
np
.
abs
(
0.02
))
# print('error is ',np.mean((wave_flux[ids][ids1] - sed_i(wave_pix[ids][ids1]))/sed_i(wave_pix[ids][ids1])))
# print('error is ',np.mean((wave_flux[ids][ids1] - sed_i(wave_pix[ids][ids1]))/sed_i(wave_pix[ids][ids1])))
# self.assertTrue(np.mean((wave_flux[ids][ids1] - sed_i(wave_pix[ids][ids1]))/sed_i(wave_pix[ids][ids1]))<0.004)
# self.assertTrue(np.mean((wave_flux[ids][ids1] - sed_i(wave_pix[ids][ids1]))/sed_i(wave_pix[ids][ids1]))<0.004)
plt
.
figure
()
#
plt.figure()
plt
.
plot
(
wave_pix
,
wave_flux
)
#
plt.plot(wave_pix, wave_flux)
plt
.
plot
(
sed
[
'WAVELENGTH'
],
sed
[
'FLUX'
])
#
plt.plot(sed['WAVELENGTH'], sed['FLUX'])
plt
.
xlim
(
6200
,
10000
)
#
plt.xlim(6200, 10000)
plt
.
ylim
(
1
,
75
)
#
plt.ylim(1, 75)
plt
.
yscale
(
'log'
)
#
plt.yscale('log')
plt
.
xlabel
(
'$\lambda$'
)
#
plt.xlabel('$\lambda$')
plt
.
ylabel
(
'$F\lambda$'
)
#
plt.ylabel('$F\lambda$')
plt
.
legend
([
'extracted'
,
'input'
])
#
plt.legend(['extracted', 'input'])
plt
.
show
()
#
plt.show()
def
test_Specdistperse3
(
self
):
def
test_Specdistperse3
(
self
):
...
@@ -484,7 +490,7 @@ class TestSpecDisperse(unittest.TestCase):
...
@@ -484,7 +490,7 @@ class TestSpecDisperse(unittest.TestCase):
print
(
'Spec double disperse test'
)
print
(
'Spec double disperse test'
)
from
astropy.io
import
fits
from
astropy.io
import
fits
fits
.
writeto
(
'test
.fits'
,
chip
.
img
.
array
,
overwrite
=
True
)
fits
.
writeto
(
os
.
path
.
join
(
self
.
outDataFn
,
'test_sls_doubleDisp
.fits'
)
,
chip
.
img
.
array
,
overwrite
=
True
)
# plt.figure()
# plt.figure()
# plt.imshow(chip.img.array)
# plt.imshow(chip.img.array)
...
...
tests/test_Straylight.py
View file @
fc33cf07
...
@@ -74,7 +74,7 @@ class TestStraylight(unittest.TestCase):
...
@@ -74,7 +74,7 @@ class TestStraylight(unittest.TestCase):
# print(file_name)
# print(file_name)
# fn = os.path.join(os.getenv('UNIT_TEST_DATA_ROOT'), file_name)
# fn = os.path.join(os.getenv('UNIT_TEST_DATA_ROOT'), file_name)
# self.pointingData = np.loadtxt(os.path.join(fn, 'Straylight_test.dat'), dtype=np.double)
# self.pointingData = np.loadtxt(os.path.join(fn, 'Straylight_test.dat'), dtype=np.double)
self
.
filePath
(
'csst_
fz_gc0
'
)
self
.
filePath
(
'csst_
msc_sim/test_sls_and_straylight
'
)
self
.
filter
=
filter
self
.
filter
=
filter
self
.
grating
=
grating
self
.
grating
=
grating
...
...
tests/test_darknoise_func.py
View file @
fc33cf07
...
@@ -60,7 +60,7 @@ def defineFilt(chip):
...
@@ -60,7 +60,7 @@ def defineFilt(chip):
class
detModule_coverage
(
unittest
.
TestCase
):
class
detModule_coverage
(
unittest
.
TestCase
):
def
__init__
(
self
,
methodName
=
'runTest'
):
def
__init__
(
self
,
methodName
=
'runTest'
):
super
(
detModule_coverage
,
self
).
__init__
(
methodName
)
super
(
detModule_coverage
,
self
).
__init__
(
methodName
)
self
.
dataPath
=
os
.
path
.
join
(
os
.
getenv
(
'UNIT_TEST_DATA_ROOT'
),
'csst_fz_msc'
)
self
.
dataPath
=
os
.
path
.
join
(
os
.
getenv
(
'UNIT_TEST_DATA_ROOT'
),
'csst_
msc_sim/csst_
fz_msc'
)
self
.
iccd
=
1
self
.
iccd
=
1
def
test_add_dark
(
self
):
def
test_add_dark
(
self
):
...
...
tests/
de
t_effect_unit
_test
.py
→
tests/
tes
t_effect_unit.py
View file @
fc33cf07
...
@@ -17,7 +17,7 @@ class DetTest(unittest.TestCase):
...
@@ -17,7 +17,7 @@ class DetTest(unittest.TestCase):
def
__init__
(
self
,
methodName
=
'runTest'
):
def
__init__
(
self
,
methodName
=
'runTest'
):
super
(
DetTest
,
self
).
__init__
(
methodName
)
super
(
DetTest
,
self
).
__init__
(
methodName
)
self
.
filePath
(
'csst_
fz_gc0
'
)
self
.
filePath
(
'csst_
msc_sim/test_sls_and_straylight
'
)
def
filePath
(
self
,
file_name
):
def
filePath
(
self
,
file_name
):
self
.
datafn
=
os
.
path
.
join
(
os
.
getenv
(
'UNIT_TEST_DATA_ROOT'
),
file_name
)
self
.
datafn
=
os
.
path
.
join
(
os
.
getenv
(
'UNIT_TEST_DATA_ROOT'
),
file_name
)
...
@@ -138,15 +138,15 @@ class DetTest(unittest.TestCase):
...
@@ -138,15 +138,15 @@ class DetTest(unittest.TestCase):
newimg
.
write
(
os
.
path
.
join
(
self
.
outDataFn
,
'test_badlines.fits'
))
newimg
.
write
(
os
.
path
.
join
(
self
.
outDataFn
,
'test_badlines.fits'
))
del
newimg
,
img
del
newimg
,
img
def
test_cte
(
self
):
#
def test_cte(self):
img
=
galsim
.
Image
(
200
,
200
,
init_value
=
1000
)
#
img = galsim.Image(200,200,init_value=1000)
img
.
array
[
50
,
80
]
=
1e4
#
img.array[50,80] = 1e4
img
.
array
[
150
,
150
]
=
3e4
#
img.array[150,150] = 3e4
newimgcol
=
Effects
.
CTE_Effect
(
copy
.
deepcopy
(
img
),
direction
=
'column'
)
#
newimgcol = Effects.CTE_Effect(copy.deepcopy(img),direction='column')
newimgrow
=
Effects
.
CTE_Effect
(
copy
.
deepcopy
(
img
),
direction
=
'row'
)
#
newimgrow = Effects.CTE_Effect(copy.deepcopy(img),direction='row')
newimgcol
.
write
(
os
.
path
.
join
(
self
.
outDataFn
,
'test_ctecol.fits'
))
#
newimgcol.write(os.path.join(self.outDataFn,'test_ctecol.fits'))
newimgrow
.
write
(
os
.
path
.
join
(
self
.
outDataFn
,
'test_cterow.fits'
))
#
newimgrow.write(os.path.join(self.outDataFn,'test_cterow.fits'))
del
img
,
newimgcol
,
newimgrow
#
del img,newimgcol,newimgrow
def
test_readnoise
(
self
):
def
test_readnoise
(
self
):
img
=
galsim
.
Image
(
200
,
200
,
init_value
=
1000
)
img
=
galsim
.
Image
(
200
,
200
,
init_value
=
1000
)
...
...
tests/test_imaging.py
View file @
fc33cf07
...
@@ -97,8 +97,8 @@ def _load_gals(file_path):
...
@@ -97,8 +97,8 @@ def _load_gals(file_path):
param
[
'av'
]
=
0.0
param
[
'av'
]
=
0.0
param
[
'redden'
]
=
0
param
[
'redden'
]
=
0
pcs
=
h5
.
File
(
"/public/share/yangxuliu/CSSOSDataProductsSims/data_50sqDeg
/sedlibs/
"
+
"
pcs.h5
"
,
"r"
)
pcs
=
h5
.
File
(
os
.
path
.
join
(
os
.
getenv
(
'UNIT_TEST_DATA_ROOT'
),
'csst_msc_sim/csst_fz_msc
/sedlibs/pcs.h5
'
)
,
"r"
)
lamb
=
h5
.
File
(
"/public/share/yangxuliu/CSSOSDataProductsSims/data_50sqDeg
/sedlibs/
"
+
"
lamb.h5
"
,
"r"
)
lamb
=
h5
.
File
(
os
.
path
.
join
(
os
.
getenv
(
'UNIT_TEST_DATA_ROOT'
),
'csst_msc_sim/csst_fz_msc
/sedlibs/lamb.h5
'
)
,
"r"
)
lamb_gal
=
lamb
[
'lamb'
][()]
lamb_gal
=
lamb
[
'lamb'
][()]
pcs
=
pcs
[
'pcs'
][()]
pcs
=
pcs
[
'pcs'
][()]
...
@@ -158,7 +158,7 @@ def defineFilt(chip):
...
@@ -158,7 +158,7 @@ def defineFilt(chip):
class
imagingModule_coverage
(
unittest
.
TestCase
):
class
imagingModule_coverage
(
unittest
.
TestCase
):
def
__init__
(
self
,
methodName
=
'runTest'
):
def
__init__
(
self
,
methodName
=
'runTest'
):
super
(
imagingModule_coverage
,
self
).
__init__
(
methodName
)
super
(
imagingModule_coverage
,
self
).
__init__
(
methodName
)
self
.
dataPath
=
"/public/home/chengliang/CSSOSDataProductsSims/csst-simulation/tests/UNIT_TEST_DATA"
##
os.path.join(os.getenv('UNIT_TEST_DATA_ROOT'), 'csst_
fz_gc1
')
self
.
dataPath
=
os
.
path
.
join
(
os
.
getenv
(
'UNIT_TEST_DATA_ROOT'
),
'csst_
msc_sim/csst_fz_msc
'
)
self
.
iccd
=
8
self
.
iccd
=
8
def
test_imaging
(
self
):
def
test_imaging
(
self
):
...
@@ -170,7 +170,7 @@ class imagingModule_coverage(unittest.TestCase):
...
@@ -170,7 +170,7 @@ class imagingModule_coverage(unittest.TestCase):
print
(
chip
.
cen_pix_x
,
chip
.
cen_pix_y
)
print
(
chip
.
cen_pix_x
,
chip
.
cen_pix_y
)
obj
=
_load_gals
(
"UNIT_TEST_DATA/galaxies_C6_bundle000287.h5"
)
obj
=
_load_gals
(
os
.
path
.
join
(
self
.
dataPath
,
'galaxies_C6_bundle000287.h5'
))
#(
"UNIT_TEST_DATA/galaxies_C6_bundle000287.h5")
sed_data
=
obj
[
'sed'
]
sed_data
=
obj
[
'sed'
]
norm_filt
=
None
norm_filt
=
None
...
...
tests/test_prescan_overscan_func.py
View file @
fc33cf07
...
@@ -81,7 +81,7 @@ def defineFilt(chip):
...
@@ -81,7 +81,7 @@ def defineFilt(chip):
class
detModule_coverage
(
unittest
.
TestCase
):
class
detModule_coverage
(
unittest
.
TestCase
):
def
__init__
(
self
,
methodName
=
'runTest'
):
def
__init__
(
self
,
methodName
=
'runTest'
):
super
(
detModule_coverage
,
self
).
__init__
(
methodName
)
super
(
detModule_coverage
,
self
).
__init__
(
methodName
)
self
.
dataPath
=
os
.
path
.
join
(
os
.
getenv
(
'UNIT_TEST_DATA_ROOT'
),
'csst_fz_msc'
)
self
.
dataPath
=
os
.
path
.
join
(
os
.
getenv
(
'UNIT_TEST_DATA_ROOT'
),
'csst_
msc_sim/csst_
fz_msc'
)
self
.
iccd
=
1
self
.
iccd
=
1
def
test_add_prescan_overscan
(
self
):
def
test_add_prescan_overscan
(
self
):
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment