44
55_SUPPORTED_EXTENDED_SOURCES = ["single_sersic" , "double_sersic" , "interpolated" ]
66
7+
78class ExtendedSource (object ):
8- """Class to manage a single extended source"""
9- def __init__ ( self , source_dict ,
10- cosmo = None , ** kwargs ):
9+ """Class to manage a single extended source. """
10+
11+ def __init__ ( self , source_dict , cosmo = None , ** kwargs ):
1112 """
1213 :param source_dict: Source properties. May be a dictionary or an Astropy table.
1314 For a detailed description of this dictionary, please see the documentation for
1415 the SingleSersic, DoubleSersic, and Interpolated classes.
1516 :type source_dict: dict or astropy.table.Table
1617 :param extendedsource_type: keyword for specifying light profile model.
17- :type extendedsource_type: str. supported types are "single_sersic",
18+ :type extendedsource_type: str. supported types are "single_sersic",
1819 "double_sersic", "interpolated".
1920 :param cosmo: astropy.cosmology instance
2021 :param kwargs: dictionary of keyword arguments for a extended source.
21- eg: kwargs = {"extendedsource_type": "single_sersic"}. Other supported
22+ eg: kwargs = {"extendedsource_type": "single_sersic"}. Other supported
2223 types are "single_sersic", "double_sersic", "interpolated".
2324 """
2425 self .extendedsource_type = kwargs ["extendedsource_type" ]
@@ -33,19 +34,19 @@ def __init__(self, source_dict,
3334 "Extended source type %s not supported. Chose among %s."
3435 % (self .extendedsource_type , _SUPPORTED_EXTENDED_SOURCES )
3536 )
36-
37+
3738 @property
3839 def redshift (self ):
3940 """Returns source redshift."""
4041
4142 return self ._source .redshift
42-
43+
4344 @property
4445 def angular_size (self ):
4546 """Returns angular size of the source."""
4647
4748 return self ._source .angular_size
48-
49+
4950 @property
5051 def ellipticity (self ):
5152 """Returns ellipticity components of source.
@@ -57,9 +58,9 @@ def ellipticity(self):
5758
5859 with q being the minor-to-major axis ratio.
5960 """
60-
61+
6162 return self ._source .ellipticity
62-
63+
6364 @property
6465 def n_sersic (self ):
6566 """Returns sersic indices of the source profile."""
@@ -68,48 +69,49 @@ def n_sersic(self):
6869
6970 @property
7071 def sersicweight (self ):
71- """Returns weight of the sersic components"""
72+ """Returns weight of the sersic components. """
7273
7374 return self ._source .sersicweight
74-
75+
7576 @property
7677 def image_redshift (self ):
77- """Returns redshift of a given image"""
78-
78+ """Returns redshift of a given image. """
79+
7980 return self ._source .image_redshift
80-
81+
8182 @property
8283 def image (self ):
83- """Returns image of a given extended source"""
84-
84+ """Returns image of a given extended source. """
85+
8586 return self ._source .image
8687
8788 @property
8889 def phi (self ):
89- """Returns position angle of a given image in arcsec"""
90+ """Returns position angle of a given image in arcsec. """
9091
9192 return self ._source .phi
92-
93+
9394 @property
9495 def pixel_scale (self ):
95- """Returns pixel scale of a given image"""
96+ """Returns pixel scale of a given image. """
9697
9798 return self ._source .pixel_scale
98-
99+
99100 def extended_source_position (self , reference_postion , draw_area ):
100101 """Extended source position. If a center has already been provided (and
101- stored in self._center_source during initialization of _source), then it is simply
102- returned. Otherwise, a source position is drawn uniformly within the
103- circle of the test area centered on the deflector position. see: _source.
102+ stored in self._center_source during initialization of _source), then
103+ it is simply returned. Otherwise, a source position is drawn uniformly
104+ within the circle of the test area centered on the deflector position.
105+ see: _source.
104106
105- :param reference_position: reference position. the source postion will be
107+ :param reference_position: reference position. the source postion will be
106108 defined relative to this position.
107109 Eg: np.array([0, 0])
108110 :param draw_area: The area of the test region from which we randomly draw a source
109111 position. Eg: 4*pi.
110112 :return: [x_pos, y_pos]
111113 """
112-
114+
113115 return self ._source .extended_source_position (reference_postion , draw_area )
114116
115117 def extended_source_magnitude (self , band ):
@@ -122,29 +124,31 @@ def extended_source_magnitude(self, band):
122124 """
123125
124126 return self ._source .extended_source_magnitude (band = band )
125-
127+
126128 def kwargs_extended_source_light (self , reference_position , draw_area , band = None ):
127129 """Provides dictionary of keywords for the source light model(s).
128130 Kewords used are in lenstronomy conventions.
129131
130- :param reference_position: reference position. the source postion will be
132+ :param reference_position: reference position. the source postion will be
131133 defined relative to this position.
132134 Eg: np.array([0, 0])
133135 :param draw_area: The area of the test region from which we randomly draw a
134136 source position. Eg: 4*pi.
135137 :param band: Imaging band
136138 :return: dictionary of keywords for the source light model(s)
137139 """
138-
139- return self ._source .kwargs_extended_source_light (reference_position , draw_area , band )
140-
140+
141+ return self ._source .kwargs_extended_source_light (
142+ reference_position , draw_area , band
143+ )
144+
141145 def extended_source_light_model (self ):
142146 """Provides a list of source models.
143147
144148 :return: list of extented source model.
145149 """
146150 return self ._source .extended_source_light_model ()
147-
151+
148152 def surface_brightness_reff (self , band = None ):
149153 """Calculate average surface brightness within half light radius.
150154
@@ -153,4 +157,4 @@ def surface_brightness_reff(self, band=None):
153157 [mag/arcsec^2]
154158 """
155159
156- return self ._source .surface_brightness_reff (band = band )
160+ return self ._source .surface_brightness_reff (band = band )
0 commit comments