Skip to content

Add temperature response functions - #443

Draft
nabobalis wants to merge 3 commits into
channel_refactorfrom
temperature_response
Draft

nabobalis wants to merge 3 commits into
channel_refactorfrom
temperature_response

Conversation

@nabobalis

@nabobalis nabobalis commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes #18.

temperature_response(channel, spectra, obstime=None, *, chiantifix=False)
  R = spectra.temperature_response(channel)            # includes C_EVE when include_eve_correction
  if chiantifix: R += spectra.meta["chiantifix"][channel.name]
  if obstime:    R = degradation(obstime)[:, None] * R  # (n_time, n_T) for an array of times
  • get_source_spectra() returns SolarSoft's V9 emissivity (CHIANTI 9.0.1) as a sunkit-instruments SourceSpectra. It downloads a 2.5 MB file once, from Add the AIA V9 summed emissivity for aiapy backup-files#15.
  • temperature_response(Channel(94 * u.AA, include_eve_correction=True), get_source_spectra(), t, chiantifix=True) is aia_get_response(/temperature,/dn,/evenorm,/chiantifix,timedepend_date=t).
  • chiantifix=True raises without EVE normalization or with other spectra.

Builds on #419. The download needs LM-SAL/backup-files#15.

Evidence

Merge Danger

Door: two-way

Blast Radius: new functions only; the first use downloads 2.5 MB.

Summary by Sourcery

Add SolarSoft-compatible temperature response functions for AIA EUV channels.

New Features:

  • Add temperature response calculations for AIA EUV channels using SolarSoft-compatible source spectra, EVE normalization, empirical CHIANTI corrections, and time-dependent degradation.
  • Provide cached retrieval of SolarSoft V9 emissivity data and an example demonstrating temperature response workflows.

Enhancements:

  • Expose the new temperature response APIs through the response package.

Documentation:

  • Document temperature response usage in a new example and changelog entry.

Tests:

  • Add unit and SolarSoft consistency tests covering channel corrections, degradation times, array inputs, and validation errors.

Matches SSW aia_get_response(/temperature,/dn), with EVE normalization,
degradation and the chiantifix.
@sourcery-ai

sourcery-ai Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Introduces cached SolarSoft emissivity loading and temperature-response computation for AIA channels, with optional EVE/CHIANTI corrections and time-dependent degradation, backed by numerical SolarSoft comparisons, focused unit tests, and an example.

File-Level Changes

Change Details Files
Add public APIs for loading SolarSoft V9 emissivity data and computing AIA temperature responses.
  • Download and cache the verified 2.5 MB emissivity FITS file, converting its temperature, wavelength, emissivity, density, metadata, and CHIANTI-fix tables into SourceSpectra.
  • Fold source spectra through a channel response, optionally apply EVE normalization, CHIANTI correction, and time-dependent degradation, including scalar and array observation times.
  • Export the new APIs from the response package.
aiapy/response/temperature.py
aiapy/response/__init__.py
Add coverage validating numerical compatibility, input constraints, and time-axis behavior.
  • Compare all EUV channels and response options against SolarSoft IDL outputs.
  • Test expected response values, CHIANTI-fix validation, and array-obstime shape/equivalence behavior.
aiapy/response/tests/test_temperature.py
aiapy/tests/test_idl.py
aiapy/tests/data/aia_V10_20201119_190000_response_table.txt
Document and demonstrate temperature-response workflows.
  • Add a changelog entry and an example covering EVE normalization, CHIANTI correction, degradation, and multiple observation times.
changelog/443.feature.rst
examples/temperature_response.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@nabobalis
nabobalis added this pull request to stack #444 October 20, 2026 18:10

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Temperature response functions

1 participant