getClosestImage#

hvpy.getClosestImage(date, sourceId, callback=None)[source]#

Find the image data that is closest to the requested datetime.

Return the associated metadata from the helioviewer database and the XML header of the JPEG2000 image file.

Parameters:
  • date (datetime) – Datetime of the image.

  • sourceId (Union[int, DataSource]) – Unique image datasource identifier.

  • callback (Optional[str]) – Wrap the response object in a function call of your choosing. Default is None (no wrapping), optional.

Return type:

Union[bytes, str, Dict[str, Any]]

References

Examples

>>> from datetime import datetime
>>> from hvpy import getClosestImage
>>> getClosestImage(
...     date=datetime.today(),
...     sourceId=14,
... )
{'id': '...', 'date': '...', 'name': '...', ...}