|
16 | 16 |
|
17 | 17 | from . import log |
18 | 18 | from .Cutout import Cutout |
19 | | -from .exceptions import DataWarning, InvalidQueryError |
| 19 | +from .exceptions import InvalidQueryError |
20 | 20 | from .utils.wcs_fitting import fit_wcs_from_points |
21 | 21 |
|
22 | 22 |
|
@@ -64,8 +64,6 @@ class CubeCutout(Cutout, ABC): |
64 | 64 | Adding extra keywords to the table header. |
65 | 65 | _apply_header_inherit(hdu_list) |
66 | 66 | Apply header inheritance to the cutout target pixel file. |
67 | | - _build_tpf(cube, cutout, cutout_wcs_dict) |
68 | | - Build the cutout target pixel file. |
69 | 67 | _cutout_file(file) |
70 | 68 | Make a cutout from a single cube file. |
71 | 69 | cutout() |
@@ -262,53 +260,15 @@ def _apply_header_inherit(self, hdu_list: fits.HDUList): |
262 | 260 | for kwd, val in primary_header.items(): |
263 | 261 | if (kwd not in header) and (kwd not in reserved_kwds): |
264 | 262 | header[kwd] = (val, primary_header.comments[kwd]) |
265 | | - |
266 | | - @abstractmethod |
267 | | - def _build_tpf(self, cube_fits: fits.HDUList, cutout: 'CubeCutoutInstance') -> fits.HDUList: |
268 | | - """ |
269 | | - Build the cutout target pixel file (TPF). |
270 | | -
|
271 | | - This method is abstract and should be defined in subclasses. |
272 | | - """ |
273 | | - pass |
274 | 263 |
|
| 264 | + @abstractmethod |
275 | 265 | def _cutout_file(self, file: Union[str, Path, S3Path]): |
276 | 266 | """ |
277 | 267 | Make a cutout from a single cube file. |
278 | 268 |
|
279 | | - Parameters |
280 | | - ---------- |
281 | | - file : str, Path, or S3Path |
282 | | - The path to the cube file. |
| 269 | + This method is abstract and should be defined in subclasses. |
283 | 270 | """ |
284 | | - # Read in file data |
285 | | - cube = self._load_file_data(file) |
286 | | - |
287 | | - # Parse table info |
288 | | - cube_wcs = self._parse_table_info(cube[2].data) |
289 | | - |
290 | | - # Get cutouts |
291 | | - try: |
292 | | - cutout = self.CubeCutoutInstance(cube, file, cube_wcs, self._has_uncertainty, self) |
293 | | - except InvalidQueryError: |
294 | | - warnings.warn(f'Cutout footprint does not overlap with data in {file}, skipping...', DataWarning) |
295 | | - cube.close() |
296 | | - return |
297 | | - |
298 | | - # Build TPF |
299 | | - self._build_tpf(cube, cutout) |
300 | | - cube.close() |
301 | | - |
302 | | - # Log coordinates |
303 | | - log.debug('Cutout center coordinate: %s, %s', self._coordinates.ra.deg, self._coordinates.dec.deg) |
304 | | - |
305 | | - # Get cutout WCS info |
306 | | - max_dist, sigma = cutout.wcs_fit['WCS_MSEP'][0], cutout.wcs_fit['WCS_SIG'][0] |
307 | | - log.debug('Maximum distance between approximate and true location: %s', max_dist) |
308 | | - log.debug('Error in approximate WCS (sigma): %.4f', sigma) |
309 | | - |
310 | | - # Store cutouts with filename |
311 | | - self.cutouts_by_file[file] = cutout |
| 271 | + pass |
312 | 272 |
|
313 | 273 | def cutout(self): |
314 | 274 | """ |
|
0 commit comments