Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed meta_keywords #7337

Merged
merged 5 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Breaking Changes
Deprecations
------------

- Using `sunpy.map.header_helper.meta_keywords` is deprecated.
- 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>`__)
Expand Down
1 change: 1 addition & 0 deletions changelog/7337.removal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
``sunpy.map.header_helper.meta_keywords`` has been removed.
2 changes: 1 addition & 1 deletion docs/how_to/create_custom_map.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Here's another example of passing ``reference_pixel`` and ``scale`` to the funct
rsun_obs: 965.3829548285768

As we can see, a list of WCS and observer meta information is contained within the generated headers, however we may want to include other meta information including the observatory name, the wavelength and wavelength unit of the observation.
Any of the keywords in the dictionary returned by :func:`~sunpy.map.header_helper.meta_keywords` can be passed to the :func:`~sunpy.map.header_helper.make_fitswcs_header` and will then populate the returned MetaDict header.
Any valid FITS WCS keywords can be passed to the :func:`~sunpy.map.header_helper.make_fitswcs_header` and will then populate the returned MetaDict header.
Furthermore, the following observation keywords can be passed to the `~sunpy.map.header_helper.make_fitswcs_header` function: ``observatory``, ``instrument``, ``telescope``, ``wavelength``, ``exposure``.

An example of creating a header with these additional keywords:
Expand Down
1 change: 0 additions & 1 deletion docs/reference/map.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ All sunpy Maps are derived from `sunpy.map.GenericMap`, all the methods and attr
:inherited-members:
:include-all-objects:
:skip: make_fitswcs_header
:skip: meta_keywords
:skip: get_observer_meta
:skip: make_heliographic_header

Expand Down
20 changes: 1 addition & 19 deletions sunpy/map/header_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,8 @@
from sunpy import log
from sunpy.coordinates import frames, sun
from sunpy.util import MetaDict
from sunpy.util.decorators import deprecated

__all__ = ['meta_keywords', 'make_fitswcs_header', 'get_observer_meta', 'make_heliographic_header']


@deprecated(since="5.0", message="Unused and will be removed in 6.0")
def meta_keywords():
"""
Returns the metadata keywords that are used when creating a `sunpy.map.GenericMap`.

Examples
--------
Returns a dictionary of all meta keywords that are used in a `sunpy.map.GenericMap` header:
>>> import sunpy.map
>>> sunpy.map.meta_keywords() # doctest: +SKIP
{'cunit1': 'Units of the coordinate increments along naxis1 e.g. arcsec **required',
'cunit2': 'Units of the coordinate increments along naxis2 e.g. arcsec **required',
...
"""
return _map_meta_keywords.copy()
__all__ = ['make_fitswcs_header', 'get_observer_meta', 'make_heliographic_header']


@u.quantity_input(equivalencies=u.spectral())
Expand Down
7 changes: 0 additions & 7 deletions sunpy/map/tests/test_header_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from sunpy.coordinates import frames, sun
from sunpy.map import make_fitswcs_header
from sunpy.map.header_helper import make_heliographic_header
from sunpy.util.exceptions import SunpyDeprecationWarning
from sunpy.util.metadata import MetaDict


Expand Down Expand Up @@ -62,12 +61,6 @@ def hpc_coord_notime():
return SkyCoord(0*u.arcsec, 0*u.arcsec, frame=frames.Helioprojective)


def test_metakeywords():
with pytest.warns(SunpyDeprecationWarning):
meta = sunpy.map.meta_keywords()
assert isinstance(meta, dict)


def test_scale_conversion(map_data, hpc_coord):
# The header will have cunit1/2 of arcsec
header = make_fitswcs_header(map_data, hpc_coord, scale=[1, 2] * u.arcmin / u.pix)
Expand Down