Skip to main content

DEM Regularised Inversion Calculation in Python (Hannah & Kontar 2012)

Project description

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 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 for a PyCon talk, and was adapted by demregpy based on its use in the README file for the MetPy project.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

demregpy-1.0.0.tar.gz (12.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

demregpy-1.0.0-py3-none-any.whl (12.9 MB view details)

Uploaded Python 3

File details

Details for the file demregpy-1.0.0.tar.gz.

File metadata

  • Download URL: demregpy-1.0.0.tar.gz
  • Upload date:
  • Size: 12.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for demregpy-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b65e40987d512860bfcc7837c8d4ff7f7c3e2af33542af4da42f5a1c5ee40b31
MD5 f4d4c7458cdeccff70f3add62561c24b
BLAKE2b-256 157f6efb3a0efc2d2c16aadd64259cde46913ef7a289d1b0ae94195a6cb46fc1

See more details on using hashes here.

Provenance

The following attestation bundles were made for demregpy-1.0.0.tar.gz:

Publisher: ci.yml on alasdairwilson/demregpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file demregpy-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: demregpy-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 12.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for demregpy-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f3e7f8884a7e69768aa5a60bc30418027475adca6b3291063df53b9772acfb0f
MD5 c0b35d890171f4f57949effce0528292
BLAKE2b-256 5657708778cd895d0de357f137a0333722f72ace9bd3324c216b1ac12a7c95f2

See more details on using hashes here.

Provenance

The following attestation bundles were made for demregpy-1.0.0-py3-none-any.whl:

Publisher: ci.yml on alasdairwilson/demregpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page