astropy.wcs.utils.obsgeo_to_frame(obsgeo, obstime)[source]

Convert a WCS obsgeo property into an ITRS coordinate frame.


A shape (6, ) array representing OBSGEO-[XYZ], OBSGEO-[BLH] as returned by WCS.wcs.obsgeo.


The time associated with the coordinate, will be passed to ITRS as the obstime keyword.


An ITRS coordinate frame representing the coordinates.


The obsgeo array as accessed on a WCS object is a length 6 numpy array where the first three elements are the coordinate in a cartesian representation and the second 3 are the coordinate in a spherical representation.

This function priorities reading the cartesian coordinates, and will only read the spherical coordinates if the cartesian coordinates are either all zero or any of the cartesian coordinates are non-finite.

In the case where both the spherical and cartesian coordinates have some non-finite values the spherical coordinates will be returned with the non-finite values included.