astropy / astropy/astroquery

MAST query_criteria not working for some column criteria?

Open
#2,355 4 comments 0 reactions 0 assignees View on GitHub
mast
Dominant language
Python
Stars
791
Forks
451
Avg merge
1d 3h
Merged PRs (30d)
4

Description

I was following the [documentation](https://astroquery.readthedocs.io/en/latest/mast/mast.html#id1).

Examples such as this
```python
catalog_data = Catalogs.query_criteria(catalog="Ctl",
objectname='M101', radius=1, Tmag=[10.75,11])
catalog_data
```
works as expected (only Tmag between 10.75 to 11 are selected).

However, when I add similar criteria to PanSTARRS example, it doesn't work:
```python
catalog_data = Catalogs.query_criteria(coordinates="5.97754 32.53617", radius=0.003,
catalog="PANSTARRS", table="mean", data_release="dr2",
iMeanPSFMag=[18.0, 22.0], # <-- This line is the only effective change
columns=["objName", "objID", "nStackDetections", "iMeanPSFMag", "distance"],
sort_by=[("desc", "distance")],
)
catalog_data
# WARNING: NoResultsWarning: Query returned no results. [astroquery.mast.services]
# Table masked=True length=0
```

Note that there ARE rows with ``iMeanPSFMag`` between 18-22:
```
# The result of ``catalog data`` when no `iMeanPSFMag` condition is added
objName | objID | nStackDetections | iMeanPSFMag | distance
-- | -- | -- | -- | --

PSO J005.9749+32.5381 | 147040059749096195 | 5 | 20.830299377441406 | 0.0029426894970862503
PSO J005.9759+32.5385 | 147040059758636795 | 0 | -- | 0.002719372599106959
PSO J005.9765+32.5339 | 147040059765031328 | 5 | 20.688100814819336 | 0.0024033108514576016
PSO J005.9798+32.5349 | 147040059797942411 | 1 | -- | 0.002312550513681363
PSO J005.9756+32.5346 | 147040059755792120 | 0 | -- | 0.002285931827483295
PSO J005.9800+32.5359 | 147040059799933722 | 0 | 21.69879913330078 | 0.00207558804344405
PSO J005.9796+32.5352 | 147040059795782766 | 1 | -- | 0.002003864099439158
PSO J005.9781+32.5364 | 147040059780744250 | 0 | -- | 0.0004843077363618632
```

Also I found criterion such as ``distance=[0.001, 0.0021],`` works as expected.

Wondering why the magnitude criterion is not working... Maybe because of the NaN values..??

Contributor guide

Open the contributing guide

Research direction

Use the PANSTARRS Catalogs.query_criteria example as the entry point; compare how iMeanPSFMag=[18.0, 22.0] is translated with the working distance range and inspect handling of missing values. Done when the query returns the expected rows with magnitudes in range without breaking the existing Ctl and distance criteria.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.