From 434857b755f8a3f89b1ac93d788dc9239e9cb2f9 Mon Sep 17 00:00:00 2001 From: Scott Fleming Date: Fri, 4 Aug 2023 17:38:07 -0400 Subject: [PATCH 1/4] Adding support for uncertainties in FLUX_ERROR column, fixing y-axis tick label readibility on thumb sizes. --- spec_plots/__init__.py | 2 +- spec_plots/utils/specutils_jwst/plotspec.py | 6 ++++-- spec_plots/utils/specutils_jwst/readspec.py | 10 +++++++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/spec_plots/__init__.py b/spec_plots/__init__.py index 38f629b..88a153d 100644 --- a/spec_plots/__init__.py +++ b/spec_plots/__init__.py @@ -8,4 +8,4 @@ from __future__ import absolute_import -__version__ = '1.35.0' +__version__ = '1.35.1' diff --git a/spec_plots/utils/specutils_jwst/plotspec.py b/spec_plots/utils/specutils_jwst/plotspec.py index 8a11d67..f116e84 100644 --- a/spec_plots/utils/specutils_jwst/plotspec.py +++ b/spec_plots/utils/specutils_jwst/plotspec.py @@ -237,7 +237,8 @@ def plotspec(jwst_spectrum, output_type, output_file, flux_scale_factor, # Only use two tick labels (min and max wavelengths) for # thumbnails, because there isn't enough space otherwise. if not is_bigplot: - rc('font', size=10) + this_plotarea.tick_params(labelsize=6., labelrotation=45., + axis='y', pad=0.) minwl = numpy.nanmin(all_wls) maxwl = numpy.nanmax(all_wls) this_plotarea.set_xticks([minwl, maxwl]) @@ -275,7 +276,8 @@ def plotspec(jwst_spectrum, output_type, output_file, flux_scale_factor, # Configure the plot units, text size, and other markings based # on whether this is a large or thumbnail-sized plot. if not is_bigplot: - rc('font', size=10) + this_plotarea.tick_params(labelsize=6., labelrotation=45., + axis='y', pad=0.) minwl = numpy.nanmin(all_wls) maxwl = numpy.nanmax(all_wls) this_plotarea.set_xticks([minwl, maxwl]) diff --git a/spec_plots/utils/specutils_jwst/readspec.py b/spec_plots/utils/specutils_jwst/readspec.py index 70c099e..2ce4e4f 100644 --- a/spec_plots/utils/specutils_jwst/readspec.py +++ b/spec_plots/utils/specutils_jwst/readspec.py @@ -63,9 +63,13 @@ def readspec(input_file): try: fluxerr_table = jwst_tabledata.field("ERROR") except KeyError: - print("*** MAKE_JWST_SPEC_PREVIEWS ERROR: ERROR column not found" - " in first extension's binary table.") - exit(1) + try: + fluxerr_table = jwst_tabledata.field("FLUX_ERROR") + except KeyError: + print("*** MAKE_JWST_SPEC_PREVIEWS ERROR: neither ERROR " + "nor FLUX_ERROR column found in first " + "extension's binary table.") + exit(1) try: dq_table = jwst_tabledata.field("DQ") From 2f2289c0fad79f2da0788975783f9ec2e723d1f2 Mon Sep 17 00:00:00 2001 From: Scott Fleming Date: Fri, 4 Aug 2023 17:42:58 -0400 Subject: [PATCH 2/4] updaing changelog --- History.rst | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/History.rst b/History.rst index 218bbd3..27e3e98 100644 --- a/History.rst +++ b/History.rst @@ -1,7 +1,14 @@ Change Log for SPEC_PLOTS ========================= -v1.35.0 - 2023 Jul. 31 +v1.35.1 - 2023 Aug. 4 +----------------- +* Added support for flux uncertainties being in FLUX_ERROR column + instead of ERROR column for JWST x1d FITS files. +* Fixed readability of y-axis tick labels by adjusting font size, + angle, and padding. + +v1.35.0 - 2023 Jul. 31 ----------------- * Added required config file for ReadTheDocs. * Updated package dependencies to newer versions. From 87dbceef2018180e231333199626bae6a3377ca6 Mon Sep 17 00:00:00 2001 From: Scott Fleming Date: Fri, 4 Aug 2023 17:54:19 -0400 Subject: [PATCH 3/4] Changing setup.py Python version since this should run on any Python 3 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a3308b8..ad358f5 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup(name="spec_plots", version=__version__, description="Create preview plots of HST or JWST spectra.", - classifiers=["Programming Language :: Python :: 3.9"], + classifiers=["Programming Language :: Python :: 3"], url="https://github.com/spacetelescope/spec_plots", author="Scott W. Fleming", author_email="fleming@stsci.edu", From 4124d78e048dfb8a07c6744f4e5af27c359551eb Mon Sep 17 00:00:00 2001 From: Scott Fleming Date: Fri, 4 Aug 2023 17:56:19 -0400 Subject: [PATCH 4/4] updating package info --- spec_plots.egg-info/PKG-INFO | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec_plots.egg-info/PKG-INFO b/spec_plots.egg-info/PKG-INFO index 4d46726..19f4440 100644 --- a/spec_plots.egg-info/PKG-INFO +++ b/spec_plots.egg-info/PKG-INFO @@ -1,9 +1,9 @@ Metadata-Version: 2.1 Name: spec-plots -Version: 1.35.0 +Version: 1.35.1 Summary: Create preview plots of HST or JWST spectra. Home-page: https://github.com/spacetelescope/spec_plots Author: Scott W. Fleming Author-email: fleming@stsci.edu License: MIT -Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3