Skip to content

Commit

Permalink
Add DKISTUserWarning if calling TiledDataset.plot on stale metada…
Browse files Browse the repository at this point in the history
…ta file
  • Loading branch information
eigenbrot committed Feb 4, 2025
1 parent fae6573 commit aa8af14
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dkist/dataset/tiled_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

from dkist.io.file_manager import FileManager, StripedExternalArray
from dkist.io.loaders import AstropyFITSLoader
from dkist.utils.exceptions import DKISTDeprecationWarning
from dkist.utils.exceptions import DKISTDeprecationWarning, DKISTUserWarning

from .dataset import Dataset
from .utils import dataset_info_str
Expand Down Expand Up @@ -212,6 +212,11 @@ def plot(self, slice_index, share_zscale=False, figure=None, swap_tile_limits: L
if swap_tile_limits not in ["x", "y", "xy", None]:
raise RuntimeError("swap_tile_limits must be one of ['x', 'y', 'xy', None]")

if len(self.meta.get("history", {}).get("entries", [])) == 0:
warnings.warn("The metadata ASDF file that produced this dataset is out of date and "
"will result in incorrect plots. Please re-download the metadata ASDF file.",
DKISTUserWarning)

if isinstance(slice_index, int):
slice_index = (slice_index,)
vmin, vmax = np.inf, 0
Expand Down

0 comments on commit aa8af14

Please sign in to comment.