Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Liu Dezi
csst_msc_sim
Commits
a4832bdf
Commit
a4832bdf
authored
2 years ago
by
Fang Yuedong
Browse files
Options
Download
Email Patches
Plain Diff
move rotate_ellipticity to CatalogBase.py
parent
7e936912
release_v2.0
11-csst
29-darktime-exptime-shtopen-shtstat-t
current_stable_for_tests
develop
liudezi-develop-patch-58263
master
new_sim
new_sim_sls
sim_scheduler
wcs_test
v2.1.0
internal_test_20240425
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Catalog/C6_50sqdeg.py
+9
-6
Catalog/C6_50sqdeg.py
ObservationSim/MockObject/CatalogBase.py
+11
-0
ObservationSim/MockObject/CatalogBase.py
with
20 additions
and
6 deletions
+20
-6
Catalog/C6_50sqdeg.py
+
9
-
6
View file @
a4832bdf
...
...
@@ -6,7 +6,6 @@ import h5py as h5
import
healpy
as
hp
import
astropy.constants
as
cons
import
traceback
import
cmath
from
astropy.coordinates
import
spherical_to_cartesian
from
astropy.table
import
Table
from
scipy
import
interpolate
...
...
@@ -222,13 +221,17 @@ class Catalog(CatalogBase):
param
[
'e2'
]
=
gals
[
'ellipticity_true'
][
igals
][
1
]
# For shape calculation
param
[
'ell_total'
]
=
np
.
sqrt
(
param
[
'e1'
]
**
2
+
param
[
'e2'
]
**
2
)
param
[
'e1'
],
param
[
'e2'
],
param
[
'ell_total'
]
=
self
.
rotate_ellipticity
(
e1
=
gals
[
'ellipticity_true'
][
igals
][
0
],
e2
=
gals
[
'ellipticity_true'
][
igals
][
1
],
rotation
=
self
.
rotation
,
unit
=
'radians'
)
# param['ell_total'] = np.sqrt(param['e1']**2 + param['e2']**2)
if
param
[
'ell_total'
]
>
0.9
:
continue
phi_e
=
cmath
.
phase
(
complex
(
param
[
'e1'
],
param
[
'e2'
]))
param
[
'e1'
]
=
param
[
'ell_total'
]
*
np
.
cos
(
phi_e
+
2
*
self
.
rotation
)
param
[
'e2'
]
=
param
[
'ell_total'
]
*
np
.
sin
(
phi_e
+
2
*
self
.
rotation
)
#
phi_e = cmath.phase(complex(param['e1'], param['e2']))
#
param['e1'] = param['ell_total'] * np.cos(phi_e + 2*self.rotation)
#
param['e2'] = param['ell_total'] * np.sin(phi_e + 2*self.rotation)
param
[
'e1_disk'
]
=
param
[
'e1'
]
param
[
'e2_disk'
]
=
param
[
'e2'
]
...
...
This diff is collapsed.
Click to expand it.
ObservationSim/MockObject/CatalogBase.py
+
11
-
0
View file @
a4832bdf
import
numpy
as
np
import
galsim
import
copy
import
cmath
from
astropy.table
import
Table
from
abc
import
abstractmethod
,
ABCMeta
...
...
@@ -72,6 +73,16 @@ class CatalogBase(metaclass=ABCMeta):
"parallax"
:
1e-9
}
return
param
@
staticmethod
def
rotate_ellipticity
(
e1
,
e2
,
rotation
=
0.
,
unit
=
'radians'
):
if
unit
==
'degree'
:
rotation
=
np
.
radians
(
rotation
)
e_total
=
np
.
sqrt
(
e1
**
2
+
e2
**
2
)
phi
=
cmath
.
phase
(
complex
(
e1
,
e2
))
e1
=
e_total
*
np
.
cos
(
phi
+
2
*
rotation
)
e2
=
e_total
*
np
.
sin
(
phi
+
2
*
rotation
)
return
e1
,
e2
,
e_total
@
staticmethod
def
convert_sed
(
mag
,
sed
,
target_filt
,
norm_filt
=
None
):
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets