From d9e7e37153712f141533608ebee8d471fcdb7603 Mon Sep 17 00:00:00 2001 From: Julien Date: Thu, 28 Nov 2024 22:11:05 +0100 Subject: [PATCH] Change endpoint for downloading cutouts for anomaly (#212) * Fix return type * Change the endpoint to download cutouts in anomaly * Fix typos --- fink_filters/filter_anomaly_notification/filter_utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fink_filters/filter_anomaly_notification/filter_utils.py b/fink_filters/filter_anomaly_notification/filter_utils.py index a9fb363..642e5c3 100755 --- a/fink_filters/filter_anomaly_notification/filter_utils.py +++ b/fink_filters/filter_anomaly_notification/filter_utils.py @@ -428,12 +428,12 @@ def get_cutout(ztf_id): ''' # transfer cutout data r = requests.post( - "https://fink-portal.org/api/v1/objects", - json={"objectId": ztf_id, "withcutouts": "True", "cols": "b:cutoutScience_stampData"}, + "https://fink-portal.org/api/v1/cutouts", + json={"objectId": ztf_id, "kind": "Science", "output-format": "array"}, ) if not status_check(r, 'get cutouts'): return io.BytesIO() - data = np.log(np.array(r.json()[0]['b:cutoutScience_stampData'], dtype=float)) + data = np.log(np.array(r.json()['b:cutoutScience_stampData'], dtype=float)) plt.axis('off') plt.imshow(data, cmap='PuBu_r') buf = io.BytesIO()