We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
With version 0.12.0 or higher I run into the following issue trying to check a coordinate inside a MOC:
In [2]: import mocpy; import astropy.units as u; moc = mocpy.MOC.from_fits('dr2-moc.moc'); moc.contains_l ...: onlat(164.43*u.deg, 45.54*u.deg) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[2], line 1 ----> 1 import mocpy; import astropy.units as u; moc = mocpy.MOC.from_fits('dr2-moc.moc'); moc.contains_lonlat(164.43*u.deg, 45.54*u.deg) File ~/anaconda3/lib/python3.10/site-packages/mocpy/moc/moc.py:259, in MOC.contains_lonlat(self, lon, lat, keep_inside) 257 lon = lon if isinstance(lon, Longitude) else Longitude(lon) 258 lat = lat if isinstance(lat, Latitude) else Latitude(lat) --> 259 mask = mocpy.filter_pos( 260 self._store_index, 261 lon.to_value(u.deg).astype(np.float64), 262 lat.to_value(u.deg).astype(np.float64), 263 ) 264 if keep_inside: 265 return mask TypeError: argument 'lon': 'float64' object cannot be converted to 'PyArray<T, D>'
The MOC in question is available here and works with lower versions such as 0.11.
The text was updated successfully, but these errors were encountered:
Thanks for reporting, that's an issue with the new contains_lonlat that only takes lists of coordinates. For now, you can fix by doing :
contains_lonlat
moc.contains_lonlat([164.43*u.deg], [45.54*u.deg])
Sorry, something went wrong.
Thanks for reporting, that's an issue with the new contains_lonlat that only takes lists of coordinates. For now, you can fix by doing : moc.contains_lonlat([164.43*u.deg], [45.54*u.deg])
Ah excellent, that works for now. Thanks!
add regression test for #108 [skip ci]
3badf69
It is now solved in the dev version (install with :
git clone https://github.com/cds-astro/mocpy.git cd mocpy pip install .
) and it will be in the next official release
Don't hesitate to come back if you have any question/concern with the library or the docs 🙂
ManonMarchand
No branches or pull requests
With version 0.12.0 or higher I run into the following issue trying to check a coordinate inside a MOC:
The MOC in question is available here and works with lower versions such as 0.11.
The text was updated successfully, but these errors were encountered: