|
40 | 40 |
|
41 | 41 |
|
42 | 42 | class ColorColorFitPlot(PlotAction):
|
43 |
| - """Makes a color-color plot and overplots a |
| 43 | + """Makes a color-color plot and overplots a |
44 | 44 | prefited line to the specified area of the plot.
|
45 |
| - This is mostly used for the stellar locus plots |
46 |
| - and also includes panels that illustrate the |
| 45 | + This is mostly used for the stellar locus plots |
| 46 | + and also includes panels that illustrate the |
47 | 47 | goodness of the given fit.
|
48 | 48 | """
|
49 | 49 |
|
@@ -113,96 +113,100 @@ def makePlot(
|
113 | 113 | ) -> Figure:
|
114 | 114 | """Make stellar locus plots using pre fitted values.
|
115 | 115 |
|
116 |
| - Parameters |
117 |
| - ---------- |
118 |
| - data : `KeyedData` |
119 |
| - The data to plot the points from, for more information |
120 |
| - please see the notes section. |
121 |
| - plotInfo : `dict` |
122 |
| - A dictionary of information about the data being plotted with keys: |
123 |
| -
|
124 |
| - * ``"run"`` |
125 |
| - The output run for the plots (`str`). |
126 |
| - * ``"skymap"`` |
127 |
| - The type of skymap used for the data (`str`). |
128 |
| - * ``"filter"`` |
129 |
| - The filter used for this data (`str`). |
130 |
| - * ``"tract"`` |
131 |
| - The tract that the data comes from (`str`). |
132 |
| -
|
133 |
| - Returns |
134 |
| - ------- |
135 |
| - fig : `matplotlib.figure.Figure` |
136 |
| - The resulting figure. |
137 |
| -
|
138 |
| - Notes |
139 |
| - ----- |
140 |
| - The axis labels are given by `self.config.xLabel` and |
141 |
| - `self.config.yLabel`. The perpendicular distance of the points to |
142 |
| - the fit line is given in a histogram in the second panel. |
143 |
| -
|
144 |
| - For the code to work it expects various quantities to be |
145 |
| - present in the 'data' that it is given. |
146 |
| -
|
147 |
| - The quantities that are expected to be present are: |
148 |
| -
|
149 |
| - * Statistics that are shown on the plot or used by the plotting code: |
150 |
| - * ``approxMagDepth`` |
151 |
| - The approximate magnitude corresponding to the SN cut used. |
152 |
| - * ``f"{self.plotName}_sigmaMAD"`` |
153 |
| - The sigma mad of the distances to the line fit. |
154 |
| - * ``f"{self.identity or ''}_median"`` |
155 |
| - The median of the distances to the line fit. |
156 |
| - * ``f"{self.identity or ''}_hardwired_sigmaMAD"`` |
157 |
| - The sigma mad of the distances to the initial fit. |
158 |
| - * ``f"{self.identity or ''}_hardwired_median"`` |
159 |
| - The median of the distances to the initial fit. |
160 |
| -
|
161 |
| -
|
162 |
| - * Parameters from the fitting code that are illustrated on the plot: |
163 |
| - * ``"bHW"`` |
164 |
| - The hardwired intercept to fall back on. |
165 |
| - * ``"bODR"`` |
166 |
| - The intercept calculated by the orthogonal distance |
167 |
| - regression fitting. |
168 |
| - * ``"bODR2"`` |
169 |
| - The intercept calculated by the second iteration of |
170 |
| - orthogonal distance regression fitting. |
171 |
| - * ``"mHW"`` |
172 |
| - The hardwired gradient to fall back on. |
173 |
| - * ``"mODR"`` |
174 |
| - The gradient calculated by the orthogonal distance |
175 |
| - regression fitting. |
176 |
| - * ``"mODR2"`` |
177 |
| - The gradient calculated by the second iteration of |
178 |
| - orthogonal distance regression fitting. |
179 |
| - * ``"xMin`"`` |
180 |
| - The x minimum of the box used in the fit. |
181 |
| - * ``"xMax"`` |
182 |
| - The x maximum of the box used in the fit. |
183 |
| - * ``"yMin"`` |
184 |
| - The y minimum of the box used in the fit. |
185 |
| - * ``"yMax"`` |
186 |
| - The y maximum of the box used in the fit. |
187 |
| - * ``"mPerp"`` |
188 |
| - The gradient of the line perpendicular to the line from |
189 |
| - the second ODR fit. |
190 |
| - * ``"bPerpMin"`` |
191 |
| - The intercept of the perpendicular line that goes through xMin. |
192 |
| - * ``"bPerpMax"`` |
193 |
| - The intercept of the perpendicular line that goes through xMax. |
194 |
| - |
195 |
| - * The main inputs to plot: |
196 |
| - x, y, mag |
197 |
| -
|
198 |
| - Examples |
199 |
| - -------- |
200 |
| - An example of the plot produced from this code is here: |
201 |
| -
|
202 |
| - .. image:: /_static/analysis_tools/stellarLocusExample.png |
203 |
| -
|
204 |
| - For a detailed example of how to make a plot from the command line |
205 |
| - please see the :ref:`getting started guide<analysis-tools-getting-started>`. |
| 116 | + Parameters |
| 117 | + ---------- |
| 118 | + data : `KeyedData` |
| 119 | + The data to plot the points from, for more information |
| 120 | + please see the notes section. |
| 121 | + plotInfo : `dict` |
| 122 | + A dictionary of information about the data being plotted |
| 123 | + with keys: |
| 124 | +
|
| 125 | + * ``"run"`` |
| 126 | + The output run for the plots (`str`). |
| 127 | + * ``"skymap"`` |
| 128 | + The type of skymap used for the data (`str`). |
| 129 | + * ``"filter"`` |
| 130 | + The filter used for this data (`str`). |
| 131 | + * ``"tract"`` |
| 132 | + The tract that the data comes from (`str`). |
| 133 | +
|
| 134 | + Returns |
| 135 | + ------- |
| 136 | + fig : `matplotlib.figure.Figure` |
| 137 | + The resulting figure. |
| 138 | +
|
| 139 | + Notes |
| 140 | + ----- |
| 141 | + The axis labels are given by `self.config.xLabel` and |
| 142 | + `self.config.yLabel`. The perpendicular distance of the points to |
| 143 | + the fit line is given in a histogram in the second panel. |
| 144 | +
|
| 145 | + For the code to work it expects various quantities to be |
| 146 | + present in the 'data' that it is given. |
| 147 | +
|
| 148 | + The quantities that are expected to be present are: |
| 149 | +
|
| 150 | + * Statistics that are shown on the plot or used by the plotting code: |
| 151 | + * ``approxMagDepth`` |
| 152 | + The approximate magnitude corresponding to the SN cut used. |
| 153 | + * ``f"{self.plotName}_sigmaMAD"`` |
| 154 | + The sigma mad of the distances to the line fit. |
| 155 | + * ``f"{self.identity or ''}_median"`` |
| 156 | + The median of the distances to the line fit. |
| 157 | + * ``f"{self.identity or ''}_hardwired_sigmaMAD"`` |
| 158 | + The sigma mad of the distances to the initial fit. |
| 159 | + * ``f"{self.identity or ''}_hardwired_median"`` |
| 160 | + The median of the distances to the initial fit. |
| 161 | +
|
| 162 | +
|
| 163 | + * Parameters from the fitting code that are illustrated on the plot: |
| 164 | + * ``"bHW"`` |
| 165 | + The hardwired intercept to fall back on. |
| 166 | + * ``"bODR"`` |
| 167 | + The intercept calculated by the orthogonal distance |
| 168 | + regression fitting. |
| 169 | + * ``"bODR2"`` |
| 170 | + The intercept calculated by the second iteration of |
| 171 | + orthogonal distance regression fitting. |
| 172 | + * ``"mHW"`` |
| 173 | + The hardwired gradient to fall back on. |
| 174 | + * ``"mODR"`` |
| 175 | + The gradient calculated by the orthogonal distance |
| 176 | + regression fitting. |
| 177 | + * ``"mODR2"`` |
| 178 | + The gradient calculated by the second iteration of |
| 179 | + orthogonal distance regression fitting. |
| 180 | + * ``"xMin`"`` |
| 181 | + The x minimum of the box used in the fit. |
| 182 | + * ``"xMax"`` |
| 183 | + The x maximum of the box used in the fit. |
| 184 | + * ``"yMin"`` |
| 185 | + The y minimum of the box used in the fit. |
| 186 | + * ``"yMax"`` |
| 187 | + The y maximum of the box used in the fit. |
| 188 | + * ``"mPerp"`` |
| 189 | + The gradient of the line perpendicular to the line from |
| 190 | + the second ODR fit. |
| 191 | + * ``"bPerpMin"`` |
| 192 | + The intercept of the perpendicular line that goes through |
| 193 | + xMin. |
| 194 | + * ``"bPerpMax"`` |
| 195 | + The intercept of the perpendicular line that goes through |
| 196 | + xMax. |
| 197 | +
|
| 198 | + * The main inputs to plot: |
| 199 | + x, y, mag |
| 200 | +
|
| 201 | + Examples |
| 202 | + -------- |
| 203 | + An example of the plot produced from this code is here: |
| 204 | +
|
| 205 | + .. image:: /_static/analysis_tools/stellarLocusExample.png |
| 206 | +
|
| 207 | + For a detailed example of how to make a plot from the command line |
| 208 | + please see the |
| 209 | + :ref:`getting started guide<analysis-tools-getting-started>`. |
206 | 210 | """
|
207 | 211 |
|
208 | 212 | # Define a new colormap
|
|
0 commit comments