selectionfunctions
The selectionfunctions package aspires to provide a uniform interface to the selection functions of the major astronomical surveys.
This package is entirely derivative of the truly excellent dustmaps package created by Gregory M. Green.
The selectionfunctions package is a product of the Completeness of the Gaia-verse (CoG) collaboration.
Supported Selection Functions
The currently supported selection functions are:
- Gaia DR2 source catalogue (cog_ii.dr2_sf, Boubert & Everall 2020, submitted)
To request addition of another selection function in this package, file an issue on GitHub, or submit a pull request.
Installation
Download the repository from GitHub and then run:
python setup.py install --large-data-dir=/path/where/you/want/large/data/files/stored
Alternatively, you can use the Python package manager pip:
pip install selectionfunctions
Getting the Data
To fetch the data for the GaiaDR2 selectionfunction, run:
python setup.py fetch --map-name=cog_ii
You can download the other selection functions by changing "cog_ii" to (other selection functions will be added in future).
Alternatively, if you have used pip to install selectionfunctions, then you can
configure the data directory and download the data by opening up a python
interpreter and running:
>>> from selectionfunctions.config import config
>>> config['data_dir'] = '/path/where/you/want/large/data/files/stored'
>>>
>>> import selectionfunctions.cog_ii
>>> selectionfunctions.cog_ii.fetch()
Querying the selection functions
Selection functions are queried using Source objects, which are a variant on the
astropy.coordinates.SkyCoord
object. This means that any coordinate system supported by astropy can be
used as input. For example, we can query the Gaia DR2 selection function as follows:
>>> import selectionfunctions.cog_ii as CoGII
>>> from selectionfunctions.source import Source
>>>
>>> dr2_sf = CoGII.dr2_sf()
>>>
>>> c = Source(
'22h54m51.68s',
'-51d11m44.19s',
photometry={'gaia_g':16.02},
frame='icrs')
>>> print(dr2_sf(c))
Above, we have used the ICRS coordinate system (the inputs are RA and Dec). We can use other coordinate systems, such as Galactic coordinates, and we can provide coordinate arrays. The following example uses both features:
>>> c = Source(
[75.00000000, 130.00000000],
[-89.00000000, 10.00000000],
photometry={'gaia_g':[2.3,17.8]},
frame='galactic',
unit='deg')
>>> print(dr2_sf(c))
Documentation
Read the full documentation at http://selectionfunctions.readthedocs.io/en/latest/.
Citation
If you make use of this software in a publication, please always cite Green (2018) in The Journal of Open Source Software.
You should also cite the papers behind the selection functions you use.
Development
Development of selectionfunctions takes place on GitHub, at
https://github.com/gaiaverse/selectionfunctions. Any bugs, feature requests, pull requests,
or other issues can be filed there. Contributions to the software are welcome.
Metadata
Release files for selectionfunctions 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| selectionfunctions-1.0.0.tar.gz | 43.1 kB | Without provenance | Details for selectionfunctions-1.0.0.tar.gz |
Release files / selectionfunctions-1.0.0.tar.gz
| Download URL | selectionfunctions-1.0.0.tar.gz |
|---|---|
| Size | 43.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
929ccd1bee39472d0e8972b0e5ec7b76b66d54c79fb38ba80944de6b95256dcd
|
|
BLAKE2b-256 checksum How to use checksums |
af974b695aed9846d2eec082268017a465301650860cb0e149698c4491343bd2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
|
Security for selectionfunctions 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.