panoptes.pipeline.utils.images¶
panoptes.pipeline.utils.images ¶
NoSourcesDetected ¶
extract_metadata ¶
Get the metadata from a FITS image.
Returns dict(unit=..., sequence=..., image=...), one key per document.
That shape is the contract and predates this function's current form; see
data contract 3.1.
camera_settings supplies the fallbacks for calibration values the
header does not carry. Whatever it supplies is labeled Provenance.DEFAULT
in the resulting document rather than being indistinguishable from a
measurement.
Source code in src/panoptes/pipeline/utils/images.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | |
match_sources ¶
match_sources(detected_sources: DataFrame, solved_wcs0: WCS, settings: ImageSettings, image_edge: int = 10, image_width: int | None = None, image_height: int | None = None) -> pandas.DataFrame
Match detected sources against the catalog and drop the ones near the edge.
image_width and image_height are passed in rather than read from
settings because the settings hold fleet-wide defaults, and the frame's
real dimensions come from its own NAXIS1/NAXIS2. The old notebook
reconciled this by writing the shape back into the settings object, which
would now change the params fingerprint from frame to frame and make the
idempotency check meaningless.
Source code in src/panoptes/pipeline/utils/images.py
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | |
plate_solve ¶
Solve filename and return its WCS.
replace defaults to False, which is panoptes-utils' non-destructive
mode: the WCS goes to a .new file and the input is left alone. The
library default is True, and it does not merely add a WCS -- solve-field
rewrites the file as a single HDU, so solving a multi-extension product in
place silently discards every extension beside the science frame. Verified
against a real frame: a four-extension file came back with one.
The same applies to panoptes-utils image fits solve, which forwards its
keywords to the same function and so carries the same default.