The Command Line

Now that we have seen how ATK can be used in scripts, we can have a look at its command-line integration. A good first example is the command-line version of query: ATKquery. The simple example of a Gaia data query can be performed via the command line with:

ATKquery data gaia --source 587316166180416640
Running gaia data query
source = 587316166180416640
pos = None
radius = 3.0

Available Jobs: showdata, savedata <filename: str, optional>, exit

Job?

Upon the successful retrieval of data, a more limited selection of the relevant data structure’s methods are available as “jobs”. In this case, we have access to the showdata() and savedata() methods.

Running gaia data query
source = 587316166180416640
pos = None
radius = 3.0

Available Jobs: showdata, savedata <filename: str, optional>, exit

Job? showdata

.kind:       data
.subkind:    data
.survey:     gaia
.catalogue:  I/355/gaiadr3
.source:     587316166180416640
.pos:        [141.1853304444077, 8.030834321974444]
.identifier: J092444.48+080151.00
.dataname:   J092444.48+080151.00_587316166180416640_gaia_ATKdata.fits
.trace:      start -> extracted pos from source query, assumed [2016, 0] -> [2000,0] -> end

.data:
    designation:                     ['Gaia DR3 587316166180416640']
    ra:                              [141.18526028]
    dec:                             [8.0308964]
    solution_id:                     [1636148068921376768]
    source_id:                       [587316166180416640]
    ...

Available Jobs: showdata, savedata <filename: str, optional>, exit

Job?

Jobs can be continuously entered until “exit” is entered, at which point the process stops. We can also target a system by its position:

ATKquery lightcurve ztf --pos 141.185 8.031
Running ztf lightcurve query
source = None
pos = [141.185, 8.031]
radius = 3.0

Available Jobs: showdata, savedata <filename: str, optional> showplot <filename: str, optional>, saveplot<filename: str, optional>, exit

Job? showplot
Plot Type? lightcurve
Plotting lightcurve data...
Saving plot to local storage: J092444.40+080150.88_ztf_ATKlightcurve.html

We can also read files from the command line using the ATKread command, for example if we want to read our data file from the previous tutorial:

ATKread test_data.fits
Recreating data from local storage: test_data.fits
Available Jobs: showdata, savedata <filename: str, optional>, exit

Job? showdata

.kind:       data
.subkind:    data
.survey:     galex
.catalogue:  II/335/galex_ais
.source:     587316166180416640
.pos:        [141.18528951298822, 8.030870532715186]
.identifier: J092444.47+080151.13
.dataname:   J092444.47+080151.13_587316166180416640_galex_ATKdata.fits
.trace:      start -> extracted pos from source query, assumed [2016, 0] -> galex: [2006, 8] -> galex query performed -> [2000,0] -> end

.data:
    RAJ2000:  [141.185551]
    DEJ2000:  [8.031037]
    Name:     ['GALEX J092444.5+080151']
    objid:    [6377741628902215075]
    FUVmag:   [19.6878]
    e_FUVmag: [0.113]
    NUVmag:   [19.5523]
    e_NUVmag: [0.0704]
    ...

Many other command line tools are available, some of which will be used in future sections. See Command-Line Tools for a full list and description of the available commands.