Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
toxdeps: tox-pypi-filter
posargs: -n auto
envs: |
- linux: py312
- linux: py313
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

Expand All @@ -46,7 +46,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'
- run: python -m pip install -U --user build
- run: python -m build . --sdist
- run: python -m pip install -U --user twine
Expand All @@ -62,7 +62,7 @@ jobs:
posargs: -n auto
envs: |
- windows: py311
- macos: py310
- macos: py312
- linux: py310-oldestdeps
- linux: py313-devdeps

Expand All @@ -73,7 +73,7 @@ jobs:
needs: [core]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
with:
default_python: '3.12'
default_python: '3.13'
submodules: false
pytest: false
toxdeps: tox-pypi-filter
Expand All @@ -88,13 +88,13 @@ jobs:
needs: [test]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
with:
default_python: '3.12'
default_python: '3.13'
submodules: false
coverage: codecov
toxdeps: tox-pypi-filter
posargs: -n auto --dist loadgroup
envs: |
- linux: py312-online
- linux: py313-online
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

Expand All @@ -110,7 +110,7 @@ jobs:
needs: [test, docs]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v1
with:
python-version: '3.12'
python-version: '3.13'
test_extras: 'tests'
test_command: 'pytest -p no:warnings --doctest-rst --pyargs sunkit_instruments'
submodules: false
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ examples/**/*.csv
figure_test_images*
tags
sunkit_instruments/_version.py
docs/sg_execution_times.rst

### Pycharm(?)
.idea
Expand All @@ -233,6 +234,7 @@ sunkit_instruments/_version.py
*.orig
.tmp
requirements-min.txt
.ruff_cache

# Example files
dr_suvi-l2-thmap_g16_s20220101T000000Z_e20220101T000400Z_v1-0-2.fits
12 changes: 0 additions & 12 deletions .sunpy-template.yml

This file was deleted.

51 changes: 50 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,52 @@
0.6.0 (2025-03-12)
==================

Breaking Changes
----------------

- Increased minimum Python version to 3.10 (`#125 <https://github.com/sunpy/sunkit-instruments/pull/125>`__)
- Increased the minimum version of ``sunpy`` to 6.0.0. (`#126 <https://github.com/sunpy/sunkit-instruments/pull/126>`__)
- Update the hash of the CHIANTI data file retrieved by the data manager used in `sunkit_instruments.goes_xrs.calculate_temperature_em`
so that the latest version of the file is used. (`#143 <https://github.com/sunpy/sunkit-instruments/pull/143>`__)
- Updated SUVI Flight Model files for FM1 (16) and FM2 (17). (`#168 <https://github.com/sunpy/sunkit-instruments/pull/168>`__)


New Features
------------

- Added `sunkit_instruments.response.SourceSpectra` to provide a container for
spectra as a function of temperature and wavelength needed for computing temperature
response functions. (`#98 <https://github.com/sunpy/sunkit-instruments/pull/98>`__)
- Added `sunkit_instruments.response.abstractions.AbstractChannel` to standardize an interface
for computing wavelength and temperature response functions. (`#98 <https://github.com/sunpy/sunkit-instruments/pull/98>`__)
- Added support for SUVI Flight Models FM3 (18) and FM4 (19). (`#168 <https://github.com/sunpy/sunkit-instruments/pull/168>`__)


Bug Fixes
---------

- In the ``fermi``, the function ``get_detector_sun_angles_for_time`` returns the angle with respect to the Sun of each Fermi/GBM detector.
However, these files contain gaps due to the South Atlantic Anomaly.
If the time requested falls in one of these gaps, the code will return the detector angles for the next available time.
This can be several minutes different from the time requested.
Now, a warning to the user will be raised if the time returned by the code is more than 1 minute different from the time requested (1 minute is the nominal cadence of the spacecraft weekly file), and explains that this is likely due to a South Atlantic Anomaly encounter. (`#128 <https://github.com/sunpy/sunkit-instruments/pull/128>`__)
- The function ``plot_detector_sun_angles`` was broken, due to the formatting of the time axis. (`#130 <https://github.com/sunpy/sunkit-instruments/pull/130>`__)
- Fixed a bug in `~sunkit_instruments.lyra.remove_lytaf_events_from_timeseries` where units were not being correctly passed
to new timeseries. (`#143 <https://github.com/sunpy/sunkit-instruments/pull/143>`__)


Documentation
-------------

- Add a topic guide on a vocabulary for instrument response functions. (`#111 <https://github.com/sunpy/sunkit-instruments/pull/111>`__)


Internal Changes
----------------

- Re-templated the entire library to use the new sunpy template. (`#133 <https://github.com/sunpy/sunkit-instruments/pull/133>`__)


0.5.0 (2023-11-17)
==================

Expand All @@ -17,7 +66,7 @@ Backwards Incompatible Changes

- This removes the older version of `sunkit_instruments.goes_xrs.calculate_temperature_em` that no longer works for the re-processed netcdf files and new GOES-R data.

This also removes the `sunkit_instruments.goes_xrs.calculate_radiative_loss_rate` and `sunkit_instruments.goes_xrs.calculate_xray_luminosity` functions that also no longer work in their current form.
This also removes the ``sunkit_instruments.goes_xrs.calculate_radiative_loss_rate`` and ``sunkit_instruments.goes_xrs.calculate_xray_luminosity`` functions that also no longer work in their current form.

The new `sunkit_instruments.goes_xrs.calculate_temperature_em` function now returns a new sunpy.timeseries.GenericTimeSeries with the temperature and emission measure rather than appending columns to the passed XRSTimeSeries. (`#81 <https://github.com/sunpy/sunkit-instruments/pull/81>`__)

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2020-2024, The SunPy Developers
Copyright (c) 2020-2025, The SunPy Developers
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
Expand Down
1 change: 0 additions & 1 deletion changelog/111.doc.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/125.breaking.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/126.breaking.rst

This file was deleted.

5 changes: 0 additions & 5 deletions changelog/128.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/130.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/133.trivial.rst

This file was deleted.

2 changes: 0 additions & 2 deletions changelog/143.breaking.rst

This file was deleted.

2 changes: 0 additions & 2 deletions changelog/143.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/168.breaking.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/168.feature.rst

This file was deleted.

2 changes: 0 additions & 2 deletions changelog/98.feature.1.rst

This file was deleted.

3 changes: 0 additions & 3 deletions changelog/98.feature.2.rst

This file was deleted.

18 changes: 13 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,17 @@
# Treat everything in single ` as a Python reference.
default_role = "py:obj"

# Enable nitpicky mode, which forces links to be non-broken
nitpicky = True
# This is not used. See docs/nitpick-exceptions file for the actual listing.
nitpick_ignore = []
for line in open('nitpick-exceptions'):
if line.strip() == "" or line.startswith("#"):
continue
dtype, target = line.split(None, 1)
target = target.strip()
nitpick_ignore.append((dtype, target))

# -- Options for intersphinx extension -----------------------------------------

intersphinx_mapping = {
Expand All @@ -100,13 +111,10 @@
(None, "http://www.astropy.org/astropy-data/intersphinx/scipy.inv"),
),
"matplotlib": (
"https://matplotlib.org/",
"https://matplotlib.org/stable/",
(None, "http://www.astropy.org/astropy-data/intersphinx/matplotlib.inv"),
),
"sunpy": (
"https://sunpy.org/",
(None, "https://docs.sunpy.org/en/stable/"),
),
"sunpy": ("https://docs.sunpy.org/en/stable/", None),
"astropy": ("https://docs.astropy.org/en/stable/", None),
"sqlalchemy": ("https://docs.sqlalchemy.org/en/latest/", None),
"pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None),
Expand Down
20 changes: 9 additions & 11 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,18 @@ Once you have that virtual environment, you will want to fork the repo and then
.. _contributing guide: https://docs.sunpy.org/en/latest/dev_guide/contents/newcomers.html


``sunkit-instruments`` is organised into sub-modules for each instrument:

.. toctree::
:maxdepth: 2

code_ref/index
generated/gallery/index
topic_guide/index
whatsnew/index


Note that the code in this package is **not** maintained by or necessarily contributed to by instrument teams.
Some instruments have individual packages for analysis in Python, including:

- `aiapy <https://aiapy.readthedocs.io/>`__
- `eispac <https://eispac.readthedocs.io/>`__
- `xrtpy <https://xrtpy.readthedocs.io/>`__

.. toctree::
:maxdepth: 1
:hidden:

code_ref/index
generated/gallery/index
topic_guide/index
whatsnew/index
8 changes: 8 additions & 0 deletions docs/nitpick-exceptions
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Prevents sphinx nitpicky mode picking up on optional
# (see https://github.com/sphinx-doc/sphinx/issues/6861)
# Even if it was "fixed", still broken
py:class optional
# See https://github.com/numpy/numpy/issues/10039
py:obj numpy.datetime64

py:class Unit
4 changes: 2 additions & 2 deletions examples/calculate_goes_temperature_and_emission_measure.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
##############################################################################
# Now let's calculate the temperature and emission measure estimates from
# these channel fluxes. We can do this by using the function
# `sunkit_instruments.goes_xrs.calculate_temperature_emiss()` which
# takes a sunpy.timeseries.XRSTimeSeries and returns a new GenericTimeSeries
# `sunkit_instruments.goes_xrs.calculate_temperature_em` which
# takes a `sunpy.timeseries.sources.XRSTimeSeries` and returns a new timeseries
# which contains both the respective temperature and emission measure values.

goes_temp_em = goes_xrs.calculate_temperature_em(goes_flare)
Expand Down
6 changes: 3 additions & 3 deletions sunkit_instruments/fermi/fermi.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def plot_detector_sun_angles(angles):
angles : `dict`
A dictionary containing the Fermi/GBM detector angle information as a
function of time. Obtained from the
`~sunkit_instruments.fermi.get_detector_separation_angles` function.
`~sunkit_instruments.fermi.get_detector_sun_angles_for_time` function.
"""
# Reformat the time array so we can plot it
angle_times = []
Expand Down Expand Up @@ -310,8 +310,8 @@ def get_scx_scz_in_timerange(timerange, file):

Parameters
----------
timerange : `sunpy.time.TimeRange`
A SunPy `~sunpy.time.TimeRange`.
timerange : `~sunpy.time.TimeRange`
The time range to extract the pointing information for.
file : `str`
A filepath to a Fermi/LAT weekly pointing file (e.g. as obtained by the
`~sunkit_instruments.fermi.download_weekly_pointing_file` function).
Expand Down
12 changes: 7 additions & 5 deletions sunkit_instruments/goes_xrs/goes_chianti_tem.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ def calculate_temperature_em(goes_ts, abundance="coronal"):

Parameters
----------
goes_ts : `~sunpy.timeseries.XRSTimeSeries`
goes_ts : `~sunpy.timeseries.sources.XRSTimeSeries`
The GOES/XRS timeseries containing the data of both the xrsa and xrsb channels (in units of W/m**2).
abundance: {"coronal", "photospheric"}, optional
abundance: str, optional
Which abundances to use for the calculation, the default is "coronal".
Can be either "coronal" or "photospheric".

Returns
-------
Expand All @@ -62,7 +63,7 @@ def calculate_temperature_em(goes_ts, abundance="coronal"):
-----
This function works with both the NOAA-provided netcdf files, for which the data is given in "true" fluxes
and with the older FITS files provided by the SDAC, for which the data are scaled to be consistent with GOES-7.
The routine determines from the `sunpy.timeseries.XRSTimeSeries` metadata
The routine determines from the `sunpy.timeseries.sources.XRSTimeSeries` metadata
whether the SWPC scaling factors need to be removed (which are present in the FITS data).

See also: https://hesperia.gsfc.nasa.gov/goes/goes.html#Temperature/Emission%20Measure
Expand Down Expand Up @@ -154,15 +155,16 @@ def _chianti_temp_emiss(

Parameters
----------
goes_ts : `~sunpy.timeseries.XRSTimeSeries`
goes_ts : `~sunpy.timeseries.sources.XRSTimeSeries`
The GOES XRS timeseries containing the data of both the xrsa and xrsb channels (in units of W/m**2).
sat : `int`
GOES satellite number.
secondary: `int`, optional
Values 0, 1, 2, 3 indicate A1+B1, A2+B1, A1+B2, A2+B2 detector combos for GOES-R.
Defaults to 0.
abundance: {"coronal", "photospheric"}, optional
abundance: str, optional
Which abundances to use for the calculation, the default is "coronal".
Can be either "coronal" or "photospheric".
remove_scaling: `bool`, optional
Checks whether to remove the SWPC scaling factors.
This is only an issue for the older FITS files for GOES 8-15 XRS.
Expand Down
2 changes: 1 addition & 1 deletion sunkit_instruments/goes_xrs/goes_xrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def flux_to_flareclass(goesflux: u.watt / u.m**2):

References
----------
`Solar Flare Classification <https://en.wikipedia.org/wiki/Solar_flare#Classification>`_
`Solar Flare Classification <https://en.wikipedia.org/wiki/Solar_flare#Classification>`__

Examples
--------
Expand Down
11 changes: 2 additions & 9 deletions sunkit_instruments/lyra/lyra.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def remove_lytaf_events_from_timeseries(

Parameters
----------
ts : `sunpy.timeseries.TimeSeries`
ts : `sunpy.timeseries.GenericTimeSeries`
artifacts : `list`
Sets the artifact types to be removed. For a list of artifact types
see reference [1]. For example, if a user wants to remove only large
Expand All @@ -62,7 +62,7 @@ def remove_lytaf_events_from_timeseries(

Returns
-------
ts_new : `sunpy.timeseries.TimeSeries`
ts_new : `sunpy.timeseries.GenericTimeSeries`
copy of input TimeSeries with periods corresponding to artifacts
removed.
artifact_status : `dict`
Expand Down Expand Up @@ -129,7 +129,6 @@ def _remove_lytaf_events(
channels=None,
artifacts=None,
return_artifacts=False,
filecolumns=None,
force_use_local_lytaf=False,
):
"""
Expand Down Expand Up @@ -162,12 +161,6 @@ def _remove_lytaf_events(
Set to True to return a numpy recarray containing the start time, end
time and type of all artifacts removed.
Default=False
filecolumns : `list` of strings
Gives names of columns of any output files produced. Although
initially set to None above, the default is in fact
["time", "channel0", "channel1",..."channelN"]
where N is the number of irradiance arrays in the channels input
(assuming 0-indexed counting).
force_use_local_lytaf : `bool`
Ensures current local version of lytaf files are not replaced by
up-to-date online versions even if current local lytaf files do not
Expand Down
Loading