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
98579c7c
Commit
98579c7c
authored
Apr 07, 2024
by
Fang Yuedong
Browse files
bug fixes
parent
2dd1f007
Changes
4
Show whitespace changes
Inline
Side-by-side
ObservationSim/Config/ChipOutput.py
View file @
98579c7c
...
@@ -3,7 +3,7 @@ import logging
...
@@ -3,7 +3,7 @@ import logging
import
ObservationSim.Config._util
as
_util
import
ObservationSim.Config._util
as
_util
class
ChipOutput
(
object
):
class
ChipOutput
(
object
):
def
__init__
(
self
,
config
,
focal_plane
,
chip
,
filt
,
imgKey0
=
""
,
imgKey1
=
""
,
imgKey2
=
""
,
exptime
=
150.
,
mjdTime
=
""
,
ra_cen
=
None
,
dec_cen
=
None
,
pointing_type
=
'SCI'
,
pointing_ID
=
'0'
,
subdir
=
"./"
,
prefix
=
""
):
def
__init__
(
self
,
config
,
focal_plane
,
chip
,
filt
,
imgKey0
=
""
,
imgKey1
=
""
,
imgKey2
=
""
,
exptime
=
150.
,
mjdTime
=
""
,
ra_cen
=
None
,
dec_cen
=
None
,
pointing_type
=
'SCI
E
'
,
pointing_ID
=
'0'
,
subdir
=
"./"
,
prefix
=
""
):
self
.
focal_plane
=
focal_plane
self
.
focal_plane
=
focal_plane
self
.
chip
=
chip
self
.
chip
=
chip
self
.
filt
=
filt
self
.
filt
=
filt
...
@@ -60,7 +60,7 @@ class ChipOutput(object):
...
@@ -60,7 +60,7 @@ class ChipOutput(object):
self
.
hdr
+=
additional_column_names
self
.
hdr
+=
additional_column_names
def
create_output_file
(
self
):
def
create_output_file
(
self
):
if
self
.
pointing_type
==
'SCI'
:
if
self
.
pointing_type
==
'SCI
E
'
:
self
.
cat
=
open
(
os
.
path
.
join
(
self
.
subdir
,
self
.
cat_name
),
"w"
)
self
.
cat
=
open
(
os
.
path
.
join
(
self
.
subdir
,
self
.
cat_name
),
"w"
)
self
.
logger
.
info
(
"Creating catalog file %s ...
\n
"
%
(
os
.
path
.
join
(
self
.
subdir
,
self
.
cat_name
)))
self
.
logger
.
info
(
"Creating catalog file %s ...
\n
"
%
(
os
.
path
.
join
(
self
.
subdir
,
self
.
cat_name
)))
if
not
self
.
hdr
.
endswith
(
"
\n
"
):
if
not
self
.
hdr
.
endswith
(
"
\n
"
):
...
...
ObservationSim/Config/Pointing.py
View file @
98579c7c
...
@@ -6,7 +6,7 @@ from astropy.time import Time
...
@@ -6,7 +6,7 @@ from astropy.time import Time
import
ObservationSim.Instrument._util
as
_util
import
ObservationSim.Instrument._util
as
_util
class
Pointing
(
object
):
class
Pointing
(
object
):
def
__init__
(
self
,
id
=
0
,
ra
=
0.
,
dec
=
0.
,
img_pa
=
0.
,
timestamp
=
1621915200
,
sat_x
=
0.
,
sat_y
=
0.
,
sat_z
=
0.
,
sun_x
=
0.
,
sun_y
=
0.
,
sun_z
=
0.
,
sat_vx
=
0.
,
sat_vy
=
0.
,
sat_vz
=
0.
,
exp_time
=
150.
,
pointing_type
=
'SCI'
,
obs_config_file
=
None
):
def
__init__
(
self
,
id
=
0
,
ra
=
0.
,
dec
=
0.
,
img_pa
=
0.
,
timestamp
=
1621915200
,
sat_x
=
0.
,
sat_y
=
0.
,
sat_z
=
0.
,
sun_x
=
0.
,
sun_y
=
0.
,
sun_z
=
0.
,
sat_vx
=
0.
,
sat_vy
=
0.
,
sat_vz
=
0.
,
exp_time
=
150.
,
pointing_type
=
'SCI
E
'
,
obs_config_file
=
None
):
self
.
id
=
id
self
.
id
=
id
self
.
ra
=
ra
self
.
ra
=
ra
self
.
dec
=
dec
self
.
dec
=
dec
...
@@ -44,7 +44,7 @@ class Pointing(object):
...
@@ -44,7 +44,7 @@ class Pointing(object):
return
max
(
150.
,
self
.
exp_time
)
# [TODO] for FGS
return
max
(
150.
,
self
.
exp_time
)
# [TODO] for FGS
def
read_pointing_columns
(
self
,
columns
,
id
=
0
,
t
=
1621915200
,
pointing_type
=
'SCI'
):
def
read_pointing_columns
(
self
,
columns
,
id
=
0
,
t
=
1621915200
,
pointing_type
=
'SCI
E
'
):
self
.
id
=
id
self
.
id
=
id
col_len
=
len
(
columns
)
col_len
=
len
(
columns
)
self
.
ra
=
float
(
columns
[
0
])
self
.
ra
=
float
(
columns
[
0
])
...
...
ObservationSim/MockObject/FlatLED.py
View file @
98579c7c
...
@@ -3,13 +3,13 @@
...
@@ -3,13 +3,13 @@
import
galsim
import
galsim
import
os
,
sys
import
os
,
sys
import
numpy
as
np
import
numpy
as
np
from
astropy.io
import
fits
import
time
from
scipy.interpolate
import
griddata
import
math
import
math
import
astropy.constants
as
cons
import
astropy.constants
as
cons
from
astropy.io
import
fits
from
scipy.interpolate
import
griddata
from
astropy.table
import
Table
from
astropy.table
import
Table
from
ObservationSim.MockObject.SpecDisperser
import
SpecDisperser
from
ObservationSim.MockObject.SpecDisperser
import
SpecDisperser
import
time
from
scipy
import
interpolate
from
scipy
import
interpolate
from
ObservationSim.MockObject.MockObject
import
MockObject
from
ObservationSim.MockObject.MockObject
import
MockObject
...
...
ObservationSim/sim_steps/add_objects.py
View file @
98579c7c
import
os
import
os
import
gc
import
gc
import
psutil
import
psutil
import
traceback
import
numpy
as
np
import
numpy
as
np
import
galsim
import
galsim
from
ObservationSim._util
import
get_shear_field
from
ObservationSim._util
import
get_shear_field
...
...
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