A query module created to access any of the simulation catalogs hosted on flathub.flatironinstitute.org.
To install the module, you just need Python and numpy.
To install, just clone this repository and run setup.py:
git clone https://github.com/flatironinstitute/flathub
cd flathub/py
python setup.py install
Once you have successfully installed the module, you can use it as:
import flathub
You can get the available catalogs with getCatalog
:
catalogs = flathub.getCatalogs()
You can also get a single catalog by name:
catalog = flathub.Catalog('gaiadr2')
Once you have a catalog, you can view the metadata and fields, and do queries:
catalog.title
catalog['source_id']
stats = catalog.stats(fields = ['dec'], ra = (120, 130), parallax = (None, 4), phot_g_mean_flux = (100000, None))
stats['dec']['avg']
histogram = catalog.histogram(fields = ['parallax'], quartiles = 'phot_g_mean_flux', ra = (120, 130))
histogram.buckets
count = catalog.count(ra = (120, 130), parallax = (3, 4))
data = catalog.numpy(fields = ['source_id', 'ra', 'dec', 'parallax'], sample = 1000.0/count, ra = (120, 130), parallax = (3, 4))
This project is licensed under the Apache 2 License - see the COPYING file for details.