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
Liu Dezi
csst_msc_sim
Commits
e9638802
Commit
e9638802
authored
Apr 13, 2022
by
Fang Yuedong
Browse files
add random knots to gaalxy model
parent
40121255
Changes
3
Hide whitespace changes
Inline
Side-by-side
ObservationSim/MockObject/Galaxy.py
View file @
e9638802
...
...
@@ -131,12 +131,12 @@ class Galaxy(MockObject):
bulge_shape
=
galsim
.
Shear
(
g1
=
self
.
e1_bulge
,
g2
=
self
.
e2_bulge
)
bulge
=
bulge
.
shear
(
bulge_shape
)
gal
=
self
.
bfrac
*
bulge
+
(
1.0
-
self
.
bfrac
)
*
disk
#
gal = self.bfrac * bulge + (1.0 - self.bfrac) * disk
# # (TEST) Random knots
#
knots = galsim.RandomKnots(npoints=100, profile=disk)
#
kfrac = np.random.random()*(1.0 - self.bfrac)
#
gal = self.bfrac * bulge + (1.0 - self.bfrac - kfrac) * disk + kfrac * knots
knots
=
galsim
.
RandomKnots
(
npoints
=
100
,
profile
=
disk
)
kfrac
=
np
.
random
.
random
()
*
(
1.0
-
self
.
bfrac
)
gal
=
self
.
bfrac
*
bulge
+
(
1.0
-
self
.
bfrac
-
kfrac
)
*
disk
+
kfrac
*
knots
gal
=
gal
.
withFlux
(
nphotons
)
gal_shear
=
galsim
.
Shear
(
g1
=
g1
,
g2
=
g2
)
...
...
@@ -220,12 +220,12 @@ class Galaxy(MockObject):
bulge_shape
=
galsim
.
Shear
(
g1
=
self
.
e1_bulge
,
g2
=
self
.
e2_bulge
)
bulge
=
bulge
.
shear
(
bulge_shape
)
gal
=
self
.
bfrac
*
bulge
+
(
1.0
-
self
.
bfrac
)
*
disk
#
gal = self.bfrac * bulge + (1.0 - self.bfrac) * disk
# (TEST) Random knots
#
knots = galsim.RandomKnots(npoints=100, profile=disk)
#
kfrac = np.random.random()*(1.0 - self.bfrac)
#
gal = self.bfrac * bulge + (1.0 - self.bfrac - kfrac) * disk + kfrac * knots
knots
=
galsim
.
RandomKnots
(
npoints
=
100
,
profile
=
disk
)
kfrac
=
np
.
random
.
random
()
*
(
1.0
-
self
.
bfrac
)
gal
=
self
.
bfrac
*
bulge
+
(
1.0
-
self
.
bfrac
-
kfrac
)
*
disk
+
kfrac
*
knots
gal
=
gal
.
withFlux
(
tel
.
pupil_area
*
exptime
)
gal_shear
=
galsim
.
Shear
(
g1
=
g1
,
g2
=
g2
)
...
...
ObservationSim/MockObject/SpecDisperser/disperse_c/disperse.cpython-38-x86_64-linux-gnu.so
deleted
100755 → 0
View file @
40121255
File deleted
ObservationSim/MockObject/SpecDisperser/disperse_c/interp.cpython-38-x86_64-linux-gnu.so
deleted
100755 → 0
View file @
40121255
File deleted
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