Metadata-Version: 2.4
Name: demregpy
Version: 1.0.0
Summary: DEM Regularised Inversion Calculation in Python (Hannah & Kontar 2012)
Author-email: Alasdair Wilson <alasdair.wlsn@gmail.com>
Project-URL: Homepage, https://github.com/alasdairwilson/demregpy
Project-URL: Source Code, https://github.com/alasdairwilson/demregpy
Project-URL: Download, https://pypi.org/project/demregpy
Project-URL: Issue Tracker, https://github.com/alasdairwilson/demregpy/issues/
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Astronomy
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.12
Description-Content-Type: text/x-rst
License-File: licenses/LICENSE.rst
Requires-Dist: matplotlib>=3.10.7
Requires-Dist: numpy>=2.0.0
Requires-Dist: tqdm>=4.67.0
Requires-Dist: threadpoolctl>=3.6.0
Provides-Extra: aia
Requires-Dist: scipy; extra == "aia"
Requires-Dist: sunpy[map]; extra == "aia"
Provides-Extra: responses
Requires-Dist: demregpy[aia]; extra == "responses"
Provides-Extra: tests
Requires-Dist: demregpy[responses]; extra == "tests"
Requires-Dist: pytest; extra == "tests"
Requires-Dist: pytest-doctestplus; extra == "tests"
Requires-Dist: pytest-cov; extra == "tests"
Requires-Dist: pytest-xdist; extra == "tests"
Provides-Extra: docs
Requires-Dist: demregpy[responses]; extra == "docs"
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: sphinx-design; extra == "docs"
Requires-Dist: sphinx-automodapi; extra == "docs"
Requires-Dist: sphinx-changelog; extra == "docs"
Requires-Dist: sunpy-sphinx-theme; extra == "docs"
Requires-Dist: packaging; extra == "docs"
Requires-Dist: sphinx-gallery; extra == "docs"
Requires-Dist: sunpy[net]; extra == "docs"
Requires-Dist: aiapy; extra == "docs"
Dynamic: license-file

demregpy
========

This is a python implementation of Hannah & Kontar (2012)'s regularised inversion method.
The code is tightly based on the IDL mapping version of the DEM reg-inv code found at https://github.com/ianan/demreg in addition, the code enforces a positivity constraint on the DEM (hence pos).

The philosophy was to produce as similar a piece of software as the original version and as such, this python version has been shown to recover the same DEM as the IDL version (to within approximately 4 significant figures).
Since then the code has been significantly optimised and expanded with new features while retaining numerical agreement with the original implementation.

To calculate a DEM you first need:

- Data and associated error for a range of channels: e.g. in dn/s/px or counts/s

- Temperature dependent channel response: How sensitive are your channels to plasma of each temperature?

To use: simply call ``dn2dem`` with either a single pixel, 1d slice, 2d map, or 3d map-timeseries of DN values as a function of filter (and associated error on DN), an array of temperatures over which to perform the DEM analysis and a temperature response for those filters.

For large datasets, beyond 200 pixels, the code switches to a parallel execution providing significant speedups.

Usage of Generative AI
----------------------

We expect authentic engagement in our community.
Be wary of posting output from Large Language Models or similar generative AI as comments on GitHub or any other platform, as such comments tend to be formulaic and low quality content.
If you use generative AI tools as an aid in developing code or documentation changes, ensure that you fully understand the proposed changes and can explain why they are the correct approach and an improvement to the current state.

License
-------

This project is Copyright (c) Alasdair Wilson and licensed under
the terms of the MIT license. This package is based upon
the `Openastronomy packaging guide <https://github.com/OpenAstronomy/packaging-guide>`_
which is licensed under the BSD 3-clause licence. See the license files for
more information.

Contributing
------------

We love contributions! demregpy is open source, built on open source, and we'd love to have you hang out in our community.

**Imposter syndrome disclaimer**: We want your help. No, really.

There may be a little voice inside your head that is telling you that you're not
ready to be an open source contributor; that your skills aren't nearly good
enough to contribute. What could you possibly offer a project like this one?

We assure you - the little voice in your head is wrong. If you can write code at
all, you can contribute code to open source. Contributing to open source
projects is a fantastic way to advance one's coding skills. Writing perfect code
isn't the measure of a good developer (that would disqualify all of us!); it's
trying to create something, making mistakes, and learning from those
mistakes. That's how we all improve, and we are happy to help others learn.

Being an open source contributor doesn't just mean writing code, either. You can
help out by writing documentation, tests, or even giving feedback about the
project (and yes - that includes giving feedback about the contribution
process). Some of these contributions may be the most valuable to the project as
a whole, because you're coming to the project with fresh eyes, so you can see
the errors and assumptions that seasoned contributors have glossed over.

Note: This disclaimer was originally written by
`Adrienne Lowe <https://github.com/adriennefriend>`_ for a
`PyCon talk <https://www.youtube.com/watch?v=6Uj746j9Heo>`_, and was adapted by
demregpy based on its use in the README file for the
`MetPy project <https://github.com/Unidata/MetPy>`_.
