From 902a4e9349d4f63c14ab0ca80ec970bc6550cf2a Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Mon, 15 Jul 2024 08:08:30 -0400 Subject: [PATCH] Backport PR #124: strip filepath from filename entry in metadata --- CHANGES.rst | 2 ++ lcviz/parsers.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index ee52a0f..f92a13d 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -8,6 +8,8 @@ * Fixes CDIPS support by handling columns filled with strings with empty units. [#122] +* Removes filepath from FILENAME entry in metadata. [#124] + 0.4.0 (06-11-2024) ------------------ diff --git a/lcviz/parsers.py b/lcviz/parsers.py index 4c32b87..dc4c340 100644 --- a/lcviz/parsers.py +++ b/lcviz/parsers.py @@ -57,6 +57,9 @@ def light_curve_parser(app, file_obj, data_label=None, show_in_viewer=True, **kw light_curve['flux:orig_err'] = light_curve['flux_err'] light_curve.meta['FLUX_ORIGIN'] = 'flux:orig' + if 'FILENAME' in light_curve.meta: + light_curve.meta['FILENAME'] = os.path.basename(light_curve.meta['FILENAME']) + data = _data_with_reftime(app, light_curve) app.add_data(data, new_data_label)