Coverage for python/lsst/sims/GalSimInterface/galSimPhoSimCatalogs.py : 69%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1from builtins import object
2from lsst.sims.catUtils.exampleCatalogDefinitions import PhoSimCatalogPoint
3from lsst.sims.catUtils.exampleCatalogDefinitions import PhoSimCatalogZPoint
4from lsst.sims.catUtils.exampleCatalogDefinitions import PhoSimCatalogSersic2D
6from lsst.sims.GalSimInterface import GalSimStars, GalSimGalaxies, GalSimAgn
8from lsst.sims.catalogs.decorators import compound
9from lsst.sims.utils import _observedFromICRS
12__all__ = ["GalSimPhoSimStars", "GalSimPhoSimGalaxies", "GalSimPhoSimAgn"]
15class GalSimAstrometryStars(object):
17 @compound('raPhoSim','decPhoSim')
18 def get_phoSimCoordinates(self):
19 ff = self.column_by_name('fitsFiles') # to force the catalog to draw the GalSim images
20 raObs, decObs = self.observedStellarCoordinates(includeRefraction = False)
21 return self._dePrecess(raObs, decObs, self.obs_metadata)
24class GalSimAstrometryGalaxies(object):
26 @compound('raPhoSim','decPhoSim')
27 def get_phoSimCoordinates(self):
28 ff = self.column_by_name('fitsFiles') # to force the catalog to draw the GalSim images
29 ra = self.column_by_name('raJ2000')
30 dec = self.column_by_name('decJ2000')
31 raObs, decObs = _observedFromICRS(ra, dec, includeRefraction = False, obs_metadata=self.obs_metadata,
32 epoch=self.db_obj.epoch)
33 return self._dePrecess(raObs, decObs, self.obs_metadata)
36class GalSimPhoSimStars(GalSimAstrometryStars, PhoSimCatalogPoint, GalSimStars):
37 """
38 This InstanceCatalog class is written so that the write_catalog() method produces
39 and InstanceCatalog formatted appropriately for input to PhoSim. The write_images()
40 method can then be called as in other GalSimCatalogs to produce images with GalSim.
41 """
43 default_columns = [('redshift', 0., float),('gamma1', 0., float), ('gamma2', 0., float),
44 ('kappa', 0., float), ('raOffset', 0., float), ('decOffset', 0., float),
45 ('galacticExtinctionModel', 'CCM', (str,3)),
46 ('internalExtinctionModel', 'none', (str,4)),
47 ('galacticAv', 0.1, float),
48 ('galacticRv', 3.1, float),
49 ('galSimType', 'pointSource', (str,11)),
50 ('internalAv', 0.0, float),
51 ('internalRv', 0.0, float),
52 ('majorAxis', 0.0, float),
53 ('minorAxis', 0.0, float),
54 ('sindex', 0.0, float),
55 ('npoints', 0, int),
56 ('positionAngle', 0.0, float),
57 ('halfLightRadius', 0.0, float)]
60class GalSimPhoSimGalaxies(GalSimAstrometryGalaxies, PhoSimCatalogSersic2D, GalSimGalaxies):
61 """
62 This InstanceCatalog class is written so that the write_catalog() method produces
63 and InstanceCatalog formatted appropriately for input to PhoSim. The write_images()
64 method can then be called as in other GalSimCatalogs to produce images with GalSim.
65 """
67 default_columns = [('gamma1', 0., float), ('gamma2', 0., float), ('kappa', 0., float),
68 ('raOffset', 0., float), ('decOffset', 0., float),
69 ('galacticAv', 0.1, float), ('galacticRv', 3.1, float),
70 ('galacticExtinctionModel', 'CCM', (str,3)),
71 ('internalExtinctionModel', 'CCM', (str,3)), ('internalAv', 0., float),
72 ('internalRv', 3.1, float),
73 ('npoints', 0, int),
74 ('galSimType', 'sersic', (str, 6))]
77class GalSimPhoSimAgn(GalSimAstrometryGalaxies, PhoSimCatalogZPoint, GalSimAgn):
78 """
79 This InstanceCatalog class is written so that the write_catalog() method produces
80 and InstanceCatalog formatted appropriately for input to PhoSim. The write_images()
81 method can then be called as in other GalSimCatalogs to produce images with GalSim.
82 """
84 default_columns = [('gamma1', 0., float), ('gamma2', 0., float), ('kappa', 0., float),
85 ('raOffset', 0., float), ('decOffset', 0., float), ('spatialmodel', 'ZPOINT', (str, 6)),
86 ('galacticExtinctionModel', 'CCM', (str,3)),
87 ('galacticAv', 0.1, float),
88 ('galacticRv', 3.1, float),
89 ('internalExtinctionModel', 'none', (str,4)),
90 ('galSimType', 'pointSource', (str,11)),
91 ('majorAxis', 0.0, float),
92 ('minorAxis', 0.0, float),
93 ('sindex', 0.0, float),
94 ('npoints', 0, int),
95 ('positionAngle', 0.0, float),
96 ('halfLightRadius', 0.0, float),
97 ('internalAv', 0.0, float),
98 ('internalRv', 0.0, float)]