Metadata-Version: 2.4
Name: stisblazefix
Version: 1.2.0
Summary: HST/STIS echelle blaze function correction
Author: M. Baer, C. Proffitt
Maintainer: Sean Lockwood
License: Copyright (C) 2017-2025 Association of Universities for Research in Astronomy (AURA)
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
            1. Redistributions of source code must retain the above copyright
              notice, this list of conditions and the following disclaimer.
        
            2. Redistributions in binary form must reproduce the above
              copyright notice, this list of conditions and the following
              disclaimer in the documentation and/or other materials provided
              with the distribution.
        
            3. The name of AURA and its representatives may not be used to
              endorse or promote products derived from this software without
              specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY AURA ``AS IS'' AND ANY EXPRESS OR IMPLIED
        WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
        MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL AURA BE LIABLE FOR ANY DIRECT, INDIRECT,
        INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
        BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
        OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
        ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
        TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
        USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
        DAMAGE.
        
Project-URL: Homepage, https://www.stsci.edu/hst/instrumentation/stis
Project-URL: Support, https://hsthelp.stsci.edu
Keywords: astronomy
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Development Status :: 5 - Production/Stable
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Topic :: Scientific/Engineering :: Astronomy
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/x-rst
License-File: LICENSE.txt
Requires-Dist: numpy>=1.13
Requires-Dist: scipy
Requires-Dist: astropy
Requires-Dist: matplotlib
Requires-Dist: lmfit
Provides-Extra: docs
Requires-Dist: sphinx; extra == "docs"
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Dynamic: license-file

STIS Echelle Blaze Function Correction Script
=============================================

Correction for the HST/STIS echelle blaze function.

See documentation at https://stisblazefix.readthedocs.io

.. image:: https://github.com/spacetelescope/stisblazefix/actions/workflows/ci.yml/badge.svg?branch=master
   :alt: Build Status
   :target: https://github.com/spacetelescope/stisblazefix/actions/workflows/ci.yml

.. image:: https://coveralls.io/repos/github/spacetelescope/stisblazefix/badge.svg?branch=master
   :alt: Test Coverage
   :target: https://coveralls.io/github/spacetelescope/stisblazefix?branch=master

.. image:: https://readthedocs.org/projects/stisblazefix/badge/
   :alt: Documentation Status
   :target: https://stisblazefix.readthedocs.io/en/latest/?badge=latest

This module contains a variety of functions to correct the blaze function in HST STIS
echelle modes. It is intended for use with STIS echelle x1d FITS files.
Most users will be interested in the `fluxfix` function.

The `stisblazefix.py` module contains the following routines:

* `fluxfix` takes a list of x1d FITS files and generates corrected x1f files and diagnostic plots.
* `fluxcorrect` takes a shift to the blaze function and recalculates the flux and error.
* `residcalc` takes an echelle spectrum and calculates the flux residuals for the overlapping region.
* `generateplot` takes an old and a corrected spectrum and generates a diagnostic plot.
* `residfunc` is a wrapper for the `lmfit` minimizer.
* `findshift` calculates the shift to the blaze function that best aligns the spectrum.
* `plotblaze` plots the sensitivity curves for an extracted spectrum.
* `cliprange` is used to set the Y range for some of the plots to exclude outliers.
* `mkdqmask` creates a mask based on the bits set in data quality flags.

IDL version by C. Proffitt (Jan 2017)  
Python adaptation by M. Baer (Jun–Aug 2017)  
Additional fixes by C. Proffitt (Aug–Sep 2017)
