Releases: sunpy/sunpy
v4.1.0
4.1.0 (2022-11-11)
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)
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) - Using sunpy.timeseries.GenericTimeSeries.index is
deprecated. Use ~sunpy.timeseries.GenericTimeSeries.time
to get an astropy Time object, orts.to_dataframe().index
to get
the times as a pandasDataTimeIndex
.
(#6327) - Deprecated the
sunpy.visualization.limb
module. The
sunpy.visualization.limb.draw_limb
function has been moved into
~sunpy.visualization.drawing as
~sunpy.visualization.drawing.limb
.
(#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. As such, in
consultation with the Helioviewer Project, we have decided to
deprecate theHelioviewerClient
class.
(#6404) - Passing the
algorithm
,return_footprint
arguments as positional
arguments is deprecated. Pass them as keyword arguments (e.g.
..., return_footprint=True, ...
) instead.
(#6406) sunpy.data.download_sample_data
is now deprecated. Use
sunpy.data.sample.download_all
instead.
(#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)
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) - The
sunpy.physics.solar_rotation
sub-module has been removed,
having been moved to sunkit_image.coalignment.
(#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 package
Please update your imports to replacesunpy.visualization.animator
withmpl_animators
.
(#6434) - Remove
GenericMap.shift
method and theGenericMap.shifted_value
.
Use ~sunpy.map.GenericMap.shift_reference_coord
instead. (#6437) sunpy.util.scraper
has been removed. Use sunpy.net.scraper instead.
(#6438)sunpy.image.coalignment
has been removed. Use sunkit_image.coalignment instead, which
contains all the same functionality.
(#6440)sunpy.map.GenericMap.draw_limb
can no longer be used to draw the
limb on a non-WCS Axes plot.
(#6533)sunpy.image.resample
no longer accepts "neighbour" as an
interpolation method. Use "nearest" instead.
(#6537)sunpy.image.transform.affine_transform
and
sunpy.map.GenericMap.rotate
no longer accepts theuse_scipy
keyword. (#6538)
New Features
-
Updated and expanded the HTML representation for ~sunpy.timeseries.TimeSeries.
(#5951) -
When reading CDF files, any columns with a floating point data type
now have their masked values converted to NaN.
(#5956) -
Add support for saving ~sunpy.map.GenericMap as JPEG 2000 files.
(#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) -
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) -
Added a SDO/AIA 1600 file of the Venus transit to the sunpy sample
data. (#6242) -
Created the sunpy.visualization.drawing module which
includes new~sunpy.visualization.drawing.equator
and
~sunpy.visualization.drawing.prime_meridian
functions.
(#6251) -
Expose GOES quality flags in order to allow filtering corrupt values
when using the ~sunpy.timeseries.sources.goes.XRSTimeSeries.
(#6260) -
All TimeSeries plotting methods now consistently set the same
formatter and locator for the x-axis.
(#6264) -
sunpy.timeseries.GenericTimeSeries.peek
now takes atitle
argument to set the title of the plot.
(#6304) -
Added the sunpy.timeseries.GenericTimeSeries.time
property to get the times of a timeseries as a ~astropy.time.Time object.
(#6327) -
Added the
sphx_glr_generated_gallery_plotting_plot_equator_prime_meridian.py
example to the Example Gallery.
(#6332) -
Added a new function
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) -
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
sunpy.data.sample.download_all
.
(#6426) -
~.XRSTimeSeries is now able to parse
the primary detector information from the GOES-R XRS data if
available. (#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) -
Implemented site configuration for sunpyrc, and modified
documentation for sunpy customization.
(#6478) -
~sunpy.map.header_helper.make_fitswcs_header
now includes the
keyword argumentunit
for setting theBUNIT
FITS keyword in the
resulting header. This will take precedence over any unit
information attached todata
.
(#6499) -
If the
data
argument to
~sunpy.map.header_helper.make_fitswcs_header
is an ~astropy.units.Quantity, the associated
unit will be used to set theBUNIT
FITS keyword in the resulting
header. (#6499) -
Added a 304 sample data file called
AIA_304_IMAGE
.
(#6546)
Bug Fixes
- Fix a bug that prevented EUI maps with missing wavelength...
v4.0.7
4.0.7 (2022-11-11)
Bug Fixes
-
Fixed the incorrect calculation in
~sunpy.map.header_helper.make_fitswcs_header
of the rotation
matrix from a rotation angle when the pixels are non-square.
(#6597) -
Fixed bug that prevented ~sunpy.coordinates.metaframes.RotatedSunFrame
instances from being pickled.
(#6342) -
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) -
Add support for Python 3.11.
The deprecated cgi.parse_header is
now available as sunpy.util.net.parse_header.
(#6512) -
Fixed the metadata handling of
~sunpy.map.GenericMap.resample
and
~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
~sunpy.map.GenericMap.rotate
.
(#6571) -
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) -
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) -
Fixed a bug where
~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)
What's Changed
- [4.0] Extra Backports by @nabobalis in #6509
- Backport PR #6335 on branch 4.0 (Update Installation instructions ) by @meeseeksmachine in #6515
- [4/0] Backport #6511 by @nabobalis in #6518
- Backport PR #6523 on branch 4.0 (Re-enabled the use of pytest-arraydiff) by @meeseeksmachine in #6532
- Backport PR #6527 on branch 4.0 (Remove old test warning filter) by @meeseeksmachine in #6534
- Backport PR #6520 on branch 4.0 (Update Fido attrs) by @meeseeksmachine in #6536
- Backport PR #6521 on branch 4.0 (Fixing issues related to tox-conda) by @meeseeksmachine in #6535
- Backport PR #6547 on branch 4.0 (Update conda env with sphinx-copybutton) by @meeseeksmachine in #6548
- Backport PR #6552 on branch 4.0 (Include the actual CITATION.rst rather than a symlink to it) by @meeseeksmachine in #6553
- Backport PR #6512 on branch 4.0 (Python 3.11 Support) by @Cadair in #6554
- Backport PR #6342 on branch 4.0 (Fixed bug that prevents RotatedSunFrame instances from being pickled) by @meeseeksmachine in #6568
- Backport PR #6573 on branch 4.0 (Fixed the determination of scale and rotation matrix from the CDij matrix) by @meeseeksmachine in #6583
- Backport PR #6581 on branch 4.0 (Fixes issues with
parse_time()
and the handling of excess zeros in the microsecond field) by @meeseeksmachine in #6589 - [4.0] Backport of #6571 by @nabobalis in #6588
- Backport PR #6593 on branch 4.0 (Fix cdaweb doctest) by @meeseeksmachine in #6594
- Backport PR #6597 on branch 4.0 (Fix a bug in
make_fitswcs_header()
when creating a rotation matrix from an angle when the pixels are non-square) by @meeseeksmachine in #6598
Full Changelog: v4.0.6...v4.0.7
v4.0.6
4.0.6 (2022-10-25)
Bug Fixes
-
Fix a bug in loading .XRSTimeSeries due to unsupported quality flag column names. (#6410)
-
Adds units (dimensionless units) to the quality columns in .XRSTimeSeries. (#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) -
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)
-
Fixed a bug where the observer coordinate was incorrectly determined for ~sunpy.map.sources.KCorMap. (#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)
-
Removed an error when searching CDAWEB using sunpy.net.Fido and no results are returned. An empty response table is now returned. (#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)
-
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)
Documentation
- Fixed bug in un-run code in
helioviewer
(#6475)
Internal Changes
- Added tests and test data for ~sunpy.map.sources.SXTMap (#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) - Tidy the GOES XRSTimesSeries tests and add two new XRS files to test. (#6460)
v4.0.5
What's Changed
- [4.0] Test data cleanup (#6065) by @nabobalis in #6354
- Backport PR #6357 on branch 4.0 (Minor improvements to data acquisition guide) by @meeseeksmachine in #6359
- Backport PR #6364 on branch 4.0 (Allow EVE to have two additional files in Fido search test) by @meeseeksmachine in #6365
- Backport PR #6366 on branch 4.0 (pin version of jsonschema) by @meeseeksmachine in #6367
- Backport PR #6376 on branch 4.0 (Removes lingering use of Astropy's
matrix_product()
) by @meeseeksmachine in #6380 - Backport PR #6379 on branch 4.0 (Fix Matplotlib colormap deprecation) by @meeseeksmachine in #6387
- Backport PR #6388 on branch 4.0 (Fix the ordering of the API docs) by @meeseeksmachine in #6390
- Backport PR #6396 on branch 4.0 (Fix adaptive reproject test with reproject 0.9) by @meeseeksmachine in #6397
- Backport PR #6399 on branch 4.0 (Fix Matplotlib
get_cmap
deprecation) by @meeseeksmachine in #6400 - Backport PR #6401 on branch 4.0 (Change the jsoc email to a sunpy one) by @meeseeksmachine in #6402
Full Changelog: v4.0.4...v4.0.5
v4.0.4
What's Changed
- Backport PR #6350 on branch 4.0 (update metadata for pypi page) by @meeseeksmachine in #6351
- Backport PR #6336 on branch 4.0 (Add bugfix release policy to docs) by @meeseeksmachine in #6352
- Backport PR #6329 on branch 4.0 (Update license year) by @meeseeksmachine in #6353
- [4.0] Backports #6328 by @nabobalis in #6348
New Contributors
- @meeseeksmachine made their first contribution in #6351
Full Changelog: v4.0.3...v4.0.4
v3.1.8
3.1.8 (2022-07-23)
Bug Fixes
v4.0.3
Bug Fixes
- Fixed ~sunpy.timeseries.sources.XRSTimeSeries
inability to read leap-second files for GOES. It floors the
leap-second timestamp to be59.999
, so that Python datetime does
not raise an exception. (#6262) - 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) - 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)
4.0.2 (2022-06-24)
New Features
- Added a SDO/AIA 1600 file of the Venus transit to the sunpy sample data. (#6242)
- Expose GOES quality flags in order to allow filtering corrupt values when using the ~sunpy.timeseries.sources.goes.XRSTimeSeries. (#6260)
Bug Fixes
-
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)
-
Changed the default scaling for ~sunpy.map.sources.EUIMap from a linear stretch to a asinh stretch. (#6285)
To revert to the previous linear stretch do the following:
from astropy.visualization import ImageNormalize, LinearStretch euimap.plot_settings["norm"] = ImageNormalize(stretch=LinearStretch())
Internal Changes
- Add support for upcoming parfive 2.0 release. (#6243)
- The primary sample-data URL will be changing from
https://github.com/sunpy/sample-data/raw/master/sunpy/v1/
tohttps://github.com/sunpy/data/raw/main/sunpy/v1/
. We expect GitHub to redirect from the old URL for sometime but will eventually expire it. Thedata.sunpy.org
mirror will continue to be available. (#6289) - Add support for downloading sample data from more than two mirror locations. (#6295)
v4.0.1
4.0.1 (2022-06-09)
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)
New Features
-
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)
Bug Fixes
- Fix a bug that prevented EUI maps with missing wavelength metadata loading. (#6199)
Documentation
- Improved annotations in the SRS active regions plotting example. (#6196)
- Updated gallery examples that use STEREO data to use sample data instead of searching for and downloading data via Fido. (#6197)
Internal Changes
- Updated the
info_url
for the ~sunpy.net.dataretriever.sources.goes.XRSClient to account for the different default sources that vary based on GOES satellite number. (#6152) - 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)
- 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) sunpy
now uses the Limited Python API. Therefore, one binary distribution (wheel) per platform is now published and it is compatible with all Python versionssunpy
supports. (#6171)
v4.0.0
v4.0.0 (2022-05-06)
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)
- Any NaNs are now preserved by
sunpy.image.transform.affine_transform
andsunpy.map.GenericMap.rotate
. (#5867) sunpy.image.transform.affine_transform
andsunpy.map.GenericMap.rotate
now default to using SciPy for rotation instead of scikit-image, so rotation results may be slightly different. (#5867)- The math convenience methods of sunpy.map.GenericMap -
~sunpy.map.GenericMap.max
,~sunpy.map.GenericMap.mean
,~sunpy.map.GenericMap.min
, and ,~sunpy.map.GenericMap.std
- now ignore NaNs in the image data. (#5867) sunpy.image.transform.affine_transform
andsunpy.map.GenericMap.rotate
now default to using NaN instead of zero for themissing
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)- 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) - Changed the default interpolation order for
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 usesscipy.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)
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)
- The sunpy.map.GenericMap.shift method has been renamed to sunpy.map.GenericMap.shift_reference_coord and ~sunpy.map.GenericMap.shift has been deprecated. (#5977)
- The sunpy.map.GenericMap.shifted_value property has been deprecated. Modifications to the reference coordinate can be found in the
CRVAL1
andCRVAL2
keys ofsunpy.map.GenericMap.meta.modified_items
. (#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)
- 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)
- 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)
- Deprecated using sunpy.map.GenericMap.draw_limb on an Axes that is not a WCSAxes. (#6079)
New Features
-
Added support for Python 3.10 (#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) -
The
rsun
argument to~sunpy.map.get_observer_meta
is now optional. (#5655) -
Added the
~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) -
Added the ability to specify the use of Carrington coordinates with
sunpy.map.GenericMap.draw_grid
. (#5703) -
Printing a .MetaDict will now show each entry on a new line. (#5765)
-
Removed support for Python 3.7. (#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)
-
Added a helpful warning message when converting a 2D Helioprojective coordinate will return all NaNs. (#5817)
-
The colorbar limits on HMI magnetic field maps are now automatically set to be symmetric about zero. (#5825)
-
Added a
clip
keyword tosunpy.image.transform.affine_transform
andsunpy.map.GenericMap.rotate
to enable or disable whether the range of the output image is clipped to the range of the input range. (#5867) -
Created the decorator
sunpy.image.transform.add_rotation_function
for registering new rotation functions for use bysunpy.image.transform.affine_transform
andsunpy.map.GenericMap.rotate
. (#5867) -
sunpy.image.transform.affine_transform and
sunpy.map.GenericMap.rotate
have both had theiruse_scipy
arguments deprecated. Instead use the newmethod
argument to select from the available rotation methods. (#5916) -
Added a Maxwell unit and any places where a conversion to Gauss occurs has been removed. (#5998)
-
Add a basic HTML representation for ~sunpy.timeseries.TimeSeries. (#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 addtion to this the asdf-astropy package is now required to serialise and deserialise the sunpy coordinate frame classes to ASDF. (#6057)
-
Added the option to rotate using OpenCV when using
sunpy.image.transform.affine_transform
orsunpy.map.GenericMap.rotate
by specifyingmethod='cv2'
. The OpenCV Python package must be installed on the system. (#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)
-
Fixed the units of sunpy.map.sources.HMISynopticMap.scale and sunpy.map.sources.MDISynopticMap.scale. (#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) -
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)
-
The default
id_type
insunpy.coordinates.get_horizons_coord
is now None to match the deafultid_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 defaultid_type
used by~sunpy.coordinates.get_horizons_coord
is still'majorbody'
. (#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)
-
Updated the
plot
methods on some timeseries classes to correctly label and format the time axis. ([#5720](https:...