Package: scanninglaw
scanninglawThescanninglawpackage aims to provide and easy-to-use portal to the Gaia scanning law.
This package is entirely derivative of the truly excellentdustmapspackage created by Gregory M. Green.
Thescanninglawpackage is a product of theCompleteness of theGaia-verse (CoG)collaboration.Supported Scanning LawsThe currently supported scanning laws are:Gaia DR2 scanning law (cogi_2020,Boubert, Everall & Holl 2020)Gaia DR2 scanning law (cog3_2020,Boubert, Everall, Fraser, Gration & Holl 2020)Gaia EDR3 nominal scanning law (dr3_nominal)Gaia DR2 ASF (cogiv_2020,Everall, Boubert, Koposov, Smith & Holl 2021)To request addition of another sacnning law in this package,file an issue on
GitHub, or submit a pull request.InstallationDownload the repository fromGitHuband
then run:python setup.py install --large-data-dir=/path/where/you/want/large/data/files/storedGetting the DataTo fetch the data for the GaiaDR2 scanning law, run:python setup.py fetch --map-name=cog3_2020You can download the other scanning laws by changing "cog3_2020".Alternatively, if you have usedpipto installscanninglaw, then you can
configure the data directory and download the data by opening up a python
interpreter and running:fromscanninglaw.configimportconfigconfig['data_dir']='/path/where/you/want/large/data/files/stored'importscanninglaw.timesscanninglaw.times.fetch()Querying the scanning lawScanning laws are queried using Source objects, which are a variant on theastropy.coordinates.SkyCoordobject. This means that any coordinate system supported byastropycan be
used as input. For example, we can query the Gaia DR2 scanning law as follows:importscanninglaw.timesastimesfromscanninglaw.sourceimportSourcedr2_sl=times.dr2_sl()c=Source('22h54m51.68s','-51d11m44.19s',frame='icrs')print(dr2_sl(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],frame='galactic',unit='deg')print(dr2_sl(c))Query the Astrometry Spread FunctionTo estimate Gaia's expected 5D astrometry covariance for any source from the
Astrometry Spread Function, we've added a module to thescanninglawpackage.Fetch the ASF data from Harvard Dataverse:fromscanninglaw.configimportconfigconfig['data_dir']='/path/where/you/want/large/data/files/stored'importscanninglaw.asfscanninglaw.asf.fetch()And find the expected covariance of your source:importscanninglaw.asfasasffromscanninglaw.sourceimportSourcedr2_asf=asf.asf(version='cogiv_2020')c=Source('22h54m51.68s','-51d11m44.19s',photometry={'gaia_g':16.02},frame='icrs')dr2_asf(c)EDR3 Nominal scanning lawWe've updated the repository for EDR3!Fetch the nominal scanning law from the Gaia website:>>>fromscanninglaw.configimportconfig>>>config['data_dir']='/path/where/you/want/large/data/files/stored'>>>>>>importscanninglaw.times>>>scanninglaw.times.fetch(version='dr3_nominal')And find when your star was observed:importscanninglaw.timesastimesfromscanninglaw.sourceimportSourcedr3_sl=times.dr2_sl(version='dr3_nominal')c=Source('22h54m51.68s','-51d11m44.19s',frame='icrs')print(dr3_sl(c))We haven't yet found the file for the DR3 published gaps but we'll incorporate those when we do!DocumentationRead the full documentation athttp://scanninglaw.readthedocs.io/en/latest/.CitationIf you make use of this software in a publication, please always citeGreen (2018) in The Journal of Open Source Software.You should also cite the papers behind the scanning laws you use.cogi_2020 - Please cite Completeness of the Gaia-versePaper I.cog3_2020 - Please cite Completeness of the Gaia-versePaper III.cogiv_2020 (for the ASF) - Please cite Completeness of the Gaia-versePaper IV.DevelopmentDevelopment ofscanninglawtakes place on GitHub, athttps://github.com/gaiaverse/scanninglaw. Any bugs, feature requests, pull requests,
or other issues can be filed there. Contributions to the software are welcome.