Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow multi-object search #292

Merged
merged 5 commits into from Mar 21, 2022
Merged

Allow multi-object search #292

merged 5 commits into from Mar 21, 2022

Conversation

JulienPeloton
Copy link
Member

@JulienPeloton JulienPeloton commented Mar 21, 2022

Closes #291

Now one can query the data for many objects at the same time:

import requests
import pandas as pd
import numpy as np

r = requests.post(
  'https://fink-portal.org/api/v1/objects',
  json={
    'objectId': 'ZTF19acmdpyr,ZTF21aaxtctv',
    'withupperlim': 'True'
  }
)

# Format output in a DataFrame
pdf = pd.read_json(r.content)
n_oids = len(np.unique(pdf.groupby('i:objectId').count()['i:ra']))
# 2 objects

The argument is a comma-separated list of ZTF object IDs.

Todo:

  • Update documentation.

@JulienPeloton JulienPeloton merged commit 4f0c57f into master Mar 21, 2022
@JulienPeloton JulienPeloton deleted the issue/291/multiid branch August 30, 2022 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[API] allow searching for a list of object ID
1 participant