Skip to content

Commit f7c9d63

Browse files
committed
store filename as string
1 parent 2ca38bd commit f7c9d63

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

astrocut/asdf_cutout.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,13 +425,14 @@ def _cutout_file(self, file: Union[str, Path, S3Path]):
425425
self._gwcs_objects.append(gwcs)
426426

427427
# Store the ASDF tree for this cutout
428+
file_str = str(file)
428429
if not self._lite:
429430
tree[self._mission_kwd]['meta']['wcs'] = self._slice_gwcs(data_cutout, gwcs)
430-
tree[self._mission_kwd]['meta']['orig_file'] = str(file)
431+
tree[self._mission_kwd]['meta']['orig_file'] = file_str
431432
self._asdf_trees.append(tree)
432433

433434
# Store cutout with filename
434-
self.cutouts_by_file[file] = [data_cutout]
435+
self.cutouts_by_file[file_str] = [data_cutout]
435436

436437
def cutout(self) -> Union[str, List[str], List[fits.HDUList]]:
437438
"""
@@ -463,15 +464,15 @@ def cutout(self) -> Union[str, List[str], List[fits.HDUList]]:
463464

464465
return self.cutouts
465466

466-
def _make_cutout_filename(self, file: Union[str, Path], output_format: str) -> str:
467+
def _make_cutout_filename(self, file: str, output_format: str) -> str:
467468
"""
468469
Generate a standardized filename for the cutout.
469470
470471
Overrides the superclass method to include the '_lite' tag if applicable and the output format.
471472
472473
Parameters
473474
----------
474-
file : str | Path
475+
file : str
475476
The input file name.
476477
output_format : str
477478
The output format to write the cutout to. Options are '.fits' and '.asdf'.

0 commit comments

Comments
 (0)