Open Cadair opened 8 months ago
Note: The dataset API uses top_right, lower_left ordering and sunpy uses lower_left, top_right everywhere so we might want to flip them around to match the sunpy convention.
Here's a complete implementation of a function which transforms the BoundingBox coord:
def dkist_fido_convert_bb(res):
res = res.copy()
coords = np.array(list(map(literal_eval, res["Bounding Box"])))
observer = EarthLocation.of_site("DKIST").get_itrs(res["Start Time"])
observer = observer.transform_to(sunpy.coordinates.HeliographicStonyhurst(obstime=res["Start Time"]))
res["Bounding Box"] = SkyCoord(coords[..., 0][:, ::-1], coords[..., 1][:, ::-1], unit=u.arcsec, frame="helioprojective", obstime=res["Start Time"][:, None], observer=observer[:, None])
return res
I got this far: