LM-SAL / aiapy

Python library for AIA data analysis
https://aiapy.readthedocs.io/en/stable/
BSD 3-Clause "New" or "Revised" License
7 stars 3 forks source link

Refactor `Channel` on top of `sunkit_instruments.response.abstractions.AbstractChannel` #344

Open wtbarnes opened 2 months ago

wtbarnes commented 2 months ago

This is a first attempt at refactoring the Channel class on top of the AbstractChannel class from sunkit-instruments. The latter is still in the form of a draft PR sunpy/sunkit-instruments#98 so this is an experimental PR at this stage.

The goal here is to easily enable calculating the temperature response functions.

As it stands, this represents a breaking change to the Channel API.

ToDos before this can be merged:

Summary by Sourcery

Refactor the Channel class to extend AbstractChannel, enhancing the API with additional parameters and methods for more flexible and accurate temperature response function calculations. This change introduces a breaking change to the Channel API.

Enhancements:

sourcery-ai[bot] commented 2 months ago

Reviewer's Guide by Sourcery

This pull request refactors the Channel class to inherit from AbstractChannel in sunkit-instruments. The changes aim to enable easier calculation of temperature response functions. The refactoring introduces new properties and methods, modifies existing ones, and updates the effective area calculation to include degradation and crosstalk effects.

File-Level Changes

Change Details Files
Refactor Channel class to inherit from AbstractChannel
  • Change class definition to inherit from AbstractChannel
  • Add new parameters to init method
  • Implement new properties and methods from AbstractChannel
  • Update existing properties to align with AbstractChannel
aiapy/response/channel.py
Modify effective area calculation
  • Implement degradation method to calculate wavelength- and time-dependent degradation factor
  • Update effective_area method to include degradation and crosstalk effects
  • Add _get_crosstalk method to compute cross-talk component of effective area
aiapy/response/channel.py
Remove and replace methods
  • Remove wavelength_response method
  • Replace eve_correction method with _get_eve_correction
  • Remove gain property
aiapy/response/channel.py
Update property names and implementations
  • Rename primary_reflectance to primary_mirror_reflectance
  • Rename secondary_reflectance to secondary_mirror_reflectance
  • Add mirror_reflectance property
  • Rename focal_plane_filter_efficiency to focal_plane_filter_transmittance
  • Rename entrance_filter_efficiency to entrance_filter_transmittance
  • Add filter_transmittance property
  • Rename geometrical_collecting_area to geometrical_area
  • Rename quantum_efficiency to effective_quantum_efficiency
aiapy/response/channel.py

Tips - Trigger a new Sourcery review by commenting `@sourcery-ai review` on the pull request. - Continue your discussion with Sourcery by replying directly to review comments. - You can change your review settings at any time by accessing your [dashboard](https://app.sourcery.ai): - Enable or disable the Sourcery-generated pull request summary or reviewer's guide; - Change the review language; - You can always [contact us](mailto:support@sourcery.ai) if you have any questions or feedback.