Releases: sunpy/sunpy
v3.1.2
3.1.2 (2021-12-02)
New Features
- Added support for Python 3.10 (#5568)
Bug Fixes
- 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) - 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)
- Updated asdf schemas so that references use URIs, as tags are not supported by the new asdf extensions API. (#5723)
Documentation
- Fixed various plotting issues with the gallery example
sphx_glr_generated_gallery_units_and_coordinates_AIA_limb_STEREO.py
. (#5534) - Improved the gallery example
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)
Internal Changes
v3.0.3
3.0.3 (2021-12-02)
Features
- Added support for Python 3.10 (#5568)
Bug Fixes
- ~sunpy.map.sources.XRTMap uppercases the
TIMESYS
key before checking if the key needs to be fixed. (#5592) - Fixed passing a URL to
sunpy.io.read_file
on windows. (#5601) - 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) - The default
id_type
insunpy.coordinates.get_horizons_coord
is now None to match the defaultid_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) - Updated asdf schemas so that references use URIs, as tags are not supported by the new asdf extensions API. (#5723)
Trivial/Internal Changes
v3.1.1
3.1.1 (2021-11-10)
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)
Documentation
- Tidy the API Reference section of the documentation and improve the landing page for the docs. (#5623)
Internal Changes
- sunpy.map.GenericMap.wcs now checks that the scale property has the correct units whilst constructing the WCS. (#5682)
v3.1.0
3.1.0 (2021-10-29)
Breaking Changes
-
sunpy.timeseries.sources.NOAAIndicesTimeSeries.peek
acceptsplot_type
as an argument instead oftype
. (#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) -
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:
- The DATE-OBS FITS keyword
- ~sunpy.map.GenericMap.date_average
- ~sunpy.map.GenericMap.date_start
- ~sunpy.map.GenericMap.date_end
- 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)
-
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) -
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)
Deprecations
-
sunpy.util.scraper.Scraper
has been moved into sunpy.net, please update your imports to befrom sunpy.net import Scraper
. (#5364) -
Using "neighbour" as a resampling method in
sunpy.image.resample.resample
is deprecated. Use "nearest" instead, which has the same effect. (#5480) -
The sunpy.visualization.animator subpackge has been spun out into the standalone mpl-animators package, with the exception of ~sunpy.visualization.animator.MapSequenceAnimator. Please update your imports to replace
sunpy.visualization.animator
withmpl_animators
.This is primarily because the
ndcube
package now relies on the animator classes as well as sunpy. (#5619)
Removals
- The deprecated
sunpy.roi.chaincode.Chaincode
has been removed in favour of sunpy.net.helio.Chaincode. (#5304) - The deprecated
sunpy.roi.roi
was removed, there is no direct replacement but astropy-regions is something to consider. (#5304) - The deprecated
sunpy.instr
has been removed, please use sunkit_instruments. (#5304) - The deprecated
sunpy.map.GenericMap.size
has been removed, please usesunpy.map.GenericMap.data.size
. (#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)
- Removed various deprecated methods on our Fido clients and responses:
UnifiedResponse.build_table
,UnifiedResponse.tables
,UnifiedResponse.responses
,UnifiedResponse.get_response
andUnifiedResponse.blocks
asUnifiedResponse
is now an astropy.table.Table that is sliceable.UnifiedResponse.response_block_properties
asUnifiedResponse.path_format_keys
was added as a better replacement.HECClient.time_query
as you can now useFido.search
directly.sunpy.net.jsoc.attrs.Keys
was not used for querying JSOC.sunpy.net.jsoc.JSOCClient.search_metadata
as the functionality this provided was merged into sunpy.net.jsoc.JSOCClient.search.sunpy.net.vso.VSOClient.link
as better search support in the client replaces this method. (#5304)
- The deprecated
sunpy.map.GenericMap.draw_rectangle()
has been removed, the replacement issunpy.map.GenericMap.draw_quadrangle
(#5304) - sunpy now errors if the unused
.rsun
or.heliographic_observer
attributes are set on a ~astropy.wcs.WCS. (#5348) - Support for passing non-unit levels to
sunpy.map.GenericMap.draw_contours
when map data has units set has been removed, and with now raise an error. (#5352) - The
origin
argument tosunpy.map.GenericMap.world_to_pixel
andsunpy.map.GenericMap.pixel_to_world
has been removed. (#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 theprojection
argument when the axes is created, e.g.fig.add_subplot(111, projection=my_map)
. (#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) - The default response format from the VSO client is now a table. (#5355)
sunpy.net.hek.attrs.Time
has been removed, use sunpy.net.attrs.Time instead. (#5355)
New Features
-
Ensured that
plot
andpeek
will output the same figures for all sunpy.timeseries.TimeSeries sources. (#5200) -
Added hook file and tests for using PyInstaller with sunpy. (#5224)
-
Allows
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) -
Added the
~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) -
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)
-
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) -
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)
-
Added
sunpy.coordinates.utils.get_limb_coordinates
to get the solar limb coordinates as seen from a given observer. (#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) -
<...
v3.0.2
3.0.2 (2021-10-13)
Bug Fixes
- Fixed the incorrect value for the FITS WCS
LONPOLE
keyword when
using~sunpy.map.make_fitswcs_header
for certain combinations of
WCS projection and reference coordinate. (#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) - The
.unit
attribute for HMI synoptic maps has been fixed.
(#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) - Fixed the unintended insertion of (assumed) observer location
information when accessing the property sunpy.map.GenericMap.wcs for Stonyhurst
heliographic maps. (#5478) - Fixed an incorrect value for the FITS WCS
LONPOLE
keyword when
using~sunpy.map.make_fitswcs_header
for ~sunpy.coordinates.frames.Helioprojective
maps with certain values of latitude for the reference coordinate.
(#5490) - The Hinode/XRT map source now corrects the TIMESYS keyword, fixing
the.wcs
property that was previously broken for Hinode/XRT maps.
(#5508) - Updated sunpy.map.CompositeMap.plot
to support thelinestyles
andcolors
arguments, in addition to
the existinglinewidths
argument. (#5521) - Fixed a bug where rotating a ~sunpy.map.Map that is missing
observation-time metadata could result in an incorrect reference
coordinate. (#5553) - 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) - 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)
Added/Improved Documentation
- Added an example to how to save out maps as FITS files and load them
back in,
sphx_glr_generated_gallery_saving_and_loading_data_genericmap_in_fits.py
.
(#5544)
Documentation Fixes
- Fixed various plotting issues with the gallery example
sphx_glr_generated_gallery_units_and_coordinates_AIA_limb_STEREO.py
.
(#5534) - Improved the gallery example
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)
v3.0.1
3.0.1 (2021-07-03)
Bug Fixes
- Fixed a bug where ~sunpy.map.GenericMap used to break with
keyword arguments. (#5392) - Fixed a bug where calling
sunpy.map.GenericMap.draw_contours
on a
different WCS could result in an unnecessary expansion of the plot
limits. (#5398) - Fixed incorrect return values from
~sunpy.map.maputils.all_corner_coords_from_map
if a rectangular
map was provided. (#5419) - Do not trigger a pytest import in the asdf plugin for saving sunpy
coordinate frames. (#5429) - Constructing a 2D coordinate in the ~sunpy.coordinates.frames.HeliographicCarrington
frame withobserver='self'
now raises an error upon creation. When
specifyingobserver='self'
, theradius
coordinate component
serves as the Sun-observer distance that is necessary to fully
define the Carrington heliographic coordinates. (#5358) - Fixed two bugs with handling the motion of the Sun when transforming
between coordinate frames with a change inobstime
. These bugs did
not affect any results if the context manager
~sunpy.coordinates.transform_with_sun_center
had been used.
(#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.frame.HeliographicStonyhurst
frame. (#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) - ~sunpy.map.sources.SXTMap now always
returns None for thewavelength
attribute. Previously this raised an error. (#5401)
v3.0.0
Backwards Incompatible Changes
sunpy.instr
has been depreacted and will be removed in sunpy 3.1 in favour ofsunkit-instruments
. The code that is undersunpy.instr
is imported viasunkit-instruments
to ensure backwards comparability. (#4526)- Several
sunpy.map.GenericMap
attributes have been updated to returnNone
when the relevant piece of FITS metadata is missing. These are:sunpy.map.GenericMap.exposure_time
, previously defaulted to zero seconds.sunpy.map.GenericMap.measurement
, previously defaulted to zero.sunpy.map.GenericMap.waveunit
, previously defaulted tou.one
.sunpy.map.GenericMap.wavelength
, previously defaulted to zero. (#5126)
sunpy.coordinates.frames.HeliographicStonyhurst
andsunpy.coordinates.frames.HeliographicCarrington
no longer automatically convert 2D input to a 3D coordinate during instantiation. Instead, the 2D-to-3D conversion is deferred until the coordinate is transformed to a different frame, or with a call to the methodsunpy.coordinates.frames.BaseHeliographic.make_3d
. (#5211)- Changed URL for the
sunpy.net.dataretriever.sources.SRSClient
from "ftp://ftp.swpc.noaa.gov/pub/warehouse/" to "ftp://ftp.ngdc.noaa.gov/STP/swpc_products/daily_reports/". The old URL is unsupported and we expect the files will be the same but we can not say with 100% certainty. (#5173) - Changed
sunpy.net.attrs.Source
tosunpy.net.attrs.Provider
for thesunpy.net.dataretriever.sources.GONGClient
. (#5174) - The
rsun
frame attribute ofsunpy.coordinates.frames.Helioprojective
now converts any input to kilometers. (#5211) sunpy.map.CompositeMap.plot
now internally callssunpy.map.GenericMap.plot
andsunpy.map.GenericMap.draw_contours
, which may affect the plot output of existing user code. (#5255)- Removed the
basic_plot
keyword argument fromsunpy.map.CompositeMap.peek
due to its unreliability. (#5255) sunpy.util.sphinx.changelog
andsunpy.util.towncrier
have been removed and are now in a standalone package sphinx-changelog. (#5049)
Deprecations and Removals
-
Deprecated
sunpy.map.GenericMap.draw_rectangle
in favor ofsunpy.map.GenericMap.draw_quadrangle
. (#5236) -
Using
sunpy.map.GenericMap
plotting methods on anmatplotlib.axes.Axes
that is not aastropy.visualization.wcsaxes.WCSAxes
is deprecated. This previously raised a warning, but is now formally deprecated, and will raise an error in sunpy 3.1. (#5244) -
Deprecated
sunpy.roi.chaincode.Chaincode
and created a replacement atsunpy.net.helio.Chaincode
.This replacement has the following changes:
- Added support for numpy array as an input (it was broken before).
- Renamed
BoundingBox
toboundingbox
- Renamed
subBoundingBox
tosub_boundingbox
- Now area and length raise
NotImplementedError
(#5249)
-
Deprecated
sunpy.roi.roi
, as it currently has no obvious use and has never seen any real development work. (#5249)
Features
-
sunpy.coordinates.get_horizons_coord
can now be given a start time, end time, and number of intervals (or interval length) to query a evenly spaced set of times. See the documentation string for more information and an example. (#4698) -
Added
sunpy.map.GenericMap.draw_quadrangle
for drawing a quadrangle on a map. A quadrangle has edges that are aligned with lines of constant latitude and longitude, but these can be in a different coordinate system than that of the map. (#4809) -
Added a
longitude
keyword argument tosunpy.coordinates.sun.carrington_rotation_time
as an alternate way to specify a fractional Carrington rotation. (#4879) -
Colorbar in
sunpy.map.GenericMap.peek
now has a unit label. (#4930) -
The default axes used by
sunpy.visualisation.animator.BaseFuncAnimator.get_animation
is nowBaseFuncAnimator.axes
, instead of the currently active axes (accessed via.matplotlib.pyplot.gca
). The allows animations to be created on figures created directly usingmatplotlib.figure.Figure
.To revert to the previous behaviour of using the current axes, give
axes=plt.gca()
toget_animation()
. (#4968) -
Added colormaps for Solar Orbiter EUI images. These are used automatically when an EUI image is loaded. (#5023)
-
Added the ability to dynamically scale
sunpy.visualization.animator
instances. By specifying theclip_interval
keyword, it will now clip the minimum and maximum at each slider step to the specified interval. (#5025) -
Added a
sunpy.time.TimeRange.contains
method tosunpy.time.TimeRange
that tests if two time ranges overlap. (#5093) -
Added the ability to namespace files downloaded using
sunpy.data.data_manager.manager.DataManager
by prepending the file name with module name. (#5111) -
Added a rigid rotation model to
sunpy.physics.differential_rotation.diff_rot
viarot_type=rigid
, where the rotation rate does not vary with latitude. (#5132) -
Added a
sunpy.map.MapSequence.save
method tosunpy.map.MapSequence
that saves each map of the sequence. (#5145) -
The allowable
level
inputs tosunpy.map.GenericMap.contour
andsunpy.map.GenericMap.draw_contours
have been consolidated. Both methods now accept- Scalars, if the map has no units
- Quantities, if the map has units
- Percentages (#5154)
-
Added support for corrected NOAA SWPC solar region summary data files. (#5173)
-
Updated
sunpy.util.sysinfo.system_info
to return all optional dependencies of sunpy. (#5175) -
sunpy.map.Map
now supports the EUI instrument on Solar Orbiter. (#5210) -
sunpy.coordinates.frames.HeliographicStonyhurst
andsunpy.coordinates.frames.HeliographicCarrington
now have anrsun
frame attribute to specify the radius of the Sun, which defaults to the photospheric radius defined insunpy.sun.constants
. This frame attribute is used when converting a 2D coordinate (longitude and latitude, with no specified radial distance) to a 3D coordinate by setting the radial distance torsun
(i.e., the assumption is that the coordinate is on the surface of the Sun). (#5211) -
Enhanced
sunpy.map.GenericMap.draw_limb
so that the solar limb can be plotted on axes that correspond to a different map (e.g., with a different observer). The part of the limb that is not visible to the axes's observer because it is on the far side of the Sun is shown as dotted rather than solid. (#5237) -
sunpy.util.MetaDict
now saves a copy of the metadata on creation, which can be accessed using thesunpy.util.MetaDict.original_meta
property. Three new properties have also been added to query any changes that have been made to metadata:sunpy.util.MetaDict.added_items
sunpy.util.MetaDict.removed_items
sunpy.util.MetaDict.modified_items
As an example,
my_map.meta.modified_items
will return a dictionary mapping keys to their original value and current value. (#5241) -
Added
sunpy.map.contains_coordinate
which provides a quick way to see if a world coordinate is contained within the array bounds of a map. (#5252) -
Added an optional keyword argument
autoalign
tosunpy.map.GenericMap.plot
for plotting a map to axes that correspond to a different WCS. Seesphx_glr_generated_gallery_map_transformations_autoalign_aia_hmi.py
. (#5255) -
sunpy.map.CompositeMap.plot
now properly makes use of WCS information to position and orient maps when overlaying them. (#5255)
Bug Fixes
- Fixed the drawing methods of
sunpy.map.GenericMap
(e.g.,sunpy.map.GenericMap.draw_rectangle
) so that any text labels will appear in the legend. (#5019) - Fixed bug in
sunpy.until.scraper.Scraper
which caused URL patterns containing backslashes to be incorrectly parsed on Windows. (#5022) - Constructing a
sunpy.util.MetaDict
is now more lenient, and accepts any class that inherits fromcollections.abc.Mapping
. This fixes a regression where headers read withastropy.io.fits
raised an error when passed to individualsunpy.map
sources. (#5047) - Added warning to
sunpy.map.GenericMap.rotate
when specifiedmissing
value is not compatible wit...
v2.1.5
Bug Fixes
- Fixed a bug with the visibility of some grid lines when using
~sunpy.map.GenericMap.draw_grid
. (#5222) sunpy.coordinates.solar_frame_to_wcs_mapping
now sets the observer
auxiliary information when a ~sunpy.coordinates.HeliographicCarrington
frame withobserver='self'
is passed. (#5264)- Calling
sunpy.map.make_fitswcs_header
with a ~sunpy.coordinates.HeliographicCarrington
coordinate that withobserver='self'
set now correctly sets the
observer information in the header. (#5264) - Fix saving .GenericMap to an asdf
file with version 2.8.0 of the asdf package. (#5342)
Trivial/Internal Changes
- Temporarily disabled the unit test to check for coordinates
consistency with JPL HORIZONS due to the inability to choose a
matching ephemeris. (#5203)
v2.0.11
v2.1.4
Bug Fixes
- Fixed a bug with failing downloads in 2010 with the ~sunpy.net.dataretriever.sources.SRSClient.
(#5159) - If the property sunpy.map.GenericMap.rsun_obs needs to
calculate the solar angular radius from header information, it now
properly uses thersun_ref
keyword if it is present and does not
emit any warning. (#5172) - Added a "rsun_obs" keyword to the output of
sunpy.map.make_fitswcs_header
if the coordinate argument has a
"rsun" frame attribute. (#5177)
Added/Improved Documentation
- Added a documentation string to ~sunpy.map.sources.sdo.HMISynopticMap.
(#5186)
Trivial/Internal Changes
- The
CROTA
keywords are no longer set on sunpy.map.GenericMap.wcs, as thePC_ij
keywords are always set and the FITS standard says that these
keywords must not co-exist. (#5166)