Commit 7ec8afa5 authored by Fang Yuedong's avatar Fang Yuedong
Browse files

1. add random star-forming knots to galaxies. 2. Remove the normal initial...

1. add random star-forming knots to galaxies. 2. Remove the normal initial magnitude cut (mag_use_normal cut) for testing.
parent 0dc5481a
......@@ -140,8 +140,8 @@ class NGPCatalog(CatalogBase):
param['ra_orig'] = gals['ra_true'][igals]
param['dec_orig'] = gals['dec_true'][igals]
param['mag_use_normal'] = gals['mag_true_g_lsst'][igals]
if param['mag_use_normal'] >= 26.5:
continue
# if param['mag_use_normal'] >= 26.5:
# continue
param['z'] = gals['redshift_true'][igals]
param['model_tag'] = 'None'
param['gamma1'] = 0
......@@ -245,8 +245,8 @@ class NGPCatalog(CatalogBase):
if not self.chip.isContainObj(ra_obj=param['ra'], dec_obj=param['dec'], margin=200):
continue
param['mag_use_normal'] = stars['app_sdss_g'][istars]
if param['mag_use_normal'] >= 26.5:
continue
# if param['mag_use_normal'] >= 26.5:
# continue
self.ids += 1
# param['id'] = self.ids
param['id'] = stars['sourceID'][istars]
......@@ -316,8 +316,6 @@ class NGPCatalog(CatalogBase):
else:
raise ValueError("Object type not known")
speci = interpolate.interp1d(wave, flux)
# lamb = np.arange(2500, 10001 + 0.5, 0.5)
# lamb = np.arange(2400, 11001 + 0.5, 0.5)
lamb = np.arange(2000, 18001 + 0.5, 0.5)
y = speci(lamb)
# erg/s/cm2/A --> photo/s/m2/A
......
......@@ -147,12 +147,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
# (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
gal = gal.withFlux(nphotons)
gal_shear = galsim.Shear(g1=g1, g2=g2)
......@@ -287,12 +287,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)
......
......@@ -100,7 +100,7 @@ if __name__=='__main__':
# run_sim(Catalog=C3Catalog)
# To run calibration field NGP simulation
# from Catalog.NGPCatalog import NGPCatalog
# run_sim(Catalog=NGPCatalog)
from Catalog.NJU_Catalog import NJU_Catalog
run_sim(Catalog=NJU_Catalog)
from Catalog.NGPCatalog import NGPCatalog
run_sim(Catalog=NGPCatalog)
# from Catalog.NJU_Catalog import NJU_Catalog
# run_sim(Catalog=NJU_Catalog)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment