Skip to content

Commit

Permalink
Change endpoint for downloading cutouts for anomaly (#212)
Browse files Browse the repository at this point in the history
* Fix return type

* Change the endpoint to download cutouts in anomaly

* Fix typos
  • Loading branch information
JulienPeloton authored Nov 28, 2024
1 parent 3cce178 commit d9e7e37
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fink_filters/filter_anomaly_notification/filter_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit d9e7e37

Please sign in to comment.