Skip to content

Commit

Permalink
new cutout test
Browse files Browse the repository at this point in the history
  • Loading branch information
Knispel2 authored Jul 27, 2024
1 parent 0bfde2a commit c8cf8b5
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions fink_filters/filter_anomaly_notification/filter_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,15 +427,22 @@ def get_cutout(ztf_id):
'''
r = requests.post(
'https://fink-portal.org/api/v1/cutouts',
json={
'https://fink-portal.org/api/v1/objects',
json={
'objectId': ztf_id,
'kind': 'Science'
'withcutouts': 'True'
},
timeout=25
)
pdf = pd.read_json(io.BytesIO(r.content))
data = np.log(np.array(pdf['b:cutoutTemplate_stampData'].to_numpy()[0]))
plt.axis('off')
image_data = plt.imshow(data, cmap='PuBu_r')
status_check(r, 'get cutouts')
return io.BytesIO(r.content)
buf = io.BytesIO()
plt.savefig(buf, format='png')
buf.seek(0)
return buf

def get_curve(ztf_id):
'''
Expand Down

0 comments on commit c8cf8b5

Please sign in to comment.