Note
Go to the end to download the full example code.
Setting Survey Parameters#
The Survey File#
ATK stores all survey parameters in a file, which can be opened either from the commandline:
$ ATKsurvey open
or from inside a script:
from ATK.Config import SURVEY_CONFIG
SURVEY_CONFIG.open()
To see the current state of the survey file, use:
$ ATKsurvey show
from ATK.Config import SURVEY_CONFIG
SURVEY_CONFIG.show()
[vizier]
<gaia>
id = I/355/gaiadr3
epoch = 2016-01-01T00:00:00.000
mags: Gmag, BPmag, RPmag
errors: e_Gmag, e_BPmag, e_RPmag
lon = RA_ICRS
lat = DE_ICRS
frame = icrs
<galex>
id = II/335/galex_ais
epoch = 2006-08-01T00:00:00.000
mags: NUVmag, FUVmag
errors: e_NUVmag, e_FUVmag
lon = RAJ2000
lat = DEJ2000
frame = icrs
<wise>
id = II/311/wise
epoch = 2010-06-01T00:00:00.000
mags: W1mag, W2mag, W3mag, W4mag
errors: e_W1mag, e_W2mag, e_W3mag, e_W4mag
lon = RAJ2000
lat = DEJ2000
frame = icrs
<sdss>
id = V/154/sdss16
epoch = 2006-01-01T00:00:00.000
mags: uPmag, gPmag, rPmag, iPmag, zPmag
errors: e_uPmag, e_gPmag, e_rPmag, e_iPmag, e_zPmag
lon = RA_ICRS
lat = DE_ICRS
frame = icrs
<2mass>
id = II/246/out
epoch = 1999-01-01T00:00:00.000
mags: Jmag, Hmag, Kmag
errors: e_Jmag, e_Hmag, e_Kmag
lon = RAJ2000
lat = DEJ2000
frame = icrs
<skymapper>
id = II/379/smssdr4
epoch = 2016-01-01T00:00:00.000
mags: gPSF, rPSF, iPSF, zPSF, uPSF, vPSF
errors: e_gPSF, e_rPSF, e_iPSF, e_zPSF, e_uPSF, e_vPSF
lon = RAICRS
lat = DEICRS
frame = icrs
<panstarrs>
id = II/349/ps1
epoch = 2012-01-01T00:00:00.000
mags: gmag, rmag, imag, zmag, ymag
errors: e_gmag, e_rmag, e_imag, e_zmag, e_ymag
lon = RAJ2000
lat = DEJ2000
frame = icrs
<rosat>
id = IX/11/rosatsrc
epoch = 1991-01-01T00:00:00.000
lon = RAJ2000
lat = DEJ2000
frame = icrs
<erosita>
id = J/A+A/682/A34/erass1-m
epoch = 2022-01-01T00:00:00.000
lon = RA_ICRS
lat = DE_ICRS
frame = icrs
[image]
<panstarrs>
epoch = 2012-01-01T00:00:00.000
<skymapper>
epoch = 2016-01-01T00:00:00.000
<dss1>
epoch = 1955-01-01T00:00:00.000
<dss2>
epoch = 1990-01-01T00:00:00.000
<wise>
epoch = 2010-01-01T00:00:00.000
<2mass>
epoch = 1999-01-01T00:00:00.000
<sdss>
epoch = 2005-01-01T00:00:00.000
[lightcurve]
<ztf>
epoch = 2019-01-01T00:00:00.000
<gaia>
epoch = 2016-01-01T00:00:00.000
<asassn>
epoch = 2015-01-01T00:00:00.000
<crts>
epoch = 2008-01-01T00:00:00.000
<tess>
epoch = 2020-01-01T00:00:00.000
[spectrum]
<sdss>
epoch = 2017-01-01T00:00:0.000
<desi>
epoch = 2020-01-01T00:00:00.000
Adding a Catalogue Alias#
Any Vizier catalogue can be immediately accessed by passing its catalogue ID to query():
from ATK import query
allwise_query = query("vizier", targets=2552928187080872832, survey="II/328/allwise")
However, it may become tedious to remember catalogue IDs in prolonged workloads. Additionally, and perhaps more importantly, the above does not benefit from proper motion correction as ATK doesn’t know the catalogue’s epoch. Both of these problems can be solved by adding a catalogue alias to the survey file.
In this tutorial, query() will be extended with AllWISE.
Editing the Survey File#
To add an AllWISE alias, the following must be added to the survey file, under vizier:
allwise
id = II/328/allwise
This can be done manually by opening survey file in the default text editor, or by setting it directly:
$ ATKsurvey set vizier allwise --id II/328/allwise
from ATK.Config import SURVEY_CONFIG
SURVEY_CONFIG["vizier"]["allwise"]["id"] = "II/328/allwise"
Testing the New Alias#
<Empty DataSet>
.kind: vizier
.targets: 2552928187080872832 | 12.297° 5.377° (icrs, 2016-01-01T00:00:00.000, 3.0″)
.exception: False
.data: <empty list>
Available Methods: .add(), .apply(), .from_target(), .merge(), .open(), .plot(), .save(), .show(), .split(), .store()
The new alias is working, but the query has not returned any data. This is because no epoch information has been added. This can be amended by setting the epoch key with the median epoch of AllWISE (approximately 2010-05-01T00:00:00.000):
$ ATKsurvey set vizier allwise --epoch 2010-05-01T00:00:00.000
from ATK.Config import SURVEY_CONFIG
SURVEY_CONFIG["vizier"]["allwise"]["epoch"] = "2010-05-01T00:00:00.000"
Upon running the same query again, data is now returned:
<Record DataSet>
.kind: Record
.targets: 2552928187080872832 | 12.297° 5.377° (icrs, 2016-01-01T00:00:00.000, 3.0″)
.exception: False
.data:
<allwise (II/328/allwise) Record>
survey: allwise
catalogue: II/328/allwise
correction: full
search_pos: 12.295° 5.381° (icrs, 2010-05-01T00:00:00.000)
table:
(astropy.Table)
AllWISE: [J004910.78+052249.8]
RAJ2000: [12.295] °
DEJ2000: [5.381] °
eeMaj: [0.038] ″
eeMin: [0.036] ″
eePA: [61.5] °
Im: [Im]
W1mag: [11.40999984741211] mag
e_W1mag: [0.023000000044703484] mag
W2mag: [11.357000350952148] mag
e_W2mag: [0.019999999552965164] mag
W3mag: [11.380000114440918] mag
e_W3mag: [0.19699999690055847] mag
W4mag: [8.880000114440918] mag
e_W4mag: [nan] mag
Jmag: [nan] mag
e_Jmag: [nan] mag
Hmag: [nan] mag
e_Hmag: [nan] mag
Kmag: [nan] mag
e_Kmag: [nan] mag
wx: [1675.304] pix
wy: [274.91] pix
ID: [121106001351004903]
snr1: [47.6]
chi2W1: [10.199999809265137]
snr2: [53.5]
chi2W2: [5.179999828338623]
snr3: [5.5]
chi2W3: [1.0]
snr4: [-0.8]
chi2W4: [0.8550000190734863]
chi2: [5.239999771118164]
nb: [1]
na: [0]
sat1: [0.0]
sat2: [0.0]
sat3: [0.0]
sat4: [0.0]
ccf: [0000]
ex: [1]
var: [20nn]
nW1: [23]
mW1: [23]
nW2: [20]
mW2: [20]
nW3: [2]
mW3: [13]
nW4: [0]
mW4: [13]
satnum: [0]
RA_pm: [12.295] °
e_RA_pm: [0.038] ″
DE_pm: [5.381] °
e_DE_pm: [0.038] ″
cosig_pm: [0.008] ″
pmRA: [367.0] mas yr⁻¹
e_pmRA: [49.0] mas yr⁻¹
pmDE: [-3180.0] mas yr⁻¹
e_pmDE: [49.0] mas yr⁻¹
chi2W1_pm: [3.890000104904175]
chi2W2_pm: [1.5399999618530273]
chi2W3_pm: [1.0099999904632568]
chi2W4_pm: [0.8539999723434448]
chi2pm: [2.0899999141693115]
qpm: [2N004]
qph: [AABU]
fdet: [7]
fmoon: [2333]
covW1: [23.852]
covW2: [20.877]
covW3: [13.922]
covW4: [13.867]
2Mkey: [nan]
d2M: [nan] ″
2M: [2M]
Available Methods: .add(), .apply(), .from_target(), .merge(), .open(), .plot(), .save(), .show(), .split(), .store()
Defining an Image Overlay#
The AllWISE Vizier catalogue alias added above can be extended into an image overlay definition by adding some extra information. As a minimum, all overlay definitions require three columns for positional information: a longitude column, a latitude column, and a frame on which these are based.
In the case of AllWISE, this means adding the following:
$ ATKsurvey set vizier allwise --lon RAJ2000 --lat DEJ2000 --frame icrs
from ATK.Config import SURVEY_CONFIG
SURVEY_CONFIG["vizier"]["allwise"]["lon"] = "RAJ2000"
SURVEY_CONFIG["vizier"]["allwise"]["lat"] = "DEJ2000"
SURVEY_CONFIG["vizier"]["allwise"]["frame"] = "icrs"
Once these keys have been added, an AllWISE overlay can be requested in an image query():
Adding Photometric Information#
Providing positional information is already enough to generate corrected detections - but for photometric surveys like AllWISE, magnitude information can also be added by supplying a list of magnitude and magnitude error columns:
$ ATKsurvey set vizier allwise --mags W1mag W2mag W3mag W4mag --errors e_W1mag e_W2mag e_W3mag e_W4mag
from ATK.Config import SURVEY_CONFIG
SURVEY_CONFIG["vizier"]["allwise"]["mags"] = ["W1mag", "W2mag", "W3mag", "W4mag"]
SURVEY_CONFIG["vizier"]["allwise"]["errors"] = ["e_W1mag", "e_W2mag", "e_W3mag", "e_W4mag"]
This turns the AllWISE detection overlay into a photometric detection overlay, which scales marker sizes with magnitude and adds photometric information to the hover interaction:
Additional Survey File Operations#
Resetting the Survey File#
To reset the survey file to its default state:
$ ATKsurvey reset
from ATK.Config import SURVEY_CONFIG
SURVEY_CONFIG.reset()
Deleting an Alias#
To delete an alias (in this case the AllWISE alias created in this tutorial) from the survey file, either delete it from the commandline:
$ ATKsurvey del allwise
or set it to None:
from ATK.Config import SURVEY_CONFIG
SURVEY_CONFIG["vizier"]["allwise"] = None
Download this Tutorial
Total running time of the script: (0 minutes 4.919 seconds)