Skip to content

Commit a9c31c0

Browse files
author
bekahalbach
committed
warning about FITS scaling in dump_browse
1 parent 16087eb commit a9c31c0

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

pdr/pdr.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ def get_annotations(o):
4747

4848
from pdr.errors import AlreadyLoadedError, DuplicateKeyWarning
4949
from pdr.formats import check_special_fn, special_image_constants
50-
from pdr.loaders.utility import DESKTOP_IMAGE_STANDARDS
50+
from pdr.loaders.utility import (
51+
DESKTOP_IMAGE_STANDARDS,
52+
FITS_EXTENSIONS,
53+
looks_like_this_kind_of_file,
54+
)
5155
from pdr.parselabel.pds3 import (
5256
depointerize,
5357
get_pds3_pointers,
@@ -1069,7 +1073,12 @@ def dump_browse(
10691073
self[obj].__class__.__name__ == "ndarray"
10701074
and len(self[obj].shape) != 1
10711075
):
1072-
if scaled == "both":
1076+
if looks_like_this_kind_of_file(self.filename, FITS_EXTENSIONS) \
1077+
and (scaled == "both" or scaled is False):
1078+
warnings.warn("Scaling for FITS files cannot be turned "
1079+
"off, dumping scaled products.")
1080+
dump_it(self[obj], outfile + "_scaled")
1081+
elif scaled == "both":
10731082
dump_it(
10741083
self.get_scaled(obj, float_dtype=fdt),
10751084
outfile + "_scaled",

0 commit comments

Comments
 (0)