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
a20840c0
Commit
a20840c0
authored
Jun 13, 2023
by
Zhang Xin
Browse files
fix .so bug; adjust skybackgroundMap.py
parent
00a96bcb
Changes
7
Hide whitespace changes
Inline
Side-by-side
ObservationSim/Config/Header/ImageHeader.py
View file @
a20840c0
...
@@ -385,7 +385,7 @@ def generatePrimaryHeader(xlen = 9216, ylen = 9232, pointNum = '1', ra = 60, dec
...
@@ -385,7 +385,7 @@ def generatePrimaryHeader(xlen = 9216, ylen = 9232, pointNum = '1', ra = 60, dec
h_prim
[
'EXPTIME'
]
=
exptime
h_prim
[
'EXPTIME'
]
=
exptime
# Define file types
# Define file types
file_type
=
{
'SCI'
:
'SCIE'
,
'BIAS'
:
'BIAS'
,
'DARK'
:
'DARK'
,
'FLAT'
:
'FLAT'
,
'CRS'
:
'
cosmic_ray
'
,
'CRD'
:
'CRD'
,
'CALS'
:
'CALS'
,
'CALF'
:
'CALF'
}
file_type
=
{
'SCI'
:
'SCIE'
,
'BIAS'
:
'BIAS'
,
'DARK'
:
'DARK'
,
'FLAT'
:
'FLAT'
,
'CRS'
:
'
CRS
'
,
'CRD'
:
'CRD'
,
'CALS'
:
'CALS'
,
'CALF'
:
'CALF'
}
h_prim
[
'FILETYPE'
]
=
file_type
[
im_type
]
h_prim
[
'FILETYPE'
]
=
file_type
[
im_type
]
co
=
coord
.
SkyCoord
(
ra
,
dec
,
unit
=
'deg'
)
co
=
coord
.
SkyCoord
(
ra
,
dec
,
unit
=
'deg'
)
...
...
ObservationSim/MockObject/__init__.py
View file @
a20840c0
...
@@ -4,5 +4,5 @@ from .CatalogBase import CatalogBase
...
@@ -4,5 +4,5 @@ from .CatalogBase import CatalogBase
from
.Quasar
import
Quasar
from
.Quasar
import
Quasar
from
.Star
import
Star
from
.Star
import
Star
from
.Stamp
import
Stamp
from
.Stamp
import
Stamp
from
.SkybackgroundMap
import
*
#
from .SkybackgroundMap import *
# from .CosmicRay import CosmicRay
# from .CosmicRay import CosmicRay
ObservationSim/ObservationSim.py
View file @
a20840c0
...
@@ -14,7 +14,7 @@ from ObservationSim.Config import config_dir, ChipOutput
...
@@ -14,7 +14,7 @@ from ObservationSim.Config import config_dir, ChipOutput
from
ObservationSim.Config.Header
import
generatePrimaryHeader
,
generateExtensionHeader
from
ObservationSim.Config.Header
import
generatePrimaryHeader
,
generateExtensionHeader
from
ObservationSim.Instrument
import
Telescope
,
Filter
,
FilterParam
,
FocalPlane
,
Chip
from
ObservationSim.Instrument
import
Telescope
,
Filter
,
FilterParam
,
FocalPlane
,
Chip
from
ObservationSim.Instrument.Chip
import
Effects
from
ObservationSim.Instrument.Chip
import
Effects
from
ObservationSim.
MockObjec
t
import
calculateSkyMap_split_g
from
ObservationSim.
Strayligh
t
import
calculateSkyMap_split_g
from
ObservationSim.PSF
import
PSFGauss
,
FieldDistortion
,
PSFInterp
from
ObservationSim.PSF
import
PSFGauss
,
FieldDistortion
,
PSFInterp
from
ObservationSim._util
import
get_shear_field
,
makeSubDir_PointingList
from
ObservationSim._util
import
get_shear_field
,
makeSubDir_PointingList
from
ObservationSim.Astrometry.Astrometry_util
import
on_orbit_obs_position
from
ObservationSim.Astrometry.Astrometry_util
import
on_orbit_obs_position
...
...
ObservationSim/
MockObjec
t/SkybackgroundMap.py
→
ObservationSim/
Strayligh
t/SkybackgroundMap.py
View file @
a20840c0
...
@@ -45,10 +45,10 @@ def calculateSkyMap_split_g(skyMap=None, blueLimit=4200, redLimit=6500, skyfn='s
...
@@ -45,10 +45,10 @@ def calculateSkyMap_split_g(skyMap=None, blueLimit=4200, redLimit=6500, skyfn='s
fImg
=
galsim
.
Image
(
fimg
)
fImg
=
galsim
.
Image
(
fimg
)
try
:
try
:
with
pkg_resources
.
files
(
'ObservationSim.
MockObjec
t.data'
).
joinpath
(
skyfn
)
as
data_path
:
with
pkg_resources
.
files
(
'ObservationSim.
Strayligh
t.data
.sky
'
).
joinpath
(
skyfn
)
as
data_path
:
skySpec
=
np
.
loadtxt
(
data_path
)
skySpec
=
np
.
loadtxt
(
data_path
)
except
AttributeError
:
except
AttributeError
:
with
pkg_resources
.
path
(
'ObservationSim.
MockObjec
t.data'
,
skyfn
)
as
data_path
:
with
pkg_resources
.
path
(
'ObservationSim.
Strayligh
t.data
.sky
'
,
skyfn
)
as
data_path
:
skySpec
=
np
.
loadtxt
(
data_path
)
skySpec
=
np
.
loadtxt
(
data_path
)
# skySpec = np.loadtxt(skyfn)
# skySpec = np.loadtxt(skyfn)
spec
=
Table
(
np
.
array
([
skySpec
[:,
0
],
skySpec
[:,
1
]]).
T
,
names
=
(
'WAVELENGTH'
,
'FLUX'
))
spec
=
Table
(
np
.
array
([
skySpec
[:,
0
],
skySpec
[:,
1
]]).
T
,
names
=
(
'WAVELENGTH'
,
'FLUX'
))
...
@@ -277,10 +277,10 @@ def calculateSkyMap(xLen=9232, yLen=9126, blueLimit=4200, redLimit=6500,
...
@@ -277,10 +277,10 @@ def calculateSkyMap(xLen=9232, yLen=9126, blueLimit=4200, redLimit=6500,
fimg
=
np
.
zeros_like
(
skyMap
)
fimg
=
np
.
zeros_like
(
skyMap
)
fImg
=
galsim
.
Image
(
fimg
)
fImg
=
galsim
.
Image
(
fimg
)
try
:
try
:
with
pkg_resources
.
files
(
'ObservationSim.
MockObjec
t.data'
).
joinpath
(
skyfn
)
as
data_path
:
with
pkg_resources
.
files
(
'ObservationSim.
Strayligh
t.data
.sky
'
).
joinpath
(
skyfn
)
as
data_path
:
skySpec
=
np
.
loadtxt
(
data_path
)
skySpec
=
np
.
loadtxt
(
data_path
)
except
AttributeError
:
except
AttributeError
:
with
pkg_resources
.
path
(
'ObservationSim.
MockObjec
t.data'
,
skyfn
)
as
data_path
:
with
pkg_resources
.
path
(
'ObservationSim.
Strayligh
t.data
.sky
'
,
skyfn
)
as
data_path
:
skySpec
=
np
.
loadtxt
(
data_path
)
skySpec
=
np
.
loadtxt
(
data_path
)
# skySpec = np.loadtxt(skyfn)
# skySpec = np.loadtxt(skyfn)
...
...
ObservationSim/Straylight/Straylight.py
View file @
a20840c0
...
@@ -110,10 +110,10 @@ class Straylight(object):
...
@@ -110,10 +110,10 @@ class Straylight(object):
self
.
slcdll
=
ctypes
.
CDLL
(
dllFn
)
self
.
slcdll
=
ctypes
.
CDLL
(
dllFn
)
elif
platForm
==
'linux'
:
elif
platForm
==
'linux'
:
try
:
try
:
with
pkg_resources
.
files
(
'ObservationSim.Straylight.
so
'
).
joinpath
(
'libstraylight.
dylib
'
)
as
dllFn
:
with
pkg_resources
.
files
(
'ObservationSim.Straylight.
lib
'
).
joinpath
(
'libstraylight.
so
'
)
as
dllFn
:
self
.
slcdll
=
ctypes
.
CDLL
(
dllFn
)
self
.
slcdll
=
ctypes
.
CDLL
(
dllFn
)
except
AttributeError
:
except
AttributeError
:
with
pkg_resources
.
path
(
'ObservationSim.Straylight.
so
'
,
'libstraylight.
dylib
'
)
as
dllFn
:
with
pkg_resources
.
path
(
'ObservationSim.Straylight.
lib
'
,
'libstraylight.
so
'
)
as
dllFn
:
self
.
slcdll
=
ctypes
.
CDLL
(
dllFn
)
self
.
slcdll
=
ctypes
.
CDLL
(
dllFn
)
# self.slcdll=ctypes.CDLL('./libstraylight.dylib')
# self.slcdll=ctypes.CDLL('./libstraylight.dylib')
self
.
slcdll
.
Calculate
.
argtypes
=
[
ctypes
.
c_double
,
ctypes
.
POINTER
(
ctypes
.
c_double
),
self
.
slcdll
.
Calculate
.
argtypes
=
[
ctypes
.
c_double
,
ctypes
.
POINTER
(
ctypes
.
c_double
),
...
...
ObservationSim/Straylight/__init__.py
View file @
a20840c0
from
.Straylight
import
Straylight
from
.Straylight
import
Straylight
from
.SkybackgroundMap
import
*
ObservationSim/
MockObjec
t/data/sky_emiss_hubble_50_50_A.dat
→
ObservationSim/
Strayligh
t/data/sky
/sky
_emiss_hubble_50_50_A.dat
View file @
a20840c0
File moved
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