Sunpy

Latest version: v5.1.3

Safety actively analyzes 627711 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 8

5.1.0

==================

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

- Added the ability to skip over errors raised for invalid fits files when passing a list of files to map using the existing keyword argument ``silence_errors``. (`7018 <https://github.com/sunpy/sunpy/pull/7018>`__)
- Added a :meth:`sunpy.coordinates.Helioprojective.is_visible` method to return whether the coordinate is visible (i.e., not obscured from the observer assuming that the Sun is an opaque sphere). (`7118 <https://github.com/sunpy/sunpy/pull/7118>`__)
- Added a keyword option (``quiet``) for :func:`~sunpy.coordinates.get_body_heliographic_stonyhurst` to silence the normal reporting of the light-travel-time correction when ``observer`` is specified. (`7142 <https://github.com/sunpy/sunpy/pull/7142>`__)
- Added the function :func:`sunpy.coordinates.sun.eclipse_amount` to calculate the solar-eclipse amount for an observer. (`7142 <https://github.com/sunpy/sunpy/pull/7142>`__)
- Add a keyword (``map_center_longitude``) to :func:`~sunpy.map.header_helper.make_heliographic_header` for centering the heliographic map at a longitude other than zero longitude. (`7143 <https://github.com/sunpy/sunpy/pull/7143>`__)
- The minimum required version of ``Glymur`` (an optional dependency for reading JPEG2000 files) has been increase to 0.9.1. (`7164 <https://github.com/sunpy/sunpy/pull/7164>`__)
- Added new default colormap scalings for WISPR Maps. Plots are now clipped at zero, and `~astropy.visualization.AsinhStretch` is used for the scaling to ensure coronal details are visible despite the much-brighter stars. Parsing of the ``detector`` and ``level`` fields of the FITS headers is also improved. (`7180 <https://github.com/sunpy/sunpy/pull/7180>`__)
- When creating a coordinate or coordinate frame without specifying ``obstime``, the ``obstime`` value from the ``observer`` frame attribute will be used if present. (`7186 <https://github.com/sunpy/sunpy/pull/7186>`__)
- Added a GONG synoptic map class which fixes non-compliant FITS metadata (`7220 <https://github.com/sunpy/sunpy/pull/7220>`__)
- Added the module `sunpy.coordinates.spice` to enable the use of the `~astropy.coordinates.SkyCoord` API to perform computations using `SPICE <https://naif.jpl.nasa.gov/naif/>`__ kernels. (`#7237 <https://github.com/sunpy/sunpy/pull/7237>`__)
- Added three coordinate frames that depend on the orientation of Earth's magnetic dipole: `~sunpy.coordinates.Geomagnetic` (MAG), `~sunpy.coordinates.SolarMagnetic` (SM), and `~sunpy.coordinates.GeocentricSolarMagnetospheric` (GSM). (`7239 <https://github.com/sunpy/sunpy/pull/7239>`__)


Bug Fixes
---------

- Fix RHESSI (`~sunpy.net.dataretriever.RHESSIClient`) fallback server detection. (`7092 <https://github.com/sunpy/sunpy/pull/7092>`__)
- Fix bug in :func:`~sunpy.coordinates.get_horizons_coord` when specifying a time range via a dictionary that could cause the returned times to be slightly different from the supplied times. (`7106 <https://github.com/sunpy/sunpy/pull/7106>`__)
- Updated the url of the `~sunpy.net.dataretriever.GBMClient` to match on files other than those that end with version 0 (i.e., V0.pha). (`7148 <https://github.com/sunpy/sunpy/pull/7148>`__)
- When directly instantiating a `~astropy.wcs.WCS` from a FITS header that contains both Stonyhurst and Carrington heliographic coordinates for the observer location, the Stonyhurst coordinates will now be prioritized.
This behavior is now consistent with the `~sunpy.map.Map` class, which has always prioritized Stonyhurst coordinates over Carrington coordinates. (`7188 <https://github.com/sunpy/sunpy/pull/7188>`__)
- Fixed a bug with :func:`~sunpy.map.sample_at_coords()` where sampling outside the bounds of the map would sometimes not error and instead return strange pixel values. (`7206 <https://github.com/sunpy/sunpy/pull/7206>`__)
- Improved code when loading CDF files to improve performance and avoid raising of pandas performance warnings. (`7247 <https://github.com/sunpy/sunpy/pull/7247>`__)
- Fixed a bug with :meth:`sunpy.map.GenericMap.plot` where setting ``norm`` to ``None`` would result in an error. (`7261 <https://github.com/sunpy/sunpy/pull/7261>`__)


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

- Removed the specification of a non-identity rotation matrix in two reprojection examples. (`7114 <https://github.com/sunpy/sunpy/pull/7114>`__)
- Added an example (:ref:`sphx_glr_generated_gallery_showcase_stereoscopic_3d.py`) for how to make an anaglyph 3D (i.e., red-cyan) image from a stereoscopic observation. (`7123 <https://github.com/sunpy/sunpy/pull/7123>`__)
- Added an example (:ref:`sphx_glr_generated_gallery_showcase_eclipse_amount.py`) to show how to obtain information about a solar eclipse using :func:`sunpy.coordinates.sun.eclipse_amount`. (`7142 <https://github.com/sunpy/sunpy/pull/7142>`__)
- Changed the :ref:`sphx_glr_generated_gallery_map_masking_hmi.py` to reproject AIA to HMI instead of the other way around.
This is to avoid interpolating the HMI LOS magnetic field data. (`7160 <https://github.com/sunpy/sunpy/pull/7160>`__)
- Fixed the timeseries peak finding example.
Previously there was a bug when plotting the data with pandas. (`7199 <https://github.com/sunpy/sunpy/pull/7199>`__)
- Added an example (:ref:`sphx_glr_generated_gallery_units_and_coordinates_spice.py`) for how to perform `SPICE <https://naif.jpl.nasa.gov/naif/>`__ computations using the `~astropy.coordinates.SkyCoord` API. (`#7237 <https://github.com/sunpy/sunpy/pull/7237>`__)


Deprecations
------------

- Deprecated ``silence_errors`` in Map and Timeseries.
This has been replaced with ``allow_errors`` keyword. (`7021 <https://github.com/sunpy/sunpy/pull/7021>`__)
- The ``sunpy.coordinates.transformations`` module is now slated for removal from the public API as it consists of internal functions used by coordinate transformations.
The context managers :func:`sunpy.coordinates.transform_with_sun_center` and :func:`sunpy.coordinates.propagate_with_solar_surface` should be accessed under `sunpy.coordinates`. (`7113 <https://github.com/sunpy/sunpy/pull/7113>`__)


Removals
--------

- ``sunpy.map.extract_along_coord()`` has been removed.
Instead, use :func:`~sunpy.map.pixelate_coord_path`, and then pass its output to :func:`~sunpy.map.sample_at_coords`.
``pixelate_coord_path`` uses a different line algorithm by default, but you can specify ``bresenham=True`` as an argument to use the same line algorithm as ``extract_along_coord``. (`7200 <https://github.com/sunpy/sunpy/pull/7200>`__)
- ``sunpy.visualisation.limb.draw_limb()`` has been removed.
Use :func:`sunpy.visualization.drawing.limb` instead. (`7202 <https://github.com/sunpy/sunpy/pull/7202>`__)
- Removed ``GenericTimeSeries.index``.
Use ``GenericTimeseries.time`` instead as a direct replacement. (`7203 <https://github.com/sunpy/sunpy/pull/7203>`__)
- Removed the deprecated ``sunpy.io.cdf`` submodule, which is not intended to be user facing. (`7240 <https://github.com/sunpy/sunpy/pull/7240>`__)
- Removed the deprecated ``sunpy.io.jp2``, which is not intended to be user facing. (`7241 <https://github.com/sunpy/sunpy/pull/7241>`__)
- Removed the deprecated ``sunpy.io.file_tools``, which is not intended to be user facing. (`7242 <https://github.com/sunpy/sunpy/pull/7242>`__)
- The deprecated ``sunpy.data.download_sample_data()`` has been removed
Use :func:`sunpy.data.sample.download_all` instead. (`7250 <https://github.com/sunpy/sunpy/pull/7250>`__)

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

- Removed the Binder configuration and link in README.
This is because the configuration was untested, and does not currently work. (`7062 <https://github.com/sunpy/sunpy/pull/7062>`__)
- Add a Dependabot config file to auto-update GitHub action versions. (`7068 <https://github.com/sunpy/sunpy/pull/7068>`__)
- Add tests to check whether various `~sunpy.map.Map` methods preserve laziness when operating on Maps backed by a `dask.array.Array`. (`7100 <https://github.com/sunpy/sunpy/pull/7100>`__)
- Added missing support to find GOES-18 XRS data in `~sunpy.net.dataretriever.XRSClient`. (`7108 <https://github.com/sunpy/sunpy/pull/7108>`__)
- Raise an error with a helpful message when :meth:`sunpy.map.GenericMap.plot` is called with a non-boolean value for the ``annotate`` keyword, because the user is probably trying to specify the axes. (`7163 <https://github.com/sunpy/sunpy/pull/7163>`__)
- Fixed our ASDF manifest having the incorrect ID. (`7282 <https://github.com/sunpy/sunpy/pull/7282>`__)
- Fix example formatting in a few asdf schemas. (`7292 <https://github.com/sunpy/sunpy/pull/7292>`__)
- Pinned the ``drms`` requirement to ``< 0.7`` to avoid breaking changes in ``drms`` version 0.7. (`7308 <https://github.com/sunpy/sunpy/pull/7308>`__)

5.0.0

==================

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

- `~sunpy.net.dataretriever.XRSClient` now provides the re-processed GOES-XRS 8-15 data from NOAA.
These files are now all NetCDF and not FITS files. (`6737 <https://github.com/sunpy/sunpy/pull/6737>`__)
- Changed the output of :func:`sunpy.map.sample_at_coords` to return the sampled values as `~astropy.units.Quantity` with the appropriate units instead of merely numbers. (`6882 <https://github.com/sunpy/sunpy/pull/6882>`__)


Deprecations
------------

- Using ``sunpy.map.header_helper.meta_keywords`` is deprecated.
Please see :ref:`Meta Keywords Table` for the list of metadata keywords used by `~sunpy.map.Map`. (`6743 <https://github.com/sunpy/sunpy/pull/6743>`__)
- The utility function ``sunpy.map.extract_along_coord`` is deprecated.
Use :func:`sunpy.map.pixelate_coord_path`, and then pass its output to :func:`sunpy.map.sample_at_coords`. (`6840 <https://github.com/sunpy/sunpy/pull/6840>`__)
- Parsing SDO/EVE level 0CS average files is deprecated, and will be removed in sunpy 6.0.
Parsing this data is untested, and we cannot find a file to test it with.
If you know where level 0CS 'averages' files can be found, please get in touch at https://community.openastronomy.org/c/sunpy/5. (`#6857 <https://github.com/sunpy/sunpy/pull/6857>`__)
- Fully deprecated ``sunpy.database``, with an expected removal version of sunpy 6.0. (`6869 <https://github.com/sunpy/sunpy/pull/6869>`__)
- ``sunpy.io.cdf``, ``sunpy.io.file_tools`` and ``sunpy.io.jp2`` sub-modules have been deprecated, and will be removed in version 5.1.
This because they are designed for internal use only, and removing it from the public API gives the developers more flexibility to modify it without impacting users. (`6895 <https://github.com/sunpy/sunpy/pull/6895>`__)


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

- A pure Python ``sunpy`` wheel is now published on PyPI with each release.
``pip`` will now default to installing the pure Python wheel instead of the source distribution on platforms other than Linux (x86-64) and macOS (x86-64 and ARM64).
This should mean simpler and faster installs on such platforms, which includes the Raspberry Pi as well as some cloud computing services.

This wheel does not contain the ``sunpy.io.ana`` compiled extension.
If you need this extension (not available on Windows) you can install the ``sunpy`` source distribution with ``pip install --no-binary sunpy "sunpy[all]"``. (`6175 <https://github.com/sunpy/sunpy/pull/6175>`__)
- Added three tutorials which replicate `~sunpy.map.CompositeMap` functionality (:ref:`sphx_glr_generated_gallery_plotting_AIA_HMI_composite.py`, :ref:`sphx_glr_generated_gallery_plotting_masked_composite_plot.py`, :ref:`sphx_glr_generated_gallery_plotting_three_map_composite.py`). (`6459 <https://github.com/sunpy/sunpy/pull/6459>`__)
- `~sunpy.map.GenericMap.exposure_time` now looks for the exposure time in the ``XPOSURE`` key first
and then the ``EXPTIME`` key. (`6557 <https://github.com/sunpy/sunpy/pull/6557>`__)
- `~sunpy.map.header_helper.make_fitswcs_header` now includes the keyword argument ``detector`` for setting the
``DETECTOR`` FITS keyword in the resulting header. (`6558 <https://github.com/sunpy/sunpy/pull/6558>`__)
- Adds two tutorials that demonstrate how to use LASCO data in overlaying maps (:ref:`sphx_glr_generated_gallery_plotting_lasco_overlay.py`) and how to create a custom mask for a LASCO C2 image (:ref:`sphx_glr_generated_gallery_map_lasco_mask.py`). (`6576 <https://github.com/sunpy/sunpy/pull/6576>`__)
- Able to run the ``sunpy`` tests doing ``python -m sunpy.tests.self_test``. (`6600 <https://github.com/sunpy/sunpy/pull/6600>`__)
- Able to detect gzip-compressed FITS files even if they don't have the ``.gz`` extension in the filename.
`~sunpy.io.detect_filetype` now looks for the right file signature while checking
for gzipped FITS files. (`6693 <https://github.com/sunpy/sunpy/pull/6693>`__)
- Added ``AttrAnd`` and ``AttrOr`` to the namespace in ``sunpy.net.attrs``.
This allows users to to avoid ``|`` or ``&`` when creating a query a larger query. (`6708 <https://github.com/sunpy/sunpy/pull/6708>`__)
- `~sunpy.net.dataretriever.SUVIClient` now provides GOES-18 SUVI data. (`6737 <https://github.com/sunpy/sunpy/pull/6737>`__)
- The minimum required versions of several core dependencies have been updated:

- Python 3.9
- astropy 5.0.1
- numpy 1.21.0

The minimum required versions of these optional dependencies has also been updated:

- Matplotlib 3.5.0
- dask 2021.4.0
- pandas 1.2.0
- scikit-image 0.18.0
- scipy 1.7.0 (`6742 <https://github.com/sunpy/sunpy/pull/6742>`__)
- Added the utility function :func:`sunpy.map.pixelate_coord_path` to fully pixelate a coordinate path according to the pixels of a given map. (`6840 <https://github.com/sunpy/sunpy/pull/6840>`__)
- The minimum version of h5netcdf required by sunpy has been bumped to version 0.11.0. (`6859 <https://github.com/sunpy/sunpy/pull/6859>`__)
- Able to download files from REST/TAP Data Providers from the VSO. (`6887 <https://github.com/sunpy/sunpy/pull/6887>`__)
- Adding data unit into html repr for `sunpy.map.Map` (`6902 <https://github.com/sunpy/sunpy/pull/6902>`__)
- Joined ``HISTORY`` keys with newline characters when parsing ``HISTORY`` cards from
FITS header. (`6911 <https://github.com/sunpy/sunpy/pull/6911>`__)
- Added the ability to query for the GOES-XRS 1 minute average data with the `.XRSClient`. (`6925 <https://github.com/sunpy/sunpy/pull/6925>`__)
- Increased minimum version of `parfive` to 2.0.0.

We are aware the change in the ``parfive`` minimum version is a release earlier than our dependency policy allows for.
However, due to significant issues that ``parfive`` v2.0.0 solves and changes to remote servers, we have decided to increase it to improve the user experience when downloading files. (`6942 <https://github.com/sunpy/sunpy/pull/6942>`__)


Bug Fixes
---------

- Fixed the incorrect calculation in :func:`~sunpy.map.header_helper.make_fitswcs_header` of the rotation matrix from a rotation angle when the pixels are non-square. (`6597 <https://github.com/sunpy/sunpy/pull/6597>`__)
- Return code from ``self_test`` is now non-zero if it stops due to missing dependencies. (`6600 <https://github.com/sunpy/sunpy/pull/6600>`__)
- Fixed an issue with loading old EIT fits files with `sunpy.map.Map` where the date could not be parsed. (`6605 <https://github.com/sunpy/sunpy/pull/6605>`__)
- Fixed a bug where the `~sunpy.map.GenericMap.exposure_time` returned ``None`` when the exposure
time key was set to zero. (`6637 <https://github.com/sunpy/sunpy/pull/6637>`__)
- Fixed a bug that prevented specifying a `~astropy.coordinates.BaseCoordinateFrame` (as opposed to a `~astropy.coordinates.SkyCoord`) to :meth:`sunpy.map.GenericMap.draw_quadrangle`. (`6648 <https://github.com/sunpy/sunpy/pull/6648>`__)
- HMI JPEG2000 files from Helioviewer could not be loaded due to a bug in setting the plotting normalization.
This has been fixed. (`6710 <https://github.com/sunpy/sunpy/pull/6710>`__)
- The ``data_manager`` was not raising failed downloads correctly and would continue as if the file existed locally.
Now it will raise any errors from ``parfive``. (`6711 <https://github.com/sunpy/sunpy/pull/6711>`__)
- `~sunpy.map.sources.XRTMap` will now set the unit for XRT files if the ``BUNIT`` key is missing. (`6725 <https://github.com/sunpy/sunpy/pull/6725>`__)
- `~sunpy.net.dataretriever.XRSClient` update use the new url for which the GOES-XRS 8-15 data is provided by NOAA. (`6737 <https://github.com/sunpy/sunpy/pull/6737>`__)
- Updated ``sunpy.database`` to be compatible with ``SQLAlchemy`` versions >=2.0 (`6749 <https://github.com/sunpy/sunpy/pull/6749>`__)
- When using ``autoalign=True`` when plotting maps, the result was misaligned by half a pixel. (`6796 <https://github.com/sunpy/sunpy/pull/6796>`__)
- :meth:`sunpy.map.GenericMap.submap` can now handle a `~astropy.coordinates.BaseCoordinateFrame` as input. (`6820 <https://github.com/sunpy/sunpy/pull/6820>`__)
- Multi-line ``HISTORY`` and ``COMMENT`` keys metadata dictionaries are now correctly split into
multiple history and comment cards when writing a FITS file. (`6911 <https://github.com/sunpy/sunpy/pull/6911>`__)
- Pass in "max_splits" to Parfive to prevent multi connections to JSOC for JSOC only queries. (`6921 <https://github.com/sunpy/sunpy/pull/6921>`__)
- When converting an `astropy.wcs.WCS` object to a solar coordinate frame the
``DATE-AVG`` key will be used before the ``DATE-OBS`` key, previously only
``DATE-OBS`` was checked. (`6995 <https://github.com/sunpy/sunpy/pull/6995>`__)
- `sunpy.map.GenericMap.rotation_matrix` now applies the default values if any FITS rotation matrix keywords are missing from the header. (`7004 <https://github.com/sunpy/sunpy/pull/7004>`__)
- Modified :func:`sunpy.io.special.srs.read_srs` to correctly handle uppercase SRS files and supplementary sections occurring after the main data sections (I, IA, II). (`7035 <https://github.com/sunpy/sunpy/pull/7035>`__)


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

- Added an example of how to search for multiple wavelengths attributes for AIA data using `sunpy.net.attrs.AttrOr`. (`6501 <https://github.com/sunpy/sunpy/pull/6501>`__)
- Added `sunpy.map.PixelPair` to the reference documentation. (`6620 <https://github.com/sunpy/sunpy/pull/6620>`__)
- Split the installation docs into a new Installation tutorial, and an installation guide. (`6639 <https://github.com/sunpy/sunpy/pull/6639>`__)
- Added an example (:ref:`sphx_glr_generated_gallery_time_series_goes_xrs_nrt_data.py`) to download GOES NRT data and load it into `~sunpy.timeseries.TimeSeries`. (`6744 <https://github.com/sunpy/sunpy/pull/6744>`__)
- Added an example gallery (:ref:`sphx_glr_generated_gallery_acquiring_data_querying_and_loading_SHARP_data.py`) for querying SHARP data and loading it into a `~sunpy.map.Map`. (`6757 <https://github.com/sunpy/sunpy/pull/6757>`__)
- Added an example (:ref:`sphx_glr_generated_gallery_units_and_coordinates_ParkerSolarProbe_trajectory.py`) to plot the trajectory of Parker Solar Probe. (`6771 <https://github.com/sunpy/sunpy/pull/6771>`__)
- Created a "Showcase" section of the gallery, which includes a new example (:ref:`sphx_glr_generated_gallery_showcase_where_is_stereo.py`) and a relocated example (:ref:`sphx_glr_generated_gallery_showcase_hmi_cutout.py`). (`6781 <https://github.com/sunpy/sunpy/pull/6781>`__)
- Updated examples in the gallery to always explicitly create an Axes and use that for plotting, instead of using the Matplotlib pyplot API. (`6822 <https://github.com/sunpy/sunpy/pull/6822>`__)
- Added an example (:ref:`sphx_glr_generated_gallery_map_masking_hmi.py`) of how to mask a HMI map based on the intensity of AIA. (`6825 <https://github.com/sunpy/sunpy/pull/6825>`__)
- Added an example (:ref:`sphx_glr_generated_gallery_plotting_mplcairo_plotting.py`) to blend two maps using ``mplcairo``. (`6835 <https://github.com/sunpy/sunpy/pull/6835>`__)
- Changed the reprojecting images to different observers example (:ref:`sphx_glr_generated_gallery_map_transformations_reprojection_different_observers.py`) to avoid using custom wcs headers where possible. (`6853 <https://github.com/sunpy/sunpy/pull/6853>`__)
- Added a note in examples :ref:`sphx_glr_generated_gallery_map_transformations_autoalign_aia_hmi.py` and :ref:`sphx_glr_generated_gallery_map_transformations_reprojection_align_aia_hmi.py` suggesting to use :meth:`~sunpy.coordinates.Helioprojective.assume_spherical_screen` to retain off-disk HMI data. (`6855 <https://github.com/sunpy/sunpy/pull/6855>`__)
- Moved the Helioviewer migration guide from the tutorial to guide section of the docs. (`6868 <https://github.com/sunpy/sunpy/pull/6868>`__)
- Moved the plotting section of the tutorial into the map section of the tutorial. (`6870 <https://github.com/sunpy/sunpy/pull/6870>`__)
- Reorganized "Units" section of the Tutorial into smaller sections and added a section about
unit equivalencies. (`6879 <https://github.com/sunpy/sunpy/pull/6879>`__)
- Added clarifying detail (in the `~sunpy.time.TimeUTime` docstring) for how the ``utime`` time format handles seconds on a day with a leap second. (`6894 <https://github.com/sunpy/sunpy/pull/6894>`__)
- Fixed a series of broken URLS and typos in examples and documentation strings. (`6903 <https://github.com/sunpy/sunpy/pull/6903>`__)
- Improved the time tutorial. (`6920 <https://github.com/sunpy/sunpy/pull/6920>`__)
- Add a "how-to" guide section to the documentation. (`6926 <https://github.com/sunpy/sunpy/pull/6926>`__)
- Redesigned the landing page to highlight the different sections of the documentation. (`6938 <https://github.com/sunpy/sunpy/pull/6938>`__)
- Significantly revised and improved the :ref:`sunpy-tutorial-maps` part of the tutorial.
This included moving the section on custom maps to the :ref:`sunpy-how-to-index` section (see :ref:`sunpy-how-to-create-a-map`). (`6944 <https://github.com/sunpy/sunpy/pull/6944>`__)
- Migrated example gallery entries for searching the VSO, using ``parse_time``, using the data manager, and using solar constants to the how-to guide. (`6948 <https://github.com/sunpy/sunpy/pull/6948>`__)
- Reorganized some parts of the coordinates topic guide into multiple how-to guides. (`6954 <https://github.com/sunpy/sunpy/pull/6954>`__)
- Move examples of how to create a Map from reference pages to a how-to guide. (`6977 <https://github.com/sunpy/sunpy/pull/6977>`__)
- Cleaned up and simplified the :ref:`sunpy-tutorial-timeseries` section of the tutorial. (`6990 <https://github.com/sunpy/sunpy/pull/6990>`__)
- Added a topic-guide to aid understanding the role, "rsun" plays in sunpy coordinate transformations and :meth:`sunpy.map.GenericMap.reproject_to`. (`7000 <https://github.com/sunpy/sunpy/pull/7000>`__)
- Updated all of the sphinx anchors to be more consistent.
This means that any use of the old anchors (intersphinx links to sunpy doc pages) will need to be updated. (`7032 <https://github.com/sunpy/sunpy/pull/7032>`__)


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

- When determining which VSO servers to use for queries, `.VSOClient` will now
attempt to check if the cgi endpoint referenced by the WDSL file is accessible,
and try the next endpoint if it can't be reached. This should mean that a small
category of connection issues with the VSO are now automatically bypassed. (`6362 <https://github.com/sunpy/sunpy/pull/6362>`__)

4.1.0

==================

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

- Updated the sample data file, ``AIA_171_ROLL_IMAGE`` to be rice compressed instead of gzip compressed.
This means that the data is now stored in the second HDU. (`6221 <https://github.com/sunpy/sunpy/pull/6221>`__)


Deprecations
------------

- Passing positional arguments to all ``timeseries`` ``peek()`` methods
is now deprecated, and will raise an error in sunpy 5.1. Pass the arguments
with keywords (e.g. ``title='my plot title'``) instead. (`6310 <https://github.com/sunpy/sunpy/pull/6310>`__)
- Using ``sunpy.timeseries.GenericTimeSeries.index is deprecated.
Use `~sunpy.timeseries.GenericTimeSeries.time` to get an astropy Time object,
or ``ts.to_dataframe().index`` to get the times as a pandas ``DataTimeIndex``. (`6327 <https://github.com/sunpy/sunpy/pull/6327>`__)
- Deprecated the ``sunpy.visualization.limb`` module.
The ``sunpy.visualization.limb.draw_limb`` function has been moved into
`~sunpy.visualization.drawing` as :func:`~sunpy.visualization.drawing.limb`. (`6332 <https://github.com/sunpy/sunpy/pull/6332>`__)
- The ``sunpy.net.helioviewer`` module is deprecated and will be removed in version 5.1.
The Helioviewer Project now maintains a replacement Python library called `hvpy <https://hvpy.readthedocs.io/en/latest/>`__.
As such, in consultation with the Helioviewer Project, we have decided to deprecate the ``HelioviewerClient`` class. (`6404 <https://github.com/sunpy/sunpy/pull/6404>`__)
- Passing the ``algorithm``, ``return_footprint`` arguments as positional arguments is deprecated. Pass them as keyword arguments (e.g. ``..., return_footprint=True, ...``) instead. (`6406 <https://github.com/sunpy/sunpy/pull/6406>`__)
- ``sunpy.data.download_sample_data()`` is now deprecated.
Use :func:`sunpy.data.sample.download_all` instead. (`6426 <https://github.com/sunpy/sunpy/pull/6426>`__)
- The sunpy.database module is no longer actively maintained and has a number of outstanding issues.
It is anticiapted that sunpy.database will be formally deprecated in sunpy 5.0 and removed in sunpy 6.0.
If you are using sunpy.database and would like to see a replacement, please join the discussion thread at https://community.openastronomy.org/t/deprecating-sunpy-database/495. (`#6498 <https://github.com/sunpy/sunpy/pull/6498>`__)


Removals
--------

- The ``sunpy.io.fits`` sub-module has been removed, as it was designed for internal use.
Use the `astropy.io.fits` module instead for more generic functionality to read FITS files. (`6432 <https://github.com/sunpy/sunpy/pull/6432>`__)
- The ``sunpy.physics.solar_rotation`` sub-module has been removed, having been moved to `sunkit_image.coalignment`. (`6433 <https://github.com/sunpy/sunpy/pull/6433>`__)
- Most of the `sunpy.visualization.animator` subpackage has been removed, with the exception of `~sunpy.visualization.animator.MapSequenceAnimator`
It has been moved into the standalone `mpl-animators <https://pypi.org/project/mpl-animators>`_ package
Please update your imports to replace ``sunpy.visualization.animator`` with ``mpl_animators``. (`6434 <https://github.com/sunpy/sunpy/pull/6434>`__)
- Remove ``GenericMap.shift`` method and the ``GenericMap.shifted_value``.
Use `~sunpy.map.GenericMap.shift_reference_coord` instead. (`6437 <https://github.com/sunpy/sunpy/pull/6437>`__)
- ``sunpy.util.scraper`` has been removed. Use `sunpy.net.scraper` instead. (`6438 <https://github.com/sunpy/sunpy/pull/6438>`__)
- ``sunpy.image.coalignment`` has been removed. Use `sunkit_image.coalignment` instead, which contains all the same functionality. (`6440 <https://github.com/sunpy/sunpy/pull/6440>`__)
- :meth:`sunpy.map.GenericMap.draw_limb` can no longer be used to draw the limb on a non-WCS Axes plot. (`6533 <https://github.com/sunpy/sunpy/pull/6533>`__)
- :meth:`sunpy.image.resample` no longer accepts "neighbour" as an interpolation method.
Use "nearest" instead. (`6537 <https://github.com/sunpy/sunpy/pull/6537>`__)
- :meth:`sunpy.image.transform.affine_transform` and :func:`sunpy.map.GenericMap.rotate` no longer accepts the ``use_scipy`` keyword. (`6538 <https://github.com/sunpy/sunpy/pull/6538>`__)


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

- Updated and expanded the HTML representation for `~sunpy.timeseries.TimeSeries`. (`5951 <https://github.com/sunpy/sunpy/pull/5951>`__)
- When reading CDF files, any columns with a floating point data type now have their masked values converted to NaN. (`5956 <https://github.com/sunpy/sunpy/pull/5956>`__)
- Add support for saving `~sunpy.map.GenericMap` as JPEG 2000 files. (`6153 <https://github.com/sunpy/sunpy/pull/6153>`__)
- Add a function ``sunpy.map.extract_along_coord`` that, for a given set of coordinates,
finds each array index that crosses the line traced by those coordinates and returns the value of the data
array of a given map at those array indices. (`6189 <https://github.com/sunpy/sunpy/pull/6189>`__)
- Three new maps have been added to the sample data from STEREO A and STEREO B at
195 Angstrom, and AIA at 193 Angstrom. These images are from a time when
the three spacecraft were equally spaced around the Sun, and therefore form
near complete instantaneous coverage of the solar surface.

Users upgrading to this version will find this three files download when they
use the sample data for the first time. (`6197 <https://github.com/sunpy/sunpy/pull/6197>`__)
- Added a SDO/AIA 1600 file of the Venus transit to the sunpy sample data. (`6242 <https://github.com/sunpy/sunpy/pull/6242>`__)
- Created the `sunpy.visualization.drawing` module which includes
new :func:`~sunpy.visualization.drawing.equator` and
:func:`~sunpy.visualization.drawing.prime_meridian` functions. (`6251 <https://github.com/sunpy/sunpy/pull/6251>`__)
- Expose GOES quality flags in order to allow filtering corrupt values when using the `~sunpy.timeseries.sources.goes.XRSTimeSeries`. (`6260 <https://github.com/sunpy/sunpy/pull/6260>`__)
- All TimeSeries plotting methods now consistently set the same
formatter and locator for the x-axis. (`6264 <https://github.com/sunpy/sunpy/pull/6264>`__)
- :meth:`sunpy.timeseries.GenericTimeSeries.peek` now takes a ``title`` argument
to set the title of the plot. (`6304 <https://github.com/sunpy/sunpy/pull/6304>`__)
- Added the `sunpy.timeseries.GenericTimeSeries.time` property to get the times
of a timeseries as a `~astropy.time.Time` object. (`6327 <https://github.com/sunpy/sunpy/pull/6327>`__)
- Added the :ref:`sphx_glr_generated_gallery_plotting_plot_equator_prime_meridian.py` example to the Example Gallery. (`6332 <https://github.com/sunpy/sunpy/pull/6332>`__)
- Added a new function :func:`sunpy.map.header_helper.make_heliographic_header` to help with generating FITS-WCS headers in Carrington or Stonyhurst coordinate systems that span the entire solar surface. (`6415 <https://github.com/sunpy/sunpy/pull/6415>`__)
- Sample data files provided through `sunpy.data.sample` are now downloaded individually on demand rather than being all downloaded upon import of that module.
To download all sample data files, call :func:`sunpy.data.sample.download_all`. (`6426 <https://github.com/sunpy/sunpy/pull/6426>`__)
- `~.XRSTimeSeries` is now able to parse the primary detector information from the GOES-R XRS data if available. (`6454 <https://github.com/sunpy/sunpy/pull/6454>`__)
- `sunpy.net.Scraper` now includes treats files as spanning a full interval equal to the smallest increment specified in the file pattern.
For example, a pattern like ``"%Y.txt"`` that only contains a year specifier will be considered to span that full year.

This means searches that fall entirely within the whole interval spanned by a pattern will return that file, where previously they did not.
As an example, matching ``"%Y.txt"`` with ``TimeRange('2022-02-01', '2022-04-01')`` will now return ``["2022.txt"]`` where previously no files were returned. (`6472 <https://github.com/sunpy/sunpy/pull/6472>`__)
- Implemented site configuration for sunpyrc, and modified documentation for sunpy customization. (`6478 <https://github.com/sunpy/sunpy/pull/6478>`__)
- :func:`~sunpy.map.header_helper.make_fitswcs_header` now includes the keyword argument ``unit`` for setting the
``BUNIT`` FITS keyword in the resulting header.
This will take precedence over any unit information attached to ``data``. (`6499 <https://github.com/sunpy/sunpy/pull/6499>`__)
- If the ``data`` argument to :func:`~sunpy.map.header_helper.make_fitswcs_header` is an `~astropy.units.Quantity`,
the associated unit will be used to set the ``BUNIT`` FITS keyword in the resulting header. (`6499 <https://github.com/sunpy/sunpy/pull/6499>`__)
- Added a 304 sample data file called ``AIA_304_IMAGE``. (`6546 <https://github.com/sunpy/sunpy/pull/6546>`__)


Bug Fixes
---------

- Fix a bug that prevented EUI maps with missing wavelength metadata loading. (`6199 <https://github.com/sunpy/sunpy/pull/6199>`__)
- The `sunpy.net.dataretriever.sources.noaa.SRSClient` was not correctly setting the passive mode for FTP connection resulting in a permission error.
This has been fixed. (`6256 <https://github.com/sunpy/sunpy/pull/6256>`__)
- Fixed `~sunpy.timeseries.sources.XRSTimeSeries` inability to read leap-second files for GOES.
It floors the leap-second timestamp to be ``59.999``, so that Python datetime does not raise an exception. (`6262 <https://github.com/sunpy/sunpy/pull/6262>`__)
- Changed the default scaling for `~sunpy.map.sources.EUIMap` from a linear stretch to a asinh stretch.

To revert to the previous linear stretch do the following::

from astropy.visualization import ImageNormalize, LinearStretch
euimap.plot_settings["norm"] = ImageNormalize(stretch=LinearStretch()) (`6285 <https://github.com/sunpy/sunpy/pull/6285>`__)
- Fixed bugs when working with a coordinate frame where the observer is specified in `~sunpy.coordinates.frames.HeliographicStonyhurst` with a Cartesian representation, which is equivalent to Heliocentric Earth Equatorial (HEEQ).
Now, the observer will always be converted to spherical representation when the coordinate frame is created. (`6311 <https://github.com/sunpy/sunpy/pull/6311>`__)
- Fixed an error when Fido returns zero results from the VSO
and some results from at least one other data source. This
(now fixed) error is only present when using numpy version >= 1.23. (`6318 <https://github.com/sunpy/sunpy/pull/6318>`__)
- If a level 1 XRT file does not specify the heliographic longitude of the spacecraft,
a silent assumption is made that the spacecraft is at zero Stonyhurst
heliographic longitude (i.e., the same longitude as Earth). (`6333 <https://github.com/sunpy/sunpy/pull/6333>`__)
- The sample data retry was failing under parfive 2.0.0. (`6334 <https://github.com/sunpy/sunpy/pull/6334>`__)
- Fixed bug that prevented `~sunpy.coordinates.metaframes.RotatedSunFrame` instances from being pickled. (`6342 <https://github.com/sunpy/sunpy/pull/6342>`__)
- Fix a bug in loading `.XRSTimeSeries` due to unsupported quality flag column names. (`6410 <https://github.com/sunpy/sunpy/pull/6410>`__)
- Adds units (dimensionless units) to the quality columns in `.XRSTimeSeries`. (`6423 <https://github.com/sunpy/sunpy/pull/6423>`__)
- Refactored `~sunpy.map.sources.SXTMap` to use ITRS observer coordinate information
in header rather than incorrect HGS keywords.
The `~sunpy.map.sources.SXTMap` also now uses the default ``dsun`` property as this
information can be derived from the (now corrected) observer coordinate. (`6436 <https://github.com/sunpy/sunpy/pull/6436>`__)
- In `sunpy.map.GenericMap.coordinate_system` and `sunpy.map.GenericMap.date`, the default values
will now be used if the expected key(s) used to derive those properties are empty.
Previously, empty values of these keys were not treated as missing and thus the default values
were not correctly filled in. (`6436 <https://github.com/sunpy/sunpy/pull/6436>`__)
- Fixed a bug where the observer coordinate was incorrectly determined for `~sunpy.map.sources.KCorMap`. (`6447 <https://github.com/sunpy/sunpy/pull/6447>`__)
- Trying to download an empty search response from the JSOC now results in an empty results object.
Previously the results object contained the path to the sunpy download directory. (`6449 <https://github.com/sunpy/sunpy/pull/6449>`__)
- Removed an error when searching CDAWEB using `sunpy.net.Fido` and no results are returned.
An empty response table is now returned. (`6450 <https://github.com/sunpy/sunpy/pull/6450>`__)
- Fix a bug to parse the GOES "observatory" number in `~.XRSTimeSeries` for GOES 13, 14, 15 and for the 1 minute GOES-R data. (`6451 <https://github.com/sunpy/sunpy/pull/6451>`__)
- Changed the default scaling for `~sunpy.map.sources.XRTMap` from a linear stretch to `~astropy.visualization.LogStretch`.

To revert to the previous linear stretch do the following::

from astropy.visualization import ImageNormalize, LinearStretch
xrtmap.plot_settings["norm"] = ImageNormalize(stretch=LinearStretch()) (`6480 <https://github.com/sunpy/sunpy/pull/6480>`__)
- Fix the ``detector`` property of `~sunpy.map.sources.SOTMap` to return "SOT". (`6480 <https://github.com/sunpy/sunpy/pull/6480>`__)
- The right-hand y-axis of the GOES-XRS timeseries plots with labelled flare classes
now automatically scales with the left-hand y-axis. (`6486 <https://github.com/sunpy/sunpy/pull/6486>`__)
- Add support for Python 3.11.

The deprecated `cgi.parse_header` is now available as
`sunpy.util.net.parse_header`. (`6512 <https://github.com/sunpy/sunpy/pull/6512>`__)
- Fixed the metadata handling of :meth:`~sunpy.map.GenericMap.resample` and :meth:`~sunpy.map.GenericMap.superpixel` so that the CDELTi values are scaled and the PCi_j matrix (if used) is modified in the correct manner for asymmetric scaling.
The previous approach of having the PCi_j matrix store all of the scaling resulted in non-intuitive behaviors when accessing the `~sunpy.map.GenericMap.scale` and `~sunpy.map.GenericMap.rotation_matrix` properties, and when de-rotating a map via :meth:`~sunpy.map.GenericMap.rotate`. (`6571 <https://github.com/sunpy/sunpy/pull/6571>`__)
- Fixd a bug with the `sunpy.map.GenericMap.scale` property for maps containing only the CDij matrix where the scale was not being determined from the CDij matrix. (`6573 <https://github.com/sunpy/sunpy/pull/6573>`__)
- Fixed a bug with the `sunpy.map.GenericMap.rotation_matrix` property for maps using the CDij matrix formulism where the rotation matrix would be calculated incorrectly for non-square pixels. (`6573 <https://github.com/sunpy/sunpy/pull/6573>`__)
- Fixed a bug where :func:`~sunpy.time.parse_time` would always disregard the remainder of a time string starting with the final period if it was followed by only zeros, which could affect the parsing of the time string. (`6581 <https://github.com/sunpy/sunpy/pull/6581>`__)


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

- Improved annotations in the SRS active regions plotting example. (`6196 <https://github.com/sunpy/sunpy/pull/6196>`__)
- Updated gallery examples that use STEREO data to use sample data instead
of searching for and downloading data via Fido. (`6197 <https://github.com/sunpy/sunpy/pull/6197>`__)
- Added the current bugfix release policy to the docs. (`6336 <https://github.com/sunpy/sunpy/pull/6336>`__)
- The :ref:`sunpy-tutorial-maps` and :ref:`sunpy-tutorial-timeseries` have been reviewed and updated. (`6345 <https://github.com/sunpy/sunpy/pull/6345>`__)
- Adds a pull request check list to the Developer's Guide. (`6346 <https://github.com/sunpy/sunpy/pull/6346>`__)
- Improved the plotting guide. (`6430 <https://github.com/sunpy/sunpy/pull/6430>`__)
- Slight improvements to the downloading data with Fido part of the guide. (`6444 <https://github.com/sunpy/sunpy/pull/6444>`__)
- Split the units and coordinate guides on to separate pages, and made minor improvements to them. (`6462 <https://github.com/sunpy/sunpy/pull/6462>`__)
- Added a how-to guide ``conda_for_dependencies`` for using ``conda`` to set up an environment with the complete set of dependencies to use all optional features, build the documentation, and/or run the full test suite.
The guide also describes how best to have an editable installation of ``sunpy`` in this environment. (`6524 <https://github.com/sunpy/sunpy/pull/6524>`__)


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

- Added a ``columns`` keyword to each plot method for all `sunpy.timeseries.GenericTimeSeries` sources. (`6056 <https://github.com/sunpy/sunpy/pull/6056>`__)
- Added a script in the ``sunpy/tools`` that will update all the Python libraries in ``sunpy/extern``. (`6127 <https://github.com/sunpy/sunpy/pull/6127>`__)
- Added automatic conversion of unit strings in CDF files to astropy unit objects for the following instruments: PSP/ISOIS, SOHO/CELIAS, SOHO/COSTEP-EPHIN, and SOHO/ERNE. (`6159 <https://github.com/sunpy/sunpy/pull/6159>`__)
- Add an environment variable ``SUNPY_NO_BUILD_ANA_EXTENSION`` which when present
will cause sunpy to not compile the ANA C extension when building from source. (`6166 <https://github.com/sunpy/sunpy/pull/6166>`__)
- ``sunpy`` now uses the `Limited Python API <https://docs.python.org/3/c-api/stable.html>`__.
Therefore, one binary distribution (wheel) per platform is now published and it is compatible with all Python versions ``sunpy`` supports. (`6171 <https://github.com/sunpy/sunpy/pull/6171>`__)
- Add support for upcoming parfive 2.0 release. (`6243 <https://github.com/sunpy/sunpy/pull/6243>`__)
- The primary sample-data URL will be changing from ``https://github.com/sunpy/sample-data/raw/master/sunpy/v1/`` to ``https://github.com/sunpy/data/raw/main/sunpy/v1/``.
We expect GitHub to redirect from the old URL for sometime but will eventually expire it.
The ``data.sunpy.org`` mirror will continue to be available. (`6289 <https://github.com/sunpy/sunpy/pull/6289>`__)
- Add support for downloading sample data from more than two mirror locations. (`6295 <https://github.com/sunpy/sunpy/pull/6295>`__)
- Timeseries data sources can now set the ``_peek_title`` class attribute
to set the default plot title produced when ``.peek()`` is called and the user
does not provide a custom title. (`6304 <https://github.com/sunpy/sunpy/pull/6304>`__)
- All internal code for limb drawing now uses :func:`~sunpy.visualization.drawing.limb`. (`6332 <https://github.com/sunpy/sunpy/pull/6332>`__)
- Add maintainer documentation on the backport bot (`6355 <https://github.com/sunpy/sunpy/pull/6355>`__)
- Switched to using the standard matrix-multiplication operator (available in Python 3.5+) instead of a custom function. (`6376 <https://github.com/sunpy/sunpy/pull/6376>`__)
- Fixed a colormap deprecation warning when importing the sunpy colormaps
with Matplotlib 3.6. (`6379 <https://github.com/sunpy/sunpy/pull/6379>`__)
- Removed custom tick label rotation from Lyra, EVE, and Norh timeseries sources, and grid drawing from NOAA and RHESSI sources. (`6385 <https://github.com/sunpy/sunpy/pull/6385>`__)
- Added tests and test data for `~sunpy.map.sources.SXTMap` (`6436 <https://github.com/sunpy/sunpy/pull/6436>`__)
- Fixed a bug where the private attribute ``_default_observer_coordinate`` for `~sunpy.map.GenericMap` was being used even when there was sufficient observer metadata in the header. (`6447 <https://github.com/sunpy/sunpy/pull/6447>`__)
- Tidy the GOES XRSTimesSeries tests and add two new XRS files to test. (`6460 <https://github.com/sunpy/sunpy/pull/6460>`__)
- Added a pre-commit hook for `codespell
<https://github.com/codespell-project/codespell>`__, and applied
spelling fixes throughout the package. (`6574 <https://github.com/sunpy/sunpy/pull/6574>`__)

4.0.0

===================

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

- When rotating images using the SciPy rotation method, the default behavior is now to clip the output range to the input range, which matches the default behavior of the scikit-image rotation method. (`5867 <https://github.com/sunpy/sunpy/pull/5867>`__)
- Any NaNs are now preserved by :func:`sunpy.image.transform.affine_transform` and :meth:`sunpy.map.GenericMap.rotate`. (`5867 <https://github.com/sunpy/sunpy/pull/5867>`__)
- :func:`sunpy.image.transform.affine_transform` and :meth:`sunpy.map.GenericMap.rotate` now default to using SciPy for rotation instead of scikit-image, so rotation results may be slightly different. (`5867 <https://github.com/sunpy/sunpy/pull/5867>`__)
- The math convenience methods of `sunpy.map.GenericMap` - :meth:`~sunpy.map.GenericMap.max`, :meth:`~sunpy.map.GenericMap.mean`, :meth:`~sunpy.map.GenericMap.min`, and , :meth:`~sunpy.map.GenericMap.std` - now ignore NaNs in the image data. (`5867 <https://github.com/sunpy/sunpy/pull/5867>`__)
- :func:`sunpy.image.transform.affine_transform` and :meth:`sunpy.map.GenericMap.rotate` now default to using NaN instead of zero for the ``missing`` value, the value used for pixels in the output array that have no corresponding pixel in the input array.
To obtain the previous behavior, ``missing`` should be explicitly specified as zero. (`5867 <https://github.com/sunpy/sunpy/pull/5867>`__)
- The `.JSOCClient` and every `sunpy.net.dataretriever.GenericClient` was passing all ``**kwargs`` to `parfive.Downloader.enqueue_file`, this was unintended and has been removed. (`6052 <https://github.com/sunpy/sunpy/pull/6052>`__)
- Changed the default interpolation order for :meth:`sunpy.map.GenericMap.rotate` from 4 to 3, with the precise meaning of these interpolation orders depending on the selected rotation method.
For the default rotation method, which uses :func:`scipy.ndimage.affine_transform`, this changes the default interpolation from biquartic to bicubic, which reduces the computation time without reducing the quality of the output below what a typical user needs. (`6089 <https://github.com/sunpy/sunpy/pull/6089>`__)


Deprecations
------------

- Deprecate ``sunpy.image.coalignment`` as the code has now been moved to
`sunkit_image.coalignment` with an identical API.
This module will be removed in sunpy 4.1. (`5957 <https://github.com/sunpy/sunpy/pull/5957>`__)
- The ``sunpy.map.GenericMap.shift`` method has been renamed to
`sunpy.map.GenericMap.shift_reference_coord` and
``shift`` has been deprecated. (`5977 <https://github.com/sunpy/sunpy/pull/5977>`__)
- The ``sunpy.map.GenericMap.shifted_value`` property has been deprecated.
Modifications to the reference coordinate can be found in the
``CRVAL1`` and ``CRVAL2`` keys of ``sunpy.map.GenericMap.meta.modified_items``. (`5977 <https://github.com/sunpy/sunpy/pull/5977>`__)
- The ``sunpy.io.fits`` module is deprecated, as it was designed for internal use
only. Use the `astropy.io.fits` module instead for more generic functionality
to read FITS files. (`5983 <https://github.com/sunpy/sunpy/pull/5983>`__)
- ``sunpy.physics.solar_rotation.mapsequence_solar_derotate`` is deprecated and will be removed in version 4.1.
This function has been moved to ``sunkit_image.coalignment.mapsequence_coalign_by_rotation`` and has an identical API and functionality. (`6031 <https://github.com/sunpy/sunpy/pull/6031>`__)
- ``sunpy.physics.solar_rotation.calculate_solar_rotate_shift`` is deprecated and will be removed in version 4.1.
This function has been moved to ``sunkit_image.coalignment.calculate_solar_rotate_shift`` and has an identical API and functionality. (`6031 <https://github.com/sunpy/sunpy/pull/6031>`__)
- Deprecated using `sunpy.map.GenericMap.draw_limb` on an Axes that is not a
WCSAxes. (`6079 <https://github.com/sunpy/sunpy/pull/6079>`__)


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

- Added support for Python 3.10 (`5568 <https://github.com/sunpy/sunpy/pull/5568>`__)
- Added support for ``"%Y.%m.%d_%H:%M:%S_UTC"`` and ``"%Y.%m.%d_%H:%M:%S"`` time formats in `sunpy.time.parse_time`. (`5647 <https://github.com/sunpy/sunpy/pull/5647>`__)
- The ``rsun`` argument to :func:`~sunpy.map.header_helper.get_observer_meta` is now
optional. (`5655 <https://github.com/sunpy/sunpy/pull/5655>`__)
- Added the :meth:`~sunpy.net.base_client.QueryResponseTable.total_size`, which
estimates the total size of the results from a Fido query. If this is supported
by a client, the total size is printed alongside the results.

To add support for this in external clients, make sure one column contains
the individual filesizes as `~astropy.units.Quantity`, and set the
``size_column`` class attribute to the name of this column. (`5659 <https://github.com/sunpy/sunpy/pull/5659>`__)
- Added the ability to specify the use of Carrington coordinates with
:meth:`sunpy.map.GenericMap.draw_grid`. (`5703 <https://github.com/sunpy/sunpy/pull/5703>`__)
- Printing a `.MetaDict` will now show each entry on a new line. (`5765 <https://github.com/sunpy/sunpy/pull/5765>`__)
- Removed support for Python 3.7. (`5773 <https://github.com/sunpy/sunpy/pull/5773>`__)
- The 'event_endtime', 'event_starttime' and 'event_peaktime' columns in a HEK
query are now returned as `~astropy.time.Time` objects. Previously they were
timestamp strings. (`5806 <https://github.com/sunpy/sunpy/pull/5806>`__)
- Added a helpful warning message when converting a 2D Helioprojective coordinate will return all NaNs. (`5817 <https://github.com/sunpy/sunpy/pull/5817>`__)
- The colorbar limits on HMI magnetic field maps are now automatically
set to be symmetric about zero. (`5825 <https://github.com/sunpy/sunpy/pull/5825>`__)
- Added a ``clip`` keyword to :func:`sunpy.image.transform.affine_transform` and :meth:`sunpy.map.GenericMap.rotate` to enable or disable whether the range of the output image is clipped to the range of the input range. (`5867 <https://github.com/sunpy/sunpy/pull/5867>`__)
- Created the decorator :func:`sunpy.image.transform.add_rotation_function` for registering new rotation functions for use by :func:`sunpy.image.transform.affine_transform` and :meth:`sunpy.map.GenericMap.rotate`. (`5867 <https://github.com/sunpy/sunpy/pull/5867>`__)
- `sunpy.image.transform.affine_transform` and :meth:`sunpy.map.GenericMap.rotate`
have both had their ``use_scipy`` arguments deprecated. Instead use the new
``method`` argument to select from the available rotation methods. (`5916 <https://github.com/sunpy/sunpy/pull/5916>`__)
- Added a Maxwell unit and any places where a conversion to Gauss occurs has been removed. (`5998 <https://github.com/sunpy/sunpy/pull/5998>`__)
- Add a basic HTML representation for `~sunpy.timeseries.TimeSeries`. (`6032 <https://github.com/sunpy/sunpy/pull/6032>`__)
- The minimum supported asdf version has been increased to 2.8.0 to allow future
compatibility with the breaking changes planned for asdf 3.0.
In addition to this the `asdf-astropy <https://github.com/astropy/asdf-astropy>`__
package is now required to serialise and deserialise the sunpy coordinate frame
classes to ASDF. (`6057 <https://github.com/sunpy/sunpy/pull/6057>`__)
- Added the option to rotate using `OpenCV <https://opencv.org>`__ when using :func:`sunpy.image.transform.affine_transform` or :meth:`sunpy.map.GenericMap.rotate` by specifying ``method='cv2'``.
The OpenCV Python package must be installed on the system. (`6089 <https://github.com/sunpy/sunpy/pull/6089>`__)


Bug Fixes
---------

- Fixed reading CDF files when a column has no entries. If this is the case the
column will be ignored, and a message logged at DEBUG level. (`5664 <https://github.com/sunpy/sunpy/pull/5664>`__)
- Fixed the units of `sunpy.map.sources.HMISynopticMap.scale` and
`sunpy.map.sources.MDISynopticMap.scale`. (`5682 <https://github.com/sunpy/sunpy/pull/5682>`__)
- Fixed a bug where custom values in the ``plot_settings`` dictionary were not being propagated
to new map instances created when calling map methods (e.g. ``.submap``). (`5687 <https://github.com/sunpy/sunpy/pull/5687>`__)
- Added automatic conversion of some common but non-standard unit strings in CDF
files to astropy unit objects. If sunpy does not recognise the unit string for
a particular column, units of ``u.dimensionless_unscaled`` are applied to that
column and a warning raised.

If you think a given unit should not be dimensionless and support should be
added for it in sunpy, please raise an issue at
https://github.com/sunpy/sunpy/issues. (`#5692 <https://github.com/sunpy/sunpy/pull/5692>`__)
- The default ``id_type`` in :func:`sunpy.coordinates.get_horizons_coord` is now
`None` to match the default ``id_type`` in astroquery 0.4.4, which will search
major bodies first, and if no major bodies are found, then search small bodies.
For older versions of astroquery the default ``id_type`` used by
:func:`~sunpy.coordinates.get_horizons_coord` is still ``'majorbody'``. (`5707 <https://github.com/sunpy/sunpy/pull/5707>`__)
- In consultation with JSOC, we now limit all JSOC downloads to one connection.
This will override all connection user settings passed to the downloader. (`5714 <https://github.com/sunpy/sunpy/pull/5714>`__)
- Updated the ``plot`` methods on some timeseries classes to correctly label and format the time axis. (`5720 <https://github.com/sunpy/sunpy/pull/5720>`__)
- Fixed a long-standing bug where our logger could intercept Astropy warnings in addition to SunPy warnings, and thus could conflict with Astropy's logger. (`5722 <https://github.com/sunpy/sunpy/pull/5722>`__)
- Update asdf schemas so that references use URIs not tags as this is not
supported by the new asdf extensions API. (`5723 <https://github.com/sunpy/sunpy/pull/5723>`__)
- Increased the default maximum amount of records returned from HEC to 500 from 10.
If the maximum number of records are returned, a message is shown. (`5738 <https://github.com/sunpy/sunpy/pull/5738>`__)
- Reading a series of CDF files where at least one of them is empty no longer
raises an error. A message for each empty file is logged at the DEBUG level. (`5751 <https://github.com/sunpy/sunpy/pull/5751>`__)
- :func:`sunpy.map.header_helper.make_fitswcs_header` now includes a PC_ij matrix in the returned
header if no rotation is specified. (`5763 <https://github.com/sunpy/sunpy/pull/5763>`__)
- In the case where a map header has no PC_ij values, CROTA2 != 0, and
CDELT1 != CDELT2, the calculation of the map rotation matrix has been fixed.
This bug only affected maps with non-zero rotation, no PC matrix in the header,
and un-equal scales along the two image axes. (`5766 <https://github.com/sunpy/sunpy/pull/5766>`__)
- Maps created from :meth:`~sunpy.map.GenericMap.resample` and
:meth:`~sunpy.map.GenericMap.superpixel` have been fixed in the case where
the resampling was not square, and the PCi_j matrix (often a rotation matrix)
was not a multiple of the identity matrix. When the PCi_j or CDi_j formalisms
are used in the metadata these are now correctly modified, and the CDELT values
are left unchanged. (`5786 <https://github.com/sunpy/sunpy/pull/5786>`__)
- The ``__repr__`` of several ``sunpy.database`` classes have been updated to remove angular
brackets and add equals signs. As an example, ``'<DatabaseEntry(id 3)>'`` has changed to
``'DatabaseEntry(id=3)'`` (`5790 <https://github.com/sunpy/sunpy/pull/5790>`__)
- Fixed a bug when rotating a map by a matrix that is not purely a rotation.
The likely way to inadvertently encounter this bug was when de-rotating a map with rectangular pixels that were not aligned with the coordinate axes. (`5803 <https://github.com/sunpy/sunpy/pull/5803>`__)
- Fixed a bug where rotating a map while simultaneously scaling it could result in some of the map data being cropped out. (`5803 <https://github.com/sunpy/sunpy/pull/5803>`__)
- Symmetric colorbar limits are no longer set on intensity images from MDI. (`5825 <https://github.com/sunpy/sunpy/pull/5825>`__)
- Fixed plotting and peeking NORH timeseries data with ``pandas`` 1.4.0. (`5830 <https://github.com/sunpy/sunpy/pull/5830>`__)
- In the case where ``sunpy.database.Database.fetch()`` successfully downloads only some of the search results, a ``sunpy.database.PartialFetchError`` is raised. This fixes a bug where the successful downloads would have been added to the database, but sometimes with incorrect metadata. (`5835 <https://github.com/sunpy/sunpy/pull/5835>`__)
- When getting IRIS files from the VSO, Fido was incorrectly labelling them as XML files. (`5868 <https://github.com/sunpy/sunpy/pull/5868>`__)
- `~sunpy.map.sources.HMIMap` now looks for ``'INSTRUME'`` instead of ``'TELESCOP'`` in order to support Helioviewer JPEG2000 versions of HMI data which do not preserve the ``'TELESCOP'`` keyword as expected in the JSOC standard. (`5886 <https://github.com/sunpy/sunpy/pull/5886>`__)
- Fixes a bug where the ``cmap`` and ``norm`` keyword arguments were ignored when calling
`~sunpy.map.MapSequence.plot`. (`5889 <https://github.com/sunpy/sunpy/pull/5889>`__)
- Fix parsing of the GOES/XRS netcdf files to ignore leap seconds. (`5915 <https://github.com/sunpy/sunpy/pull/5915>`__)
- Fixed compatibility with ``h5netcdf>0.14`` when loading GOES netcdf files. (`5920 <https://github.com/sunpy/sunpy/pull/5920>`__)
- Fixed bugs with the rebinning and per-keV calculation for Fermi/GBM summary lightcurves (`~sunpy.timeseries.sources.GBMSummaryTimeSeries`). (`5943 <https://github.com/sunpy/sunpy/pull/5943>`__)
- Fixed the unintentionally slow parsing of Fermi/GBM files (`~sunpy.timeseries.sources.GBMSummaryTimeSeries`). (`5943 <https://github.com/sunpy/sunpy/pull/5943>`__)
- Fixes a bug in `~sunpy.map.sources.SJIMap` where undefined variable was
used when parsing the wavelength.
Also fixes the unit parsing by removing the "corrected" string from the
``BUNIT`` keyword as "corrected DN" cannot be parsed as a valid FITS unit. (`5968 <https://github.com/sunpy/sunpy/pull/5968>`__)
- Fixed unit handling issue with `.GenericMap` and lowercasing the unit before it submits it to `astropy.units`. (`5970 <https://github.com/sunpy/sunpy/pull/5970>`__)
- Fixed reading CDF files when a variable has more than 2 dimensions. If this is the case the variable will be ignored, and a user warning is provided. (`5975 <https://github.com/sunpy/sunpy/pull/5975>`__)
- Fixed `sunpy.system_info` so it returns the extra group when an optional dependency is missing. (`6011 <https://github.com/sunpy/sunpy/pull/6011>`__)
- Relax condition check for a HMI Synoptic map source. (`6018 <https://github.com/sunpy/sunpy/pull/6018>`__)
- `.VSOClient` was not passing ``**kwargs`` through each download method. (`6052 <https://github.com/sunpy/sunpy/pull/6052>`__)
- Fixed the inability to rotate images and maps with byte ordering that is different from the native byte order of the system (e.g., big-endian values on a little-endian system) for certain interpolation orders when internally using ``scikit-image``. (`6064 <https://github.com/sunpy/sunpy/pull/6064>`__)
- Fixed a crash for dask arrays when displaying the `~sunpy.map.GenericMap` html representation. (`6088 <https://github.com/sunpy/sunpy/pull/6088>`__)
- Constructing the color map name for a `~sunpy.map.sources.KCorMap` no longer requires the "detector" key in the metadata.
This allows for reading files that are missing this keyword, as in the KCor JPEG2000 files. (`6112 <https://github.com/sunpy/sunpy/pull/6112>`__)
- We now correctly pass keyword arguments in our internal FITS reader to `astropy.io.fits.open`. (`6123 <https://github.com/sunpy/sunpy/pull/6123>`__)


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

- Fixed various plotting issues with the gallery example :ref:`sphx_glr_generated_gallery_units_and_coordinates_AIA_limb_STEREO.py`. (`5534 <https://github.com/sunpy/sunpy/pull/5534>`__)
- Improved the gallery example :ref:`sphx_glr_generated_gallery_units_and_coordinates_SDO_to_STEREO_Coordinate_Conversion.py` to better illustrate how coordinate transformations interact with submaps and coordinate plotting. (`5534 <https://github.com/sunpy/sunpy/pull/5534>`__)
- Tidy the API Reference section of the documentation and improve the landing
page for the docs. (`5623 <https://github.com/sunpy/sunpy/pull/5623>`__)
- Add info about loading CDF files to the API documentation. (`5735 <https://github.com/sunpy/sunpy/pull/5735>`__)
- Added a known issues entry about ``scikit-image`` package version pinning. (`5865 <https://github.com/sunpy/sunpy/pull/5865>`__)
- Edited entries in the example gallery to have a consistent plotting style.
Added said style guidelines to the example gallery page in the dev guide. (`5870 <https://github.com/sunpy/sunpy/pull/5870>`__)
- Added the gallery example :ref:`sphx_glr_generated_gallery_map_transformations_projection_custom_origin.py`, which specifically showcases the azimuthal equidistant projection (also known as the Postel projection). (`5961 <https://github.com/sunpy/sunpy/pull/5961>`__)
- Remove the part of the `~sunpy.map.sources.SJIMap` docstring that says
it only works on L1 as the data work for L2 and the level checking was
not being enforced. (`5968 <https://github.com/sunpy/sunpy/pull/5968>`__)
- Updated the timeseries documentation to make it clear that you can pass in a numpy array. (`6024 <https://github.com/sunpy/sunpy/pull/6024>`__)


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

- Sped up the parsing of results from the VSO. For large queries this significantly
reduces the time needed to perform a query to the VSO. (`5681 <https://github.com/sunpy/sunpy/pull/5681>`__)
- `sunpy.map.GenericMap.wcs` now checks that the scale property has the correct
units whilst constructing the WCS. (`5682 <https://github.com/sunpy/sunpy/pull/5682>`__)
- Added `packaging <https://pypi.org/project/packaging/>`__ as a core dependency as distutils is now deprecated. (`#5713 <https://github.com/sunpy/sunpy/pull/5713>`__)
- `~sunpy.util.exceptions.SunpyWarning` is no longer a subclass of `~astropy.utils.exceptions.AstropyWarning`. (`5722 <https://github.com/sunpy/sunpy/pull/5722>`__)
- Running the tests now requires the ``pytest-xdist`` package. By
default tests are *not* run in parallel, but can be configured to do so
using ``pytest-xdist`` command line options. (`5827 <https://github.com/sunpy/sunpy/pull/5827>`__)
- Migrate the asdf infrastructure to the new style converters etc added in asdf
2.8.0. This makes sure sunpy will be compatible with the upcoming asdf 3.0 release. (`6057 <https://github.com/sunpy/sunpy/pull/6057>`__)
- Declare in our dependencies that we are not compatible with asdf 3.0.0 until we
are. (`6077 <https://github.com/sunpy/sunpy/pull/6077>`__)
- Improved performance of the code that parses dates in clients that use the
`~sunpy.net.scraper.Scraper` to get available files. (`6101 <https://github.com/sunpy/sunpy/pull/6101>`__)

3.1.0

==================

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

- :meth:`sunpy.timeseries.sources.NOAAIndicesTimeSeries.peek` accepts ``plot_type`` as an argument instead of ``type``. (`5200 <https://github.com/sunpy/sunpy/pull/5200>`__)
- Fill values are now set to `numpy.nan` in ``sunpy.timeseries.sources.noaa`` file
parsers. They were previously set to a fill value of ``-1``. (`5363 <https://github.com/sunpy/sunpy/pull/5363>`__)
- `sunpy.map.GenericMap.date` now looks for more metadata than just DATE-OBS,
using new FITS keywords defined in version 4 of the standard.
`sunpy.map.GenericMap.date` now returns, in order of preference:

1. The DATE-OBS FITS keyword
2. `~sunpy.map.GenericMap.date_average`
3. `~sunpy.map.GenericMap.date_start`
4. `~sunpy.map.GenericMap.date_end`
5. The current time.

If DATE-OBS is present alongside DATE-AVG or DATE-BEG and DATE-END, this results
in a behaviour change to favour the new (more precisely defined) keywords.
It is recommended
to use `~sunpy.map.GenericMap.date_average`,
`~sunpy.map.GenericMap.date_start`, or `~sunpy.map.GenericMap.date_end`
instead if you need one of these specific times. (`5449 <https://github.com/sunpy/sunpy/pull/5449>`__)
- ``sunpy.io.fits.get_header`` no longer automatically tries to add the
WAVEUNIT keyword if it isn't present in the header. To replicate the original
behaviour do::

header = sunpy.io.fits.get_header(...)
waveunit = sunpy.io.fits.extract_waveunit(header)
if waveunit is not None:
header['WAVEUNIT'] = waveunit

The `sunpy.map.GenericMap.waveunit` property still uses
``sunpy.io.fits.extract_waveunit to try and get the waveunit if the
WAVEUNIT key isn't present. (`5501 <https://github.com/sunpy/sunpy/pull/5501>`__)
- `sunpy.map.GenericMap.wcs` no longer passes the whole ``.meta`` dictionary to
`astropy.wcs.WCS` when constructing ``.wcs``. Instead each metadata value is
manually taken from various map properties, which allows fixes to be made to
the WCS without modifying the original map header. We think that
`~sunpy.map.GenericMap.wcs` correctly sets all the keys needed for a full WCS
header, but if you find anything missing please open an issue on the sunpy
issue tracker. (`5501 <https://github.com/sunpy/sunpy/pull/5501>`__)


Deprecations
------------

- ``sunpy.util.scraper.Scraper`` has been moved into `sunpy.net`, please update your imports to be ``from sunpy.net import Scraper``. (`5364 <https://github.com/sunpy/sunpy/pull/5364>`__)
- Using "neighbour" as a resampling method in
:func:`sunpy.image.resample.resample` is deprecated. Use "nearest" instead,
which has the same effect. (`5480 <https://github.com/sunpy/sunpy/pull/5480>`__)
- The `sunpy.visualization.animator` subpackage has been spun out into the
standalone `mpl-animators <https://pypi.org/project/mpl-animators>`_ package,
with the exception of `~sunpy.visualization.animator.MapSequenceAnimator`.
Please update your imports to replace ``sunpy.visualization.animator`` with
``mpl_animators``.

This is primarily because the ``ndcube`` package now relies on the animator
classes as well as `sunpy`. (`5619 <https://github.com/sunpy/sunpy/pull/5619>`__)


Removals
--------

- The deprecated ``sunpy.roi.chaincode.Chaincode`` has been removed in favour of `sunpy.net.helio.Chaincode`. (`5304 <https://github.com/sunpy/sunpy/pull/5304>`__)
- The deprecated ``sunpy.roi.roi`` was removed, there is no direct replacement but `astropy-regions <https://astropy-regions.readthedocs.io/en/latest/>`__ is something to consider. (`#5304 <https://github.com/sunpy/sunpy/pull/5304>`__)
- The deprecated ``sunpy.instr`` has been removed, please use `sunkit_instruments <https://docs.sunpy.org/projects/sunkit-instruments/en/stable/>`__. (`#5304 <https://github.com/sunpy/sunpy/pull/5304>`__)
- The deprecated ``sunpy.map.GenericMap.size`` has been removed, please use ``sunpy.map.GenericMap.data.size``. (`5304 <https://github.com/sunpy/sunpy/pull/5304>`__)
- The deprecated ability to read txt files from `sunpy.timeseries.sources.noaa.NOAAIndicesTimeSeries` and `sunpy.timeseries.sources.noaa.NOAAPredictIndicesTimeSeries` has been removed as the data provided by NOAA is now provided as JSON files. (`5304 <https://github.com/sunpy/sunpy/pull/5304>`__)
- Removed various deprecated methods on our Fido clients and responses:

1. ``UnifiedResponse.build_table``, ``UnifiedResponse.tables``, ``UnifiedResponse.responses``, ``UnifiedResponse.get_response`` and ``UnifiedResponse.blocks`` as ``UnifiedResponse`` is now an `astropy.table.Table` that is sliceable.
2. ``UnifiedResponse.response_block_properties`` as ``UnifiedResponse.path_format_keys`` was added as a better replacement.
3. ``HECClient.time_query`` as you can now use ``Fido.search`` directly.
4. ``sunpy.net.jsoc.attrs.Keys`` was not used for querying JSOC.
5. ``sunpy.net.jsoc.JSOCClient.search_metadata`` as the functionality this provided was merged into `sunpy.net.jsoc.JSOCClient.search`.
6. ``sunpy.net.vso.VSOClient.link`` as better search support in the client replaces this method. (`5304 <https://github.com/sunpy/sunpy/pull/5304>`__)
- The deprecated ``sunpy.map.GenericMap.draw_rectangle()`` has been removed, the replacement is :meth:`sunpy.map.GenericMap.draw_quadrangle` (`5304 <https://github.com/sunpy/sunpy/pull/5304>`__)
- sunpy now errors if the unused ``.rsun`` or ``.heliographic_observer``
attributes are set on a `~astropy.wcs.WCS`. (`5348 <https://github.com/sunpy/sunpy/pull/5348>`__)
- Support for passing non-unit levels to :meth:`sunpy.map.GenericMap.draw_contours`
when map data has units set has been removed, and with now raise an error. (`5352 <https://github.com/sunpy/sunpy/pull/5352>`__)
- The ``origin`` argument to :meth:`sunpy.map.GenericMap.world_to_pixel` and
:meth:`sunpy.map.GenericMap.pixel_to_world` has been removed. (`5353 <https://github.com/sunpy/sunpy/pull/5353>`__)
- Support for plotting or contouring `~sunpy.map.GenericMap` on axes that are not
`~astropy.visualization.wcsaxes.WCSAxes` has been removed. To create a
``WCSAxes``, use the ``projection`` argument when the axes is created, e.g.
``fig.add_subplot(111, projection=my_map)``. (`5354 <https://github.com/sunpy/sunpy/pull/5354>`__)
- The following search attributes in `sunpy.net.vso.attrs` have been removed:
``['Time', 'Instrument', 'Wavelength', 'Source', 'Provider',
'Level', 'Sample', 'Detector', 'Resolution', 'Physobs']``.
Use the equivalent attribute from `sunpy.net.attrs` instead. (`5355 <https://github.com/sunpy/sunpy/pull/5355>`__)
- The default response format from the VSO client is now a table. (`5355 <https://github.com/sunpy/sunpy/pull/5355>`__)
- ``sunpy.net.hek.attrs.Time`` has been removed, use `sunpy.net.attrs.Time` instead. (`5355 <https://github.com/sunpy/sunpy/pull/5355>`__)


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

- Ensured that ``plot`` and ``peek`` will output the same figures for all `sunpy.timeseries.TimeSeries` sources. (`5200 <https://github.com/sunpy/sunpy/pull/5200>`__)
- Added hook file and tests for using PyInstaller with sunpy. (`5224 <https://github.com/sunpy/sunpy/pull/5224>`__)
- Allows :meth:`sunpy.map.GenericMap.draw_quadrangle` to accept pixel units as input to enable plotting boxes in the pixel space of the map, which can be different from the plot axes. (`5275 <https://github.com/sunpy/sunpy/pull/5275>`__)
- Added the :func:`~sunpy.coordinates.propagate_with_solar_surface` context manager for transformations, which will automatically apply solar differential rotation when transforming a coordinate between frames with a change in time (``obstime``). (`5281 <https://github.com/sunpy/sunpy/pull/5281>`__)
- Add support for parsing the observer location from a `~astropy.wcs.WCS` object
when using the 'OBSGEO' formulation. This is the recommended way to define the
observer location of a ground based observer. (`5315 <https://github.com/sunpy/sunpy/pull/5315>`__)
- Added a new function, ``sunpy.visualization.draw_limb``, that draws
the solar limb as seen from an arbitrary observer coordinate on a world
coordinate system aware Axes. (`5414 <https://github.com/sunpy/sunpy/pull/5414>`__)
- `sunpy.map.GenericMap.rsun_meters` now uses `sunpy.map.GenericMap.rsun_obs`
as a fallback to calculate the assumed radius of emission if RSUN_REF metadata
isn't present but metadata for `~sunpy.map.GenericMap.rsun_obs` is. (`5416 <https://github.com/sunpy/sunpy/pull/5416>`__)
- Added :func:`sunpy.coordinates.utils.get_limb_coordinates` to get the solar
limb coordinates as seen from a given observer. (`5417 <https://github.com/sunpy/sunpy/pull/5417>`__)
- Printing the response from a `~sunpy.net.Fido` query now includes the URL where
the data files are sourced from.

If you develop a third-party `~sunpy.net.Fido` client, support for this can
be automatically enabled by adding a ``info_url`` property to your
`~sunpy.net.base_client.BaseClient` that returns a URL as a string. (`5431 <https://github.com/sunpy/sunpy/pull/5431>`__)
- `~sunpy.timeseries.TimeSeries` can now read CDF files that conform to the
ISTP/IACG guidelines (https://spdf.gsfc.nasa.gov/sp_use_of_cdf.html). (`#5435 <https://github.com/sunpy/sunpy/pull/5435>`__)
- The properties `~sunpy.map.GenericMap.date_start`,
`~sunpy.map.GenericMap.date_end`, and `~sunpy.map.GenericMap.date_average` have
been added to be drawn from the relevant FITS metadata, if present in the map
header. (`5449 <https://github.com/sunpy/sunpy/pull/5449>`__)
- Add default color map and normalization for `~sunpy.map.sources.HMISynopticMap`
The default color map is 'hmimag' and the default normalization is linear between
-1.5e-3 and +1.5e3, the expected normalization for this particular color map. (`5464 <https://github.com/sunpy/sunpy/pull/5464>`__)
- The headers produced by :func:`~sunpy.map.header_helper.make_fitswcs_header` now include ``NAXIS``, ``NAXIS1``, and ``NAXIS2`` keywords. (`5470 <https://github.com/sunpy/sunpy/pull/5470>`__)
- The `~astropy.wcs.WCS` instance returned by the `sunpy.map.GenericMap.wcs` property now includes the shape of the data array. (`5470 <https://github.com/sunpy/sunpy/pull/5470>`__)
- Added the method :meth:`sunpy.map.GenericMap.reproject_to` for reprojecting a `~sunpy.map.Map` to a different WCS.
This method requires the optional package `reproject` to be installed. (`5470 <https://github.com/sunpy/sunpy/pull/5470>`__)
- Registered the time format ``tai_seconds`` for `astropy.time.Time` (via `~sunpy.time.TimeTaiSeconds`) to support parsing the numerical time format of TAI seconds since 1958-01-01 00:00:00.
This format includes UTC leap seconds, and enables equivalent functionality to the ``anytim2tai`` routine in SSW. (`5489 <https://github.com/sunpy/sunpy/pull/5489>`__)
- Added `sunpy.map.sources.WISPRMap` as a map source for WISPR on Parker Solar Probe.
This improves the `~sunpy.map.GenericMap.name` of the map and adds correct
information for the `~sunpy.map.GenericMap.processing_level` and
`~sunpy.map.GenericMap.exposure_time`. (`5502 <https://github.com/sunpy/sunpy/pull/5502>`__)
- ``sunpy.io.fits.write`` can now update the ``data`` and ``header`` of an existing HDU instance, as an alternative to creating a new instance of a specified HDU type. This adds support for writing a HDU (such as :class:`~astropy.io.fits.CompImageHDU`) initialised with non-default keyword arguments. (`5503 <https://github.com/sunpy/sunpy/pull/5503>`__)
- Added `~sunpy.timeseries.GenericTimeSeries.observatory` to provide observatory information for the timeseries e.g. specific goes satellite number. (`5556 <https://github.com/sunpy/sunpy/pull/5556>`__)
- :meth:`sunpy.timeseries.GenericTimeSeries.plot` and
:meth:`sunpy.timeseries.GenericTimeSeries.peek` will now automatically label
the y-axis if all the columns being plotted have the same units. (`5557 <https://github.com/sunpy/sunpy/pull/5557>`__)
- :meth:`sunpy.timeseries.GenericTimeSeries.plot` and
:meth:`sunpy.timeseries.GenericTimeSeries.peek` now have an option ``columns``
that allows plotting a subset of the columns present. (`5557 <https://github.com/sunpy/sunpy/pull/5557>`__)
- Added a new CDAWeb client, along with helper utilities to `sunpy.net.cdaweb`. (`5558 <https://github.com/sunpy/sunpy/pull/5558>`__)
- Support for filtering searches with JSOC keywords has been added to ``Fido.search``. (`5566 <https://github.com/sunpy/sunpy/pull/5566>`__)
- Added support for arithmetic operations between`~sunpy.map.GenericMap` and array-like
objects. (`5614 <https://github.com/sunpy/sunpy/pull/5614>`__)
- Added ``quantity`` attribute to `~sunpy.map.GenericMap` to expose the ``data``
attribute as a `~astropy.units.Quantity` using the ``unit`` attribute. (`5614 <https://github.com/sunpy/sunpy/pull/5614>`__)


Bug Fixes
---------

- :meth:`sunpy.map.GenericMap.superpixel` now keeps the reference coordinate of the
WCS projection the same as the input map, and updates the reference pixel accordingly.
This fixes inconsistencies in the input and output world coordinate systems when a
non-linear projection is used. (`5295 <https://github.com/sunpy/sunpy/pull/5295>`__)
- Inputs to the ``dimensions`` and ``offset`` arguments to
:meth:`sunpy.map.GenericMap.superpixel` in units other than ``u.pix``
(e.g. u.kpix``) are now handled correctly. (`5301 <https://github.com/sunpy/sunpy/pull/5301>`__)
- Fractional inputs to the ``dimensions`` and ``offset`` arguments to
:meth:`sunpy.map.GenericMap.superpixel` were previously rounded using `int`
in the superpixel algorithm, but not assigned integer values in the new metadata.
This has now been changed so the rounding is correctly reflected in the metadata. (`5301 <https://github.com/sunpy/sunpy/pull/5301>`__)
- Remove runtime use of ``astropy.tests.helper.assert_quantity_allclose`` which
introduces a runtime dependency on ``pytest``. (`5305 <https://github.com/sunpy/sunpy/pull/5305>`__)
- :meth:`sunpy.map.GenericMap.resample` now keeps the reference coordinate of the
WCS projection the same as the input map, and updates the reference pixel accordingly.
This fixes inconsistencies in the input and output world coordinate systems when a
non-linear projection is used. (`5309 <https://github.com/sunpy/sunpy/pull/5309>`__)
- Fix saving `.GenericMap` to an asdf file with version 2.8.0 of the asdf package. (`5342 <https://github.com/sunpy/sunpy/pull/5342>`__)
- When the limb is entirely visible, :meth:`sunpy.map.GenericMap.draw_limb` no
longer plots an invisible patch for the hidden part of the limb and now returns
`None` instead of the invisible patch. Similarly, when the limb is entirely
invisible, no patch is drawn for the visible part and `None` is returned
instead of the visible patch. (`5414 <https://github.com/sunpy/sunpy/pull/5414>`__)
- :meth:`sunpy.map.GenericMap.plot` now correctly sets axis labels based on the
coordinate system of the axes, and not the coordinate system of the map
being plotted. This was previously only an issue if using ``autoalign=True``
when the Map coordinate system was different to the axes coordinate system. (`5432 <https://github.com/sunpy/sunpy/pull/5432>`__)
- :meth:`sunpy.map.GenericMap.plot` no longer adds a unit string to the axis
labels if the axes being plotted on is a WCSAxes. For a WCSAxes, angular units
are indicated in the tick labels, and automatically change when the zoom level
changes from e.g. degrees to arc-minutes. This could previously lead to
situations where the axis label units were incorrect. (`5432 <https://github.com/sunpy/sunpy/pull/5432>`__)
- Implement automatic fallback to helioviewer mirrors if API is non-functional. (`5440 <https://github.com/sunpy/sunpy/pull/5440>`__)
- Fixed the incorrect value for the FITS WCS ``LONPOLE`` keyword when using :func:`~sunpy.map.header_helper.make_fitswcs_header` for certain combinations of WCS projection and reference coordinate. (`5448 <https://github.com/sunpy/sunpy/pull/5448>`__)
- The date returned by `~sunpy.map.GenericMap.date` for Solar Orbiter/EUI maps
has been adjusted to be taken from the DATE-AVG keyword
(the middle of the image acquisition period), instead of the DATE-OBS
keyword (the beginning of the image acquisition period). This means the observer
coordinate now has the correct date. (`5462 <https://github.com/sunpy/sunpy/pull/5462>`__)
- The ``.unit`` attribute for HMI synoptic maps has been fixed. (`5467 <https://github.com/sunpy/sunpy/pull/5467>`__)
- When "TAI" is in the date string, `sunpy.map.GenericMap.date`
now only raises a warning if the TIMESYS keyword is present
and different to "TAI". Previously a warning was raised all the
time when "TAI" was in the date string. (`5468 <https://github.com/sunpy/sunpy/pull/5468>`__)
- Fixed a bug where the property `sunpy.map.GenericMap.rsun_meters` would always internally determine the observer location, even when it is not needed, particularly for Stonyhurst heliographic maps, which have no notion of an observer.
Thus, when working with a Stonyhurst heliographic map, a user could get an irrelevant warning message about having to assume an observer location (Earth center). (`5478 <https://github.com/sunpy/sunpy/pull/5478>`__)
- Fixed the unintended insertion of (assumed) observer location information when accessing the property `sunpy.map.GenericMap.wcs` for Stonyhurst heliographic maps. (`5478 <https://github.com/sunpy/sunpy/pull/5478>`__)
- Fixed an incorrect value for the FITS WCS ``LONPOLE`` keyword when using :func:`~sunpy.map.header_helper.make_fitswcs_header` for `~sunpy.coordinates.frames.Helioprojective` maps with certain values of latitude for the reference coordinate. (`5490 <https://github.com/sunpy/sunpy/pull/5490>`__)
- A non-standard ``CROTA`` keyword included in a `sunpy.map.sources.EUIMap` FITS header is now renamed to the recommended ``CROTA2`` so a warning is no longer raised. (`5493 <https://github.com/sunpy/sunpy/pull/5493>`__)
- The plotting x-limits of :meth:`sunpy.timeseries.sources.NOAAIndicesTimeSeries.plot`
are now adjusted to only include finite points in the timeseries data. (`5496 <https://github.com/sunpy/sunpy/pull/5496>`__)
- The Hinode/XRT map source now corrects the TIMESYS keyword, fixing the ``.wcs``
property that was previously broken for Hinode/XRT maps. (`5508 <https://github.com/sunpy/sunpy/pull/5508>`__)
- Updated `sunpy.map.CompositeMap.plot` to support the ``linestyles`` and ``colors`` arguments, in addition to the existing ``linewidths`` argument. (`5521 <https://github.com/sunpy/sunpy/pull/5521>`__)
- Fixed a bug where rotating a `~sunpy.map.Map` could result in an extremely small shift (at the numerical-precision level) in the mapping from world coordinates to pixels. (`5553 <https://github.com/sunpy/sunpy/pull/5553>`__)
- Fixed a bug where rotating a `~sunpy.map.Map` that is missing observation-time metadata could result in an incorrect reference coordinate. (`5553 <https://github.com/sunpy/sunpy/pull/5553>`__)
- Fix a bug where saving a helioprojective or heliocentric coordinate to an
asdf file didn't work due to a schema version mismatch if the observer
location was a fully specified Stonyhurst heliographic coordinate. (`5584 <https://github.com/sunpy/sunpy/pull/5584>`__)
- `~sunpy.map.sources.XRTMap` uppercases the ``TIMESYS`` key before checking if the
key needs to be fixed. (`5592 <https://github.com/sunpy/sunpy/pull/5592>`__)
- Fixed passing a URL to :func:`sunpy.io.read_file` on windows. (`5601 <https://github.com/sunpy/sunpy/pull/5601>`__)
- Fixed a bug where the ``date`` property on `~sunpy.map.sources.HMISynopticMap` returned ``None``
if the ``DATE-OBS`` key was present. (`5648 <https://github.com/sunpy/sunpy/pull/5648>`__)


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

- Added the gallery example :ref:`sphx_glr_generated_gallery_differential_rotation_comparing_rotation_models.py` to visualize the differences between models of solar differential rotation. (`5527 <https://github.com/sunpy/sunpy/pull/5527>`__)
- Added an example to how to save out maps as FITS files and load them back in, :ref:`sphx_glr_generated_gallery_saving_and_loading_data_genericmap_in_fits.py`. (`5544 <https://github.com/sunpy/sunpy/pull/5544>`__)


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

- The `~sunpy.coordinates.frames.Helioprojective` frame now has the convenience property ``angular_radius`` to return the angular radius of the Sun as seen by the observer. (`5191 <https://github.com/sunpy/sunpy/pull/5191>`__)
- Online tests can now report back status of remote urls and will XFAIL if the remote server is unreachable. (`5233 <https://github.com/sunpy/sunpy/pull/5233>`__)
- Re-enabled the unit test to check for coordinates consistency with JPL HORIZONS when the matching ephemeris can be specified. (`5314 <https://github.com/sunpy/sunpy/pull/5314>`__)
- The `~sunpy.timeseries.TimeSeries` factory has been refactored to
improve readability and maintainability of the internal code. (`5411 <https://github.com/sunpy/sunpy/pull/5411>`__)
- `sunpy.map.GenericMap.rsun_obs` no longer emits a warning if the metadata it
looks for is not present. Instead the standard photospheric radius is assumed
and a log message emitted at the 'info' level. (`5416 <https://github.com/sunpy/sunpy/pull/5416>`__)
- Nearest-neighbour and linear
(the default for :meth:`sunpy.map.GenericMap.resample`)
resampling have been significantly sped up. (`5476 <https://github.com/sunpy/sunpy/pull/5476>`__)
- `sunpy.map.Map` now raises a clear error when the map is constructed if units
of either two axes are not angular units. (`5602 <https://github.com/sunpy/sunpy/pull/5602>`__)

3.0.1

==================

Bug Fixes
---------

- Fixed a bug where `~sunpy.map.GenericMap` used to break with keyword arguments. (`5392 <https://github.com/sunpy/sunpy/pull/5392>`__)
- Fixed a bug where calling :meth:`sunpy.map.GenericMap.draw_contours` on a different WCS could result in an unnecessary expansion of the plot limits. (`5398 <https://github.com/sunpy/sunpy/pull/5398>`__)
- Fixed incorrect return values from :func:`~sunpy.map.all_corner_coords_from_map` if a rectangular map was provided. (`5419 <https://github.com/sunpy/sunpy/pull/5419>`__)
- Do not trigger a pytest import in the asdf plugin for saving sunpy coordinate frames. (`5429 <https://github.com/sunpy/sunpy/pull/5429>`__)
- Constructing a 2D coordinate in the `~sunpy.coordinates.frames.HeliographicCarrington` frame with ``observer='self'`` now raises an error upon creation.
When specifying ``observer='self'``, the ``radius`` coordinate component serves as the Sun-observer distance that is necessary to fully define the Carrington heliographic coordinates. (`5358 <https://github.com/sunpy/sunpy/pull/5358>`__)
- Fixed two bugs with handling the motion of the Sun when transforming between coordinate frames with a change in ``obstime``.
These bugs did not affect any results if the context manager :func:`~sunpy.coordinates.transform_with_sun_center` had been used. (`5381 <https://github.com/sunpy/sunpy/pull/5381>`__)
- Fixed a bug where the ``rsun`` frame attribute could be unintentionally reset to the default value during transformation.
This bug primarily affected the transformation of a `~sunpy.coordinates.frames.Helioprojective` coordinate to a `~sunpy.coordinates.frames.HeliographicStonyhurst` frame. (`5395 <https://github.com/sunpy/sunpy/pull/5395>`__)
- Fixed a bug where creating a `~sunpy.coordinates.frames.HeliographicStonyhurst` frame or a `~sunpy.coordinates.frames.HeliographicCarrington` frame from WCS information failed to make use of any specified ``rsun_ref`` value. (`5395 <https://github.com/sunpy/sunpy/pull/5395>`__)
- `~sunpy.map.sources.SXTMap` now always returns `None` for the ``wavelength`` attribute. Previously this raised an error. (`5401 <https://github.com/sunpy/sunpy/pull/5401>`__)


Added/Improved Documentation
----------------------------

- Simplified the "Downloading LASCO C2" gallery example by removing redundant modifications to the metadata before it is loaded by `~sunpy.map.Map`. (`5402 <https://github.com/sunpy/sunpy/pull/5402>`__)
- Tided up the HMI synoptic map example by removing redundant code and correcting some of the comments. (`5413 <https://github.com/sunpy/sunpy/pull/5413>`__)

Page 1 of 8

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.