Skip to content

Account for use of reference_date property#345

Merged
wtbarnes merged 7 commits intoLM-SAL:mainfrom
wtbarnes:reference-date-fixes
Sep 24, 2024
Merged

Account for use of reference_date property#345
wtbarnes merged 7 commits intoLM-SAL:mainfrom
wtbarnes:reference-date-fixes

Conversation

@wtbarnes
Copy link
Contributor

@wtbarnes wtbarnes commented Sep 23, 2024

This PR includes a few fixes to account for the existence of the new reference_dateproperty on Map which is the correct date to use when constructing the coordinate frame and observer coordinate.

This also now assumes the existence of the "T_OBS" key in the metadata since this is what is used for constructing reference_date in the case of an AIA map.

Since reference_date was only introduced in sunpy v6 we should decide how to go about using this property or just make the minimum version of sunpy v6.

See also sunpy/sunpy#7810

Summary by Sourcery

Update the code to use the 'reference_date' property for constructing coordinate frames and observer coordinates, assuming the presence of 'T_OBS' in metadata for AIA maps. Adjust tests to reflect these changes and improve accuracy.

Bug Fixes:

  • Fix the use of the incorrect date for constructing the coordinate frame and observer coordinate by using the new 'reference_date' property instead of 'smap.date'.

Enhancements:

  • Assume the existence of the 'T_OBS' key in the metadata for constructing 'reference_date' in AIA maps, aligning with changes in sunpy v6.

Tests:

  • Update tests to use 'u.allclose' for asserting observer coordinate values with a relative tolerance, improving test accuracy.
  • Remove the test that checks for a warning when 'T_OBS' is missing from metadata, as this scenario is no longer applicable.

@sourcery-ai

This comment was marked as spam.

sourcery-ai[bot]

This comment was marked as spam.

@nabobalis
Copy link
Member

I will leave it up to you @wtbarnes when you want to merge.

@wtbarnes wtbarnes merged commit 68b6ce7 into LM-SAL:main Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants