AstroToolkit 1.4.2__tar.gz → 1.5.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. astrotoolkit-1.5.1/PKG-INFO +1807 -0
  2. astrotoolkit-1.5.1/README.md +1782 -0
  3. {astrotoolkit-1.4.2 → astrotoolkit-1.5.1}/pyproject.toml +4 -4
  4. astrotoolkit-1.5.1/src/AstroToolkit/Config.py +33 -0
  5. astrotoolkit-1.5.1/src/AstroToolkit/Data/dataquery.py +549 -0
  6. astrotoolkit-1.5.1/src/AstroToolkit/Data/fetch_crts.py +113 -0
  7. astrotoolkit-1.5.1/src/AstroToolkit/Data/hrdquery.py +53 -0
  8. astrotoolkit-1.5.1/src/AstroToolkit/Data/imageoverlay.py +274 -0
  9. astrotoolkit-1.5.1/src/AstroToolkit/Data/imagequery.py +278 -0
  10. astrotoolkit-1.5.1/src/AstroToolkit/Data/lightcurvequery.py +818 -0
  11. astrotoolkit-1.5.1/src/AstroToolkit/Data/photquery.py +181 -0
  12. astrotoolkit-1.5.1/src/AstroToolkit/Data/reddeningquery.py +319 -0
  13. astrotoolkit-1.5.1/src/AstroToolkit/Data/rename_headers.py +237 -0
  14. astrotoolkit-1.5.1/src/AstroToolkit/Data/sedquery.py +101 -0
  15. astrotoolkit-1.5.1/src/AstroToolkit/Data/sigmaclip.py +112 -0
  16. astrotoolkit-1.5.1/src/AstroToolkit/Data/spectrumquery.py +64 -0
  17. astrotoolkit-1.5.1/src/AstroToolkit/DatapageElements/datapage_buttons.py +70 -0
  18. astrotoolkit-1.5.1/src/AstroToolkit/DatapageElements/metadata_table.py +121 -0
  19. astrotoolkit-1.5.1/src/AstroToolkit/Datapages.py +73 -0
  20. astrotoolkit-1.5.1/src/AstroToolkit/Examples/datapage.py +90 -0
  21. astrotoolkit-1.5.1/src/AstroToolkit/Examples/hrd.py +10 -0
  22. astrotoolkit-1.5.1/src/AstroToolkit/Examples/image.py +47 -0
  23. astrotoolkit-1.5.1/src/AstroToolkit/Examples/lightcurve.py +13 -0
  24. astrotoolkit-1.5.1/src/AstroToolkit/Examples/localfiles.py +16 -0
  25. astrotoolkit-1.5.1/src/AstroToolkit/Examples/sed.py +10 -0
  26. astrotoolkit-1.5.1/src/AstroToolkit/Examples/spectrum.py +8 -0
  27. astrotoolkit-1.5.1/src/AstroToolkit/Examples/timeseries.py +10 -0
  28. astrotoolkit-1.5.1/src/AstroToolkit/FileHandling/file_naming.py +17 -0
  29. astrotoolkit-1.5.1/src/AstroToolkit/FileHandling/file_reading.py +373 -0
  30. astrotoolkit-1.5.1/src/AstroToolkit/FileHandling/file_writing.py +213 -0
  31. astrotoolkit-1.5.1/src/AstroToolkit/Input/input_validation.py +684 -0
  32. astrotoolkit-1.5.1/src/AstroToolkit/Misc/coordinate_conversions.py +23 -0
  33. astrotoolkit-1.5.1/src/AstroToolkit/Misc/fitsfiles.py +34 -0
  34. astrotoolkit-1.5.1/src/AstroToolkit/Misc/gridsetup.py +95 -0
  35. astrotoolkit-1.5.1/src/AstroToolkit/Misc/identifier_generation.py +55 -0
  36. astrotoolkit-1.5.1/src/AstroToolkit/Misc/pmcorrection.py +174 -0
  37. astrotoolkit-1.5.1/src/AstroToolkit/Misc/search.py +59 -0
  38. astrotoolkit-1.5.1/src/AstroToolkit/Plotting/hrdplotting.py +124 -0
  39. astrotoolkit-1.5.1/src/AstroToolkit/Plotting/imageplotting.py +122 -0
  40. astrotoolkit-1.5.1/src/AstroToolkit/Plotting/lightcurveplotting.py +160 -0
  41. astrotoolkit-1.5.1/src/AstroToolkit/Plotting/plotmap.py +137 -0
  42. astrotoolkit-1.5.1/src/AstroToolkit/Plotting/sedplotting.py +109 -0
  43. astrotoolkit-1.5.1/src/AstroToolkit/Plotting/spectrumplotting.py +132 -0
  44. astrotoolkit-1.5.1/src/AstroToolkit/Timeseries/lomb_scargle.py +148 -0
  45. astrotoolkit-1.5.1/src/AstroToolkit/Timeseries/timeseries_formatting.py +31 -0
  46. astrotoolkit-1.5.1/src/AstroToolkit/Tools.py +375 -0
  47. astrotoolkit-1.5.1/src/AstroToolkit.egg-info/PKG-INFO +1807 -0
  48. astrotoolkit-1.5.1/src/AstroToolkit.egg-info/SOURCES.txt +53 -0
  49. {astrotoolkit-1.4.2 → astrotoolkit-1.5.1}/src/AstroToolkit.egg-info/requires.txt +1 -1
  50. astrotoolkit-1.4.2/PKG-INFO +0 -1420
  51. astrotoolkit-1.4.2/README.md +0 -1395
  52. astrotoolkit-1.4.2/src/AstroToolkit/Data/data.py +0 -250
  53. astrotoolkit-1.4.2/src/AstroToolkit/Data/imaging.py +0 -192
  54. astrotoolkit-1.4.2/src/AstroToolkit/Data/lightcurve_sigma_clip.py +0 -104
  55. astrotoolkit-1.4.2/src/AstroToolkit/Data/lightcurves.py +0 -602
  56. astrotoolkit-1.4.2/src/AstroToolkit/Data/overlays.py +0 -238
  57. astrotoolkit-1.4.2/src/AstroToolkit/Data/photometry.py +0 -60
  58. astrotoolkit-1.4.2/src/AstroToolkit/Data/reddening.py +0 -62
  59. astrotoolkit-1.4.2/src/AstroToolkit/Data/sed.py +0 -104
  60. astrotoolkit-1.4.2/src/AstroToolkit/Data/spectra.py +0 -62
  61. astrotoolkit-1.4.2/src/AstroToolkit/Datapages/buttons.py +0 -59
  62. astrotoolkit-1.4.2/src/AstroToolkit/Datapages/grid.py +0 -83
  63. astrotoolkit-1.4.2/src/AstroToolkit/Datapages/metadata.py +0 -202
  64. astrotoolkit-1.4.2/src/AstroToolkit/Examples/datapage_creation.py +0 -68
  65. astrotoolkit-1.4.2/src/AstroToolkit/Misc/ProperMotionCorrection.py +0 -76
  66. astrotoolkit-1.4.2/src/AstroToolkit/Misc/coord_conversion.py +0 -89
  67. astrotoolkit-1.4.2/src/AstroToolkit/Misc/database_queries.py +0 -32
  68. astrotoolkit-1.4.2/src/AstroToolkit/Misc/file_handling.py +0 -497
  69. astrotoolkit-1.4.2/src/AstroToolkit/Misc/file_naming.py +0 -143
  70. astrotoolkit-1.4.2/src/AstroToolkit/Misc/input_validation.py +0 -59
  71. astrotoolkit-1.4.2/src/AstroToolkit/Misc/read_fits.py +0 -82
  72. astrotoolkit-1.4.2/src/AstroToolkit/Plotting/HRD.py +0 -119
  73. astrotoolkit-1.4.2/src/AstroToolkit/Plotting/imaging.py +0 -162
  74. astrotoolkit-1.4.2/src/AstroToolkit/Plotting/lightcurves.py +0 -155
  75. astrotoolkit-1.4.2/src/AstroToolkit/Plotting/powspec.py +0 -85
  76. astrotoolkit-1.4.2/src/AstroToolkit/Plotting/sed.py +0 -76
  77. astrotoolkit-1.4.2/src/AstroToolkit/Plotting/spectra.py +0 -110
  78. astrotoolkit-1.4.2/src/AstroToolkit/Settings/__init__.py +0 -0
  79. astrotoolkit-1.4.2/src/AstroToolkit/Tools.py +0 -893
  80. astrotoolkit-1.4.2/src/AstroToolkit.egg-info/PKG-INFO +0 -1420
  81. astrotoolkit-1.4.2/src/AstroToolkit.egg-info/SOURCES.txt +0 -38
  82. {astrotoolkit-1.4.2 → astrotoolkit-1.5.1}/LICENSE +0 -0
  83. {astrotoolkit-1.4.2 → astrotoolkit-1.5.1}/MANIFEST.in +0 -0
  84. {astrotoolkit-1.4.2 → astrotoolkit-1.5.1}/setup.cfg +0 -0
  85. {astrotoolkit-1.4.2 → astrotoolkit-1.5.1}/src/AstroToolkit/Plotting/backdrop_hrd_allmags.fits +0 -0
  86. {astrotoolkit-1.4.2 → astrotoolkit-1.5.1}/src/AstroToolkit.egg-info/dependency_links.txt +0 -0
  87. {astrotoolkit-1.4.2 → astrotoolkit-1.5.1}/src/AstroToolkit.egg-info/top_level.txt +0 -0
@@ -0,0 +1,1807 @@
1
+ Metadata-Version: 2.1
2
+ Name: AstroToolkit
3
+ Version: 1.5.1
4
+ Summary: A package for the gathering and plotting of astronomical data.
5
+ Author-email: Ethan Moorfield <ethan.moorfield@hotmail.co.uk>
6
+ Project-URL: Homepage, https://github.com/WD-planets/AstroToolkit
7
+ Project-URL: Issues, https://github.com/WD-planets/AstroToolkit/issues
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Operating System :: OS Independent
10
+ Requires-Python: >=3.11
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: astropy==6.0.1
14
+ Requires-Dist: astroquery==0.4.7
15
+ Requires-Dist: bokeh==3.4.1
16
+ Requires-Dist: cmasher==1.8.0
17
+ Requires-Dist: matplotlib==3.8.4
18
+ Requires-Dist: importlib_resources==6.4.0
19
+ Requires-Dist: numpy==1.26.4
20
+ Requires-Dist: pandas==2.2.2
21
+ Requires-Dist: Requests==2.31.0
22
+ Requires-Dist: beautifulsoup4==4.12.3
23
+ Requires-Dist: scipy==1.13.0
24
+ Requires-Dist: selenium==4.21.0
25
+
26
+ # AstroToolkit
27
+
28
+ AstroToolkit (ATK) is a set of tools for fetching, plotting, and analysing astronomical data.
29
+
30
+ ## Features
31
+
32
+ ## Table of Contents
33
+
34
+ [**Installation**](#installation)
35
+
36
+ [**Introduction**](#introduction)
37
+
38
+ [**Modules**](#modules)
39
+
40
+ <br>
41
+
42
+ [AstroToolkit.Tools](#tools)
43
+
44
+ * [Query](#query)
45
+ * [Data Query](#dataquery)
46
+ * [Photometry Query](#photquery)
47
+ * [Bulk Photometry Query](#bulkphotquery)
48
+ * [Light Curve Query](#lightcurvequery)
49
+ * [Image Query](#imagequery)
50
+ * [Spectrum Query](#spectrumquery)
51
+ * [SED Query](#sedquery)
52
+ * [HRD Query](#hrdquery)
53
+ * [Reddening Query](#reddeningquery)
54
+ * [Proper Motion Correction](#correctpm)
55
+ * [Local File Saving](#savedata)
56
+ * [Local File Reading](#readdata)
57
+ * [SIMBAD/Vizier Searches](#search)
58
+ * [Fits Reading](#readfits)
59
+ * [Degrees to HMS](#deg2hms)
60
+ * [HMS to Degrees](#hms2deg)
61
+
62
+ <br>
63
+
64
+ [AstroToolkit.Datapages](#datapages)
65
+ * [Grid Setup](#gridsetup)
66
+ * [SIMBAD/Vizier Buttons](#buttons)
67
+ * [Datatables](#datatable)
68
+
69
+ <br>
70
+
71
+ [AstroToolkit.Config](#config)
72
+ * [Open Config File](#openconfig)
73
+ * [Edit Config File](#editconfig)
74
+ * [Output Config File](#outputconfig)
75
+ * [Reset Config File](#resetconfig)
76
+
77
+ <br>
78
+
79
+ [Code Examples](#examples)
80
+ * [Data Examples](#queryexamples)
81
+ * [Lightcurve Example](#lightcurveexample)
82
+ * [Timeseries Example](#timeseriesexample)
83
+ * [Image Example](#imageexample)
84
+ * [Spectrum Example](#spectrumexample)
85
+ * [SED Example](#sedexample)
86
+ * [HRD Example](#hrdexample)
87
+ * [Local File Example](#localfileexample)
88
+ * [Datapage Example](#datapageexample)
89
+
90
+ <br>
91
+
92
+ ## Installation<a id="installation"></a>
93
+
94
+ The package can be installed like any other package, e.g. using pip:
95
+
96
+ ```
97
+ pip install AstroToolkit
98
+ ```
99
+
100
+ <br>
101
+
102
+ ## Introduction<a id="introduction"></a>
103
+
104
+ ATK uses Bokeh as its primary plotting library. The official documentation can be found at [https://bokeh.org/](https://bokeh.org/). A key property of Bokeh plots is that they can be saved as static .html files, which can then be shared/accessed while retaining all interactivity.
105
+
106
+ Across ATK, there are two possible ways to target your system of interest:
107
+ 1. pos = [ra,dec] in degrees
108
+ 2. source = Gaia Source ID
109
+
110
+ Where possible, it is usually best to use a Gaia source as input, as this enables a key feature of ATK: **Proper Motion Correction**.
111
+
112
+ A good example of this is in imaging queries. If a 'pos' is used as input, the result will simply be the image data returned by the chosen imaging survey at those exact coordinates. However, this may not be ideal in the case of an object with a large proper motion. If a source is used instead, the data returned will have accounted for this, resulting in the image being centered on the target system. This concept is used throughout ATK when matching data from different surveys to a given system.
113
+
114
+ ![](https://github.com/WD-planets/AstroToolkit/raw/latest/README_Images/source_vs_pos.png?raw=true)
115
+
116
+ <br>
117
+
118
+ # Modules<a id="modules"></a>
119
+
120
+ There are currently three modules in ATK:
121
+
122
+ - AstroToolkit.Tools
123
+
124
+ - AstroToolkit.Config
125
+
126
+ - AstroToolkit.Datapages
127
+
128
+ <br>
129
+
130
+ In all functions, parameters with a ! proceeding them will be taken from the [config](#config) if absent.
131
+
132
+ In all plots, legends are hideable by double-clicking, and individual elements can be hidden by clicking them in the legend.
133
+
134
+ <br>
135
+
136
+ ## AstroToolkit.Tools<a id="tools"></a>
137
+
138
+ ### 1. query<a id="query"></a>
139
+
140
+ **Usage:**
141
+
142
+ ```
143
+ query(kind, *)
144
+ ```
145
+
146
+ **Where:**
147
+
148
+
149
+ ```
150
+ kind: str = kind of query to perform
151
+ Can be one of:
152
+ - 'data': return raw data from any Vizier catalogue
153
+ - 'phot': return only photometry from any supported survey
154
+ - 'bulkphot': return all available photometry from all supported surveys
155
+ - 'lightcurve': return light curve data from any supported survey
156
+ - 'image': return image data from any supported survey
157
+ - 'spectrum': return spectrum data from any supported survey
158
+ - 'sed': return spectral energy distribution data from all supported surveys
159
+ - 'hrd': return Gaia Hertzsprung Russell Diagram data for a set of Gaia sources
160
+ - 'reddening': return reddening data from any supported survey
161
+ ```
162
+
163
+ Each kind of query accepts/requires various other parameters.
164
+
165
+ If no data is returned in any kind of query, the *data* attribute will be set to None.
166
+
167
+ <br>
168
+
169
+ **The data returned by lightcurve, image, spectrum, sed and hrd queries can be plotted using the method *plot()* on the returned class. The resulting plot can then be shown using the method *show()* (which will also save the data locally) or just saved locally using the method *save()*.**
170
+
171
+ <br>
172
+
173
+ #### 1.1. data query<a id="dataquery"></a>
174
+
175
+ **Additional Parameters:**
176
+
177
+ ```
178
+ survey: str = target survey
179
+ Can be one of:
180
+ - 'gaia'
181
+ - 'panstarrs'
182
+ - 'skymapper'
183
+ - 'galex'
184
+ - 'sdss'
185
+ - 'wise'
186
+ - 'twomass'
187
+ - 'rosat'
188
+ - 'erosita'
189
+ - any other Vizier catalogue ID. E.g. for Gaia DR3, the catalogue ID would be 'I/355/gaiadr3'
190
+ ```
191
+
192
+ ```
193
+ !radius: int = search radius in arcseconds
194
+ ```
195
+
196
+ Additionally, requires one of:
197
+
198
+ ```
199
+ pos: list = [right ascension (deg), declination (deg)], target position
200
+ ```
201
+
202
+ ```
203
+ source: int = Gaia DR3 source_id.
204
+ Target Gaia DR3 source
205
+ ```
206
+
207
+ **Returns:**
208
+
209
+ ```
210
+ DataStruct: class = ATK Data Structure
211
+ ```
212
+
213
+ *Attributes:*
214
+
215
+ ```
216
+ kind: str = 'data'
217
+ ```
218
+
219
+ ```
220
+ subkind: str = kind of query (as listed above)
221
+ ```
222
+
223
+ ```
224
+ survey: str = target survey of query
225
+ ```
226
+
227
+ ```
228
+ catalogue: str = target Vizier catalogue
229
+ ```
230
+
231
+ ```
232
+ source: int = target Gaia DR3 source
233
+ ```
234
+
235
+ ```
236
+ pos: list = target position
237
+ ```
238
+
239
+ ```
240
+ identifier: str = positional identifier of target in format JHHMMSS.SS±DDMMSS.SS
241
+ ```
242
+
243
+ ```
244
+ data: dict = returned data, where:
245
+ keys: str = column headers as given in Vizier (except for Gaia queries where they are the original column names)
246
+ values: list = returned rows
247
+ ```
248
+
249
+ *Methods:*
250
+ None
251
+
252
+ <br>
253
+
254
+ #### 1.2. phot query<a id="photquery"></a>
255
+
256
+ **Additional Parameters:**
257
+
258
+ ```
259
+ survey: str = target survey
260
+ Can be one of:
261
+ - 'gaia'
262
+ - 'panstarrs'
263
+ - 'skymapper'
264
+ - 'galex'
265
+ - 'sdss'
266
+ - 'wise'
267
+ - 'twomass'
268
+ ```
269
+
270
+ ```
271
+ !radius: int = search radius in arcseconds
272
+ ```
273
+
274
+ Additionally, requires one of:
275
+
276
+ ```
277
+ pos: list = [right ascension (deg), declination (deg)], target position
278
+ ```
279
+
280
+ ```
281
+ source: int = Gaia DR3 source_id.
282
+ Target Gaia DR3 source
283
+ ```
284
+
285
+ **Returns:**
286
+
287
+ ```
288
+ DataStruct: class = ATK Data Structure
289
+ ```
290
+
291
+ *Attributes:*
292
+
293
+ ```
294
+ kind: str = 'data'
295
+ ```
296
+
297
+ ```
298
+ subkind: str = kind of query (as listed above)
299
+ ```
300
+
301
+ ```
302
+ survey: str = target survey of query
303
+ ```
304
+
305
+ ```
306
+ catalogue: str = target Vizier catalogue
307
+ ```
308
+
309
+ ```
310
+ source: int = target Gaia DR3 source
311
+ ```
312
+
313
+ ```
314
+ pos: list = target position
315
+ ```
316
+
317
+ ```
318
+ identifier: str = positional identifier of target in format JHHMMSS.SS±DDMMSS.SS
319
+ ```
320
+
321
+ ```
322
+ data: dict = returned data, where:
323
+ keys: str = column headers as given in Vizier (except for Gaia queries where they are the original column names)
324
+ values: list = returned rows
325
+ ```
326
+
327
+ *Methods:*
328
+ None
329
+
330
+ <br>
331
+
332
+ #### 1.3. bulkphot query<a id="bulkphotquery"></a>
333
+
334
+ Retrieves photometry from all surveys supported by phot query.
335
+
336
+ **Additional Parameters:**
337
+
338
+
339
+ ```
340
+ !radius: int = search radius in arcseconds
341
+ ```
342
+
343
+ Additionally, requires one of:
344
+
345
+ ```
346
+ pos: list = [right ascension (deg), declination (deg)], target position
347
+ ```
348
+
349
+ ```
350
+ source: int = Gaia DR3 source_id.
351
+ Target Gaia DR3 source
352
+ ```
353
+
354
+ **Returns:**
355
+
356
+ ```
357
+ DataStruct: class = ATK Data Structure
358
+ ```
359
+
360
+ *Attributes:*
361
+
362
+ ```
363
+ kind: str = 'data'
364
+ ```
365
+
366
+ ```
367
+ subkind: str = kind of query (as listed above)
368
+ ```
369
+
370
+ ```
371
+ survey: str = target survey of query
372
+ ```
373
+
374
+ ```
375
+ catalogue: str = target Vizier catalogue
376
+ ```
377
+
378
+ ```
379
+ source: int = target Gaia DR3 source
380
+ ```
381
+
382
+ ```
383
+ pos: list = target position
384
+ ```
385
+
386
+ ```
387
+ identifier: str = positional identifier of target in format JHHMMSS.SS±DDMMSS.SS
388
+ ```
389
+
390
+ ```
391
+ data: dict = returned data, where:
392
+ keys: str = survey supported by phot query
393
+ values: dict where:
394
+ keys: str = column headers as given in Vizier (except for Gaia queries where they are the original column names)
395
+ values: list = returned rows
396
+ ```
397
+
398
+ *Methods:*
399
+ None
400
+
401
+ <br>
402
+
403
+ #### 1.4. lightcurve query<a id="lightcurvequery"></a>
404
+
405
+ **Additional Parameters:**
406
+
407
+ ```
408
+ survey: str = target survey
409
+ Can be one of:
410
+ - 'ztf'
411
+ - 'atlas'
412
+ - 'crts'
413
+ - 'asassn'
414
+ - 'gaia'
415
+ ```
416
+
417
+ ```
418
+ !radius: int = search radius in arcseconds
419
+ ```
420
+
421
+ ```
422
+ !username: str = ATLAS username for use in ATLAS queries
423
+ ```
424
+
425
+ ```
426
+ !password: str = ATLAS password for use in ATLAS queries
427
+ ```
428
+
429
+ Additionally, requires one of:
430
+
431
+ ```
432
+ pos: list = [right ascension (deg), declination (deg)]
433
+ Position around which to search
434
+ ```
435
+
436
+ ```
437
+ source: int = Gaia DR3 source_id.
438
+ Target Gaia DR3 source
439
+ ```
440
+
441
+ **Returns:**
442
+
443
+ ```
444
+ LightcurveStruct: class = ATK Lightcurve Structure
445
+ ```
446
+
447
+ *Attributes:*
448
+
449
+ ```
450
+ kind: str = 'lightcurve'
451
+ ```
452
+
453
+ ```
454
+ survey: str = target survey of query
455
+ ```
456
+
457
+ ```
458
+ source: int = target Gaia DR3 source
459
+ ```
460
+
461
+ ```
462
+ pos: list = target position
463
+ ```
464
+
465
+ ```
466
+ identifier: str = positional identifier of target in format JHHMMSS.SS±DDMMSS.SS
467
+ ```
468
+
469
+ ```
470
+ data: list = list of returned data in each band, with each entry taking the form:
471
+ {
472
+ 'band': str = light curve band
473
+ 'ra': float = right ascension (deg)
474
+ 'dec': float = declination (deg)
475
+ 'hjd'/'mjd': float = HJD/MJD given by survey, with minimum subtracted (starts at zero)
476
+ 'hjd_ori'/'mjd_ori' = original HJD/MJD as given by survey
477
+ 'mag': float = magnitude
478
+ 'mag_err': float = magnitude error
479
+ }
480
+
481
+ Here, supported surveys have the bands:
482
+ - ztf: g,r,i
483
+ - atlas: o,c,i
484
+ - gaia: g,bp,rp
485
+ - asassn: g,v
486
+ - crts: v
487
+ ```
488
+
489
+ *Methods:*
490
+
491
+ ```
492
+ plot() - plots lightcurve data.
493
+ Returns the original data class with modified attributes:
494
+ - figure: bokeh figure = the actual plot object
495
+ - filename: str = the default file name that the plot will be saved to
496
+
497
+ Arguments:
498
+ - kind: str = kind of plot to produce
499
+ Can be one of:
500
+ - 'lightcurve' - light curve (default)
501
+ - 'powspec' - Lomb-Scargle power spectrum
502
+ - 'phase' - phase folded light curve using Lomb-Scargle
503
+
504
+ Additional Arguments:
505
+ For lightcurve plots:
506
+ - colours: list = colour to plot each band that returned data. Defaults to black for all bands.
507
+ - bands: list = bands to include. Includes all by default.
508
+
509
+ For phase fold plots:
510
+ - freq: float = frequency on which to fold the lightcurve data. If none is given, it will be folded on the peak Lomb-Scargle frequency.
511
+ ```
512
+
513
+ ```
514
+ sigmaclip() - sigma clips lightcurve data
515
+
516
+ Arguments:
517
+ - sigma: int = number of standard deviations beyond which data is clipped. Default is 3.
518
+ ```
519
+
520
+ ```
521
+ show() - shows the plot created by the plot() method (and also saves it locally)
522
+ ```
523
+
524
+ ```
525
+ save() - saves the plot created by the plot() method to local storage.
526
+ ```
527
+
528
+ <br>
529
+
530
+ #### 1.5. image query<a id="imagequery"></a>
531
+
532
+ **Additional Parameters:**
533
+
534
+ ```
535
+ survey: str = target survey
536
+ Can be one of:
537
+ - 'panstarrs'
538
+ - 'skymapper'
539
+ - 'dss'
540
+ - 'any', performs a hierarchical query: panstarrs > skymapper > dss until an image is found
541
+ ```
542
+
543
+ ```
544
+ !size: int = size of image in arcseconds
545
+ ```
546
+
547
+ ```
548
+ !band: str = bands to use in image. Default is g.
549
+ Supported bands:
550
+ - panstarrs: g,r,i,z,y
551
+ - skymapper: g,r,i,z,u,v
552
+ - dss: g
553
+
554
+ e.g. for all panstarrs bands, use band='grizy'
555
+ ```
556
+
557
+ ```
558
+ !overlays: list/dict = surveys to generate detection overlays for.
559
+
560
+ If list, can be one of:
561
+ - any survey supported by data query
562
+ - any survey supported by lightcurve query
563
+ and uses only the magnitude specified in the config for that survey
564
+
565
+ If dict:
566
+ keys are the survey to include, can be one of:
567
+ - any survey supported by phot query
568
+ values are the magnitudes to use from that survey
569
+
570
+ E.g. to use all Gaia magnitudes: overlays={'gaia':['phot_g_mean_mag','phot_bp_mean_mag','phot_rp_mean_mag']}
571
+ ```
572
+
573
+ Additionally, requires one of:
574
+
575
+ ```
576
+ pos: list = [right ascension (deg), declination (deg)]
577
+ Position around which to search
578
+ ```
579
+
580
+ ```
581
+ source: int = Gaia DR3 source_id.
582
+ Target Gaia DR3 source
583
+ ```
584
+
585
+ **Returns:**
586
+
587
+ ```
588
+ ImageStruct: class = ATK Image Structure
589
+ ```
590
+
591
+ *Attributes:*
592
+
593
+ ```
594
+ kind: str = 'image'
595
+ ```
596
+
597
+ ```
598
+ survey: str = target survey of query
599
+ ```
600
+
601
+ ```
602
+ source: int = target Gaia DR3 source
603
+ ```
604
+
605
+ ```
606
+ pos: target position
607
+ ```
608
+
609
+ ```
610
+ identifier: str = positional identifier of target in format JHHMMSS.SS±DDMMSS.SS
611
+ ```
612
+
613
+ ```
614
+ data: dict = returned data in the form:
615
+ {
616
+ 'image_data': arr = raw image data
617
+ 'image_header': astropy image header
618
+ 'size': int = input image size
619
+ 'image_time': list = [year,month], time at which image was taken
620
+ 'wcs': astropy wcs object
621
+ 'image_focus': list = [right ascension (deg),declination (deg)], image center coordinates
622
+ 'overlay': list or None = list of detection information to overlay in image plotting
623
+ }
624
+ ```
625
+
626
+ *Methods:*
627
+
628
+ ```
629
+ plot() - plots image data.
630
+ Returns the original data class with modified attributes:
631
+ - figure: bokeh figure = the actual plot object
632
+ - filename: str = the default file name that the plot will be saved to
633
+ ```
634
+
635
+ ```
636
+ show() - shows the plot created by the plot() method (and also saves it locally)
637
+ ```
638
+
639
+ ```
640
+ save() - saves the plot created by the plot() method to local storage.
641
+ ```
642
+
643
+ <br>
644
+
645
+ #### 1.6. spectrum query<a id="spectrumquery"></a>
646
+
647
+ **Additional Parameters:**
648
+
649
+ ```
650
+ survey: str = target survey
651
+ Can be one of:
652
+ - 'ztf'
653
+ - 'atlas'
654
+ - 'crts'
655
+ - 'asassn'
656
+ - 'gaia'
657
+ ```
658
+
659
+ ```
660
+ !radius: int = search radius in arcseconds
661
+ ```
662
+
663
+ Additionally, requires one of:
664
+
665
+ ```
666
+ pos: list = [right ascension (deg), declination (deg)]
667
+ Position around which to search
668
+ ```
669
+
670
+ ```
671
+ source: int = Gaia DR3 source_id.
672
+ Target Gaia DR3 source
673
+ ```
674
+
675
+ **Returns:**
676
+
677
+ ```
678
+ SpectrumStruct: class = ATK Spectrum Structure
679
+ ```
680
+
681
+ *Attributes:*
682
+
683
+ ```
684
+ kind: str = 'spectrum'
685
+ ```
686
+
687
+ ```
688
+ survey: str = target survey of query
689
+ ```
690
+
691
+ ```
692
+ source: int = target Gaia DR3 source
693
+ ```
694
+
695
+ ```
696
+ pos: list = target position
697
+ ```
698
+
699
+ ```
700
+ identifier: str = positional identifier of target in format JHHMMSS.SS±DDMMSS.SS
701
+ ```
702
+
703
+ ```
704
+ data: dict = returned data in the form:
705
+ {
706
+ 'wavelength': list = wavelengths (Angstroms)
707
+ 'flux': list = flux values (erg / cm^2 s AA^-1)
708
+ }
709
+ ```
710
+
711
+ *Methods:*
712
+
713
+ ```
714
+ plot() - plots spectrum data.
715
+ Returns the original data class with modified attributes:
716
+ - figure: bokeh figure = the actual plot object
717
+ - filename: str = the default file name that the plot will be saved to
718
+ ```
719
+
720
+ ```
721
+ show() - shows the plot created by the plot() method (and also saves it locally)
722
+ ```
723
+
724
+ ```
725
+ save() - saves the plot created by the plot() method to local storage.
726
+ ```
727
+
728
+ <br>
729
+
730
+ #### 1.7. sed query<a id="sedquery"></a>
731
+
732
+ **Additional Parameters:**
733
+
734
+ ```
735
+ !radius: int = search radius in arcseconds
736
+ ```
737
+
738
+ Additionally, requires one of:
739
+
740
+ ```
741
+ pos: list = [right ascension (deg), declination (deg)]
742
+ Position around which to search
743
+ ```
744
+
745
+ ```
746
+ source: int = Gaia DR3 source_id.
747
+ Target Gaia DR3 source
748
+ ```
749
+
750
+ **Returns:**
751
+
752
+ ```
753
+ SedStruct: class = ATK SED Structure
754
+ ```
755
+
756
+ *Attributes:*
757
+
758
+ ```
759
+ kind: str = 'sed'
760
+ ```
761
+
762
+ ```
763
+ source: int = target Gaia DR3 source
764
+ ```
765
+
766
+ ```
767
+ pos: list = target position
768
+ ```
769
+
770
+ ```
771
+ identifier: str = positional identifier of target in format JHHMMSS.SS±DDMMSS.SS
772
+ ```
773
+
774
+ ```
775
+ data: list = list of returned data for each survey with each entry in the form:
776
+ {
777
+ 'survey': str = survey of data points
778
+ 'wavelength': list = central filter wavelengths (Angstroms)
779
+ 'flux': list = flux (mJy)
780
+ 'flux_err': list = relative error on the flux (as calculated from magnitudes) (mJy)
781
+ }
782
+ ```
783
+
784
+ *Methods:*
785
+
786
+ ```
787
+ plot() - plots SED data.
788
+ Returns the original data class with modified attributes:
789
+ - figure: bokeh figure = the actual plot object
790
+ - filename: str = the default file name that the plot will be saved to
791
+
792
+ Additional Arguments:
793
+ - spectrum_overlay: Bool = overlays a spectrum where available
794
+ - survey: str = survey to retrieve the spectrum from
795
+
796
+ ```
797
+
798
+ ```
799
+ show() - shows the plot created by the plot() method (and also saves it locally)
800
+ ```
801
+
802
+ ```
803
+ save() - saves the plot created by the plot() method to local storage.
804
+ ```
805
+
806
+ <br>
807
+
808
+ #### 1.8. hrd query<a id="hrdquery"></a>
809
+
810
+ **Additional Parameters:**
811
+
812
+ ```
813
+ sources: int/list = Gaia DR3 source or list of Gaia DR3 sources to overlay.
814
+ ```
815
+
816
+ **Returns:**
817
+
818
+ ```
819
+ HrdStruct: class = ATK HRD Structure
820
+ ```
821
+
822
+ *Attributes:*
823
+
824
+ ```
825
+ kind: str = 'hrd'
826
+ ```
827
+
828
+ ```
829
+ sources: int/list = Gaia DR3 source/Gaia DR3 sources
830
+ ```
831
+
832
+ ```
833
+ identifiers: str / list = positional identifier of target in format JHHMMSS.SS±DDMMSS.SS (list if multiple sources)
834
+ ```
835
+
836
+ ```
837
+ data: list = list of returned data for each survey with each entry in the form:
838
+ {
839
+ 'bp-rp': gaia bp magnitude - gaia rp magnitude
840
+ 'absg': absolute gaia g magnitude
841
+ }
842
+ ```
843
+
844
+ *Methods:*
845
+
846
+ ```
847
+ plot() - plots HRD data.
848
+ Returns the original data class with modified attributes:
849
+ - figure: bokeh figure = the actual plot object
850
+ - filename: str = the default file name that the plot will be saved to
851
+ ```
852
+
853
+ ```
854
+ show() - shows the plot created by the plot() method (and also saves it locally)
855
+ ```
856
+
857
+ ```
858
+ save() - saves the plot created by the plot() method to local storage.
859
+ ```
860
+
861
+ <br>
862
+
863
+ #### 1.9. reddening query<a id="reddeningquery"></a>
864
+
865
+ **Additional Parameters:**
866
+
867
+ ```
868
+ survey: str = target survey
869
+ Can be one of:
870
+ - 'stilism'
871
+ - 'gdre'
872
+ ```
873
+
874
+ ```
875
+ !radius: int = search radius in arcseconds
876
+ ```
877
+
878
+ Additionally, requires one of:
879
+
880
+ ```
881
+ pos: list = [right ascension (deg), declination (deg)], target position
882
+ ```
883
+
884
+ ```
885
+ source: int = Gaia DR3 source_id.
886
+ Target Gaia DR3 source
887
+ ```
888
+
889
+ **Note:** For stilism queries, source input is required as a parallax is needed for distance calculations.
890
+
891
+ **Returns:**
892
+
893
+ ```
894
+ DataStruct: class = ATK Data Structure
895
+ ```
896
+
897
+ *Attributes:*
898
+
899
+ ```
900
+ kind: str = 'data'
901
+ ```
902
+
903
+ ```
904
+ subkind: str = kind of query (as listed above)
905
+ ```
906
+
907
+ ```
908
+ survey: str = target survey of query
909
+ ```
910
+
911
+ ```
912
+ catalogue: str = None
913
+ ```
914
+
915
+ ```
916
+ source: int = target Gaia DR3 source
917
+ ```
918
+
919
+ ```
920
+ pos: list = target position
921
+ ```
922
+
923
+ ```
924
+ identifier: str = positional identifier of target in format JHHMMSS.SS±DDMMSS.SS
925
+ ```
926
+
927
+ ```
928
+ data: dict = returned data, where:
929
+ keys: str = column headers
930
+ values : float = column values
931
+ ```
932
+
933
+ *Methods:*
934
+ None
935
+
936
+ <br>
937
+
938
+ ### 2. correctpm<a id="correctpm"></a>
939
+
940
+ Automatically corrects for proper motion between two surveys or two times for a given Gaia DR3 source *or* position if proper motion measurements also provided.
941
+
942
+ **Usage:**
943
+
944
+ ```
945
+ correctpm(*)
946
+ ```
947
+
948
+ With any valid combination of input parameters:
949
+ ```
950
+ source: int = Gaia DR3 source_id
951
+
952
+ target_time: list = [year,month], time to correct source's coordinates to
953
+ ```
954
+
955
+ ```
956
+ source: int = Gaia DR3 source_id
957
+
958
+ target_survey: str = survey to correct source's coordinates to=
959
+ Can be one of:
960
+ - any survey supported by data query
961
+ - any survey supported by lightcurve query
962
+ ```
963
+
964
+ ```
965
+ pos: list = [right ascension (deg), declination (deg)], target position
966
+
967
+ input_time: list = [year,month], time of object's input position
968
+
969
+ target_time: list = [year, month] time to correct position to
970
+
971
+ pmra: float = right ascension component of proper motion in mas/yr
972
+
973
+ pmdec: float = declination component of proper motion in mas/yr
974
+ ```
975
+
976
+ ```
977
+ pos: list = [right ascension (deg), declination (deg)], target position
978
+
979
+ input_survey: str = survey to which position refers
980
+ Can be one of:
981
+ - any survey supported by data query
982
+ - any survey supported by lightcurve query
983
+
984
+ target_survey: str = survey to correct position to.
985
+ Can be one of:
986
+ - any survey supported by data query
987
+ - any survey supported by lightcurve query
988
+
989
+ pmra: float = right ascension component of proper motion in mas/yr
990
+
991
+ pmdec: float = declination component of proper motion in mas/yr
992
+
993
+ ```
994
+
995
+ **Returns:**
996
+
997
+ ```
998
+ position: list = [right ascension (deg), declination (deg)], corrected coordinates of input source/position
999
+ ```
1000
+
1001
+ <br>
1002
+
1003
+ ### 3. savedata<a id="savedata"></a>
1004
+
1005
+ Allows for lossless saving of any ATK data structure to local storage.
1006
+
1007
+ **Usage:**
1008
+
1009
+ ```
1010
+ savedata(data)
1011
+ ```
1012
+
1013
+ **Where:**
1014
+
1015
+ ```
1016
+ data: class = any ATK data structure returned by any kind of query
1017
+ ```
1018
+
1019
+ **Returns:**
1020
+
1021
+ ```
1022
+ fname: str = file name that data was saved to
1023
+ ```
1024
+
1025
+ <br>
1026
+
1027
+ ### 4. readdata<a id="readdata"></a>
1028
+
1029
+ Allows for reading of any ATK files to reproduce the original data structure.
1030
+
1031
+ **Usage:**
1032
+
1033
+ ```
1034
+ readdata(fname)
1035
+ ```
1036
+
1037
+ **Where:**
1038
+
1039
+ ```
1040
+ fname: str = name of file to read
1041
+ ```
1042
+
1043
+ **Returns:**
1044
+
1045
+ ```
1046
+ Data Structure: class = ATK data structure that was used to create the file
1047
+ ```
1048
+
1049
+ <br>
1050
+
1051
+ ### 5. search<a id="search"></a>
1052
+
1053
+ Searches for a given position or Gaia DR3 source in SIMBAD or Vizier (opens in the webbrowser)
1054
+
1055
+ **Usage:**
1056
+
1057
+ ```
1058
+ search(kind, !radius, *)
1059
+ ```
1060
+
1061
+ **Where:**
1062
+
1063
+ ```
1064
+ kind: str = search type
1065
+ Can be one of:
1066
+ - 'simbad'
1067
+ - 'vizier'
1068
+ ```
1069
+
1070
+ ```
1071
+ !radius: int = search radius
1072
+ ```
1073
+
1074
+ Additionally, requires one of:
1075
+
1076
+ ```
1077
+ pos: list = [right ascension (deg), declination (deg)]
1078
+ Position around which to search
1079
+ ```
1080
+
1081
+ ```
1082
+ source: int = Gaia DR3 source_id.
1083
+ Target Gaia DR3 source
1084
+ ```
1085
+
1086
+ **Returns:** None
1087
+
1088
+ <br>
1089
+
1090
+ ### 6. readfits<a id="readfits"></a>
1091
+
1092
+ Reads columns from a given fits file.
1093
+
1094
+ **Usage:**
1095
+
1096
+ ```
1097
+ readfits(fname,columns)
1098
+ ```
1099
+
1100
+ **Where:**
1101
+
1102
+ ```
1103
+ fname: str = path to a .fits file
1104
+ ```
1105
+
1106
+ ```
1107
+ columns: str/list = columns to fetch from fits file
1108
+ ```
1109
+
1110
+ **Returns:**
1111
+
1112
+ ```
1113
+ data: list = list of returned data, in order it was asked for.
1114
+ E.g. for columns =['ra','dec'], returned data = [[returned ra],[returned dec]]
1115
+ ```
1116
+
1117
+ <br>
1118
+
1119
+ ### 6. deg2hms<a id="deg2hms"></a>
1120
+
1121
+ Converts coordinates in degrees to coordinates in HHMMSS±DDMMSS
1122
+
1123
+ **Usage:**
1124
+
1125
+ ```
1126
+ deg2hms(pos)
1127
+ ```
1128
+
1129
+ **Where:**
1130
+
1131
+ ```
1132
+ pos: list = [right ascension (deg), declination (deg)], coordinates to convert
1133
+ ```
1134
+
1135
+ **Returns:**
1136
+
1137
+ ```
1138
+ converted coordinates: str = string representing converted coordinates in above format
1139
+ ```
1140
+
1141
+ <br>
1142
+
1143
+ #### 7. hms2deg<a id="hms2deg"></a>
1144
+
1145
+ Converts coordinates in format returned by deg2hms (HHMMSS±DDMMSS)
1146
+
1147
+ **Usage:**
1148
+
1149
+ ```
1150
+ hms2deg(pos)
1151
+ ```
1152
+
1153
+ **Where:**
1154
+
1155
+ ```
1156
+ pos: str = position in format given above
1157
+ ```
1158
+
1159
+ **Returns:**
1160
+
1161
+ ```
1162
+ converted coordinates: list = [right ascension (deg), declination (deg)]
1163
+ ```
1164
+
1165
+ <br>
1166
+
1167
+ ## AstroToolkit.Datapages<a id="datapages"></a>
1168
+
1169
+ ### 1.gridsetup<a id="gridsetup"></a>
1170
+
1171
+ **Usage:**
1172
+
1173
+ ```
1174
+ gridsetup(dimensions,plots,!grid_size)
1175
+ ```
1176
+
1177
+ **Where:**
1178
+
1179
+ ```
1180
+ dimensions: dict = total dimensions of grid in form {'width': int, 'height': int}
1181
+ ```
1182
+
1183
+ ```
1184
+ plots: list = list of dicts, where each dict forms a panel in the datapage:
1185
+
1186
+ {
1187
+ 'name': name to assign to the plot
1188
+ 'figure': The figure to give this panel. This can take the form of:
1189
+ - an ATK DataStructure (that has had plot() performed on it)
1190
+ - a Bokeh figure
1191
+ - None (to fill empty space)
1192
+ 'width': width of the panel in grid units
1193
+ 'height': height of the panel in grid units
1194
+ }
1195
+ ```
1196
+
1197
+ **Note:** The total area covered by panels must match the area specified by *dimensions*. Empty space must therefore be filled with empty space (entries with *None* in place of a figure).
1198
+
1199
+ ```
1200
+ !grid_size: int = the size that each grid unit represents
1201
+ ```
1202
+
1203
+ <br>
1204
+
1205
+ See [Examples](#examples) for an example datapage script.
1206
+
1207
+ <br>
1208
+
1209
+ ### 2. buttons<a id="buttons"></a>
1210
+
1211
+ Generates a datapage element containing two buttons for Vizier/Simbad queries at the position/source the datapage is built around.
1212
+
1213
+ **Usage:**
1214
+
1215
+ ```
1216
+ buttons(!radius, !grid_size, *)
1217
+ ```
1218
+
1219
+ **Where:**
1220
+
1221
+ ```
1222
+ !radius: float = radius to use in the search in arcseconds
1223
+ ```
1224
+
1225
+ ```
1226
+ !grid_size: int = the grid_size of the datapage. Scales the buttons to match.
1227
+ ```
1228
+
1229
+ Additionally, requires one of:
1230
+
1231
+ ```
1232
+ pos: list = [right ascension (deg), declination (deg)]
1233
+ Position around which to search
1234
+ ```
1235
+
1236
+ ```
1237
+ source: int = Gaia DR3 source_id.
1238
+ ```
1239
+
1240
+ <br>
1241
+
1242
+ ### 3. datatable<a id="datatable"></a>
1243
+
1244
+ Generates a datatable datapage element using data from supported surveys, along with any custom data.
1245
+
1246
+ **Usage:**
1247
+
1248
+ ```
1249
+ datatable(selection, !radius, *)
1250
+ ```
1251
+
1252
+ **Where:**
1253
+
1254
+ ```
1255
+ !radius: float = radius to use when gathering datatable data in arcseconds
1256
+ ```
1257
+
1258
+ and
1259
+
1260
+ ```
1261
+ selection: dict = datatable entry in the format:
1262
+
1263
+ 'survey' : 'default'
1264
+
1265
+ to include basic preset information for a given survey, or:
1266
+
1267
+ 'survey' : {
1268
+ 'parameters' : list of strings, names of parameters (i.e. column headers) that exist in that survey
1269
+ 'errors' : list of strings, names of errors (i.e. column headers) for these parameters that exist in that survey
1270
+ 'notes' : list of strings, any notes to include on this parameter/error/etc.
1271
+ }
1272
+
1273
+ where 'survey' is any survey supported by dataquery.
1274
+ ```
1275
+
1276
+ If an entry is provided who's key is not the name of a supported survey, that entry will be interpreted as a custom entry. In this case, an additional 'values' key must be included, and the values/errors must be passed manually. For example:
1277
+
1278
+ ```
1279
+ selection: dict = custom datatable entry in the format
1280
+
1281
+ 'custom' : {
1282
+ 'parameters' : list of strings, names of parameters
1283
+ 'values' : list of floats, parameter values
1284
+ 'errors' : list of floats, error values
1285
+ 'notes' : list of strings, any notes to include on this parameter.
1286
+ }
1287
+ ```
1288
+
1289
+ Additionally, requires one of:
1290
+
1291
+ ```
1292
+ pos: list = [right ascension (deg), declination (deg)]
1293
+ Position around which to search
1294
+ ```
1295
+
1296
+ ```
1297
+ source: int = Gaia DR3 source_id.
1298
+ ```
1299
+
1300
+ <br>
1301
+
1302
+ See [Examples](#examples) for an example datapage script.
1303
+
1304
+ <br>
1305
+
1306
+ ## AstroToolkit.Config<a id="config"></a>
1307
+
1308
+ ### 1. openconfig<a id="openconfig"></a>
1309
+
1310
+ **Usage:**
1311
+
1312
+ ```
1313
+ openconfig()
1314
+ ```
1315
+
1316
+ Opens the ATK config file for manual editing.
1317
+
1318
+ **Returns:**
1319
+ None
1320
+
1321
+ <br>
1322
+
1323
+ ### 2. editconfig<a id="editconfig"></a>
1324
+
1325
+ **Usage:**
1326
+
1327
+ ```
1328
+ editconfig(key,value)
1329
+ ```
1330
+
1331
+ **Where:**
1332
+
1333
+ ```
1334
+ key: str = a valid config key
1335
+ Can be one of:
1336
+ - 'enable_notifications' = True/False
1337
+ enables notifications of the currently running tool
1338
+
1339
+ - 'unit_size' = int
1340
+ scales all ATK plots
1341
+
1342
+
1343
+ - 'query_data_radius' = float
1344
+ sets the default data query radius in arcseconds
1345
+
1346
+ - 'query_phot_radius' = float
1347
+ sets the default phot query radius in arcseconds
1348
+
1349
+ - 'query_bulkphot_radius' = float
1350
+ sets the default bulkphot query radius in arcseconds
1351
+
1352
+ - 'query_lightcurve_radius' = float
1353
+ sets the default lightcurve query radius in arcseconds
1354
+
1355
+ - 'query_spectrum_radius' = float
1356
+ sets the default spectrum query radius in arcseconds
1357
+
1358
+ - 'query_sed_radius' = float
1359
+ sets the default sed query radius in arcseconds
1360
+
1361
+ - 'query_reddening_radius' = float
1362
+ sets the default reddening query radius in arcseconds
1363
+
1364
+ - 'query_image_size' = int
1365
+ sets the default image query size in arc seconds
1366
+
1367
+ - 'query_image_overlays' = str
1368
+ sets a default overlay to use in image queries
1369
+
1370
+ - 'query_image_band' = str
1371
+ sets the default band to use in image queries
1372
+
1373
+ - 'query_lightcurve_atlas_username' = str
1374
+ sets the default username to use in ATLAS lightcurve queries
1375
+
1376
+ - 'query_lightcurve_atlas_password' = str
1377
+ sets the default password to use in ATLAS lightcurve queries
1378
+
1379
+
1380
+ - 'gaia_overlay_mag' = str
1381
+ name of default magnitude to use from Gaia in image overlays
1382
+
1383
+ - 'galex_overlay_mag' = str
1384
+ name of default magnitude to use from GALEX in image overlays
1385
+
1386
+ - 'wise_overlay_mag' = str
1387
+ name of default magnitude to use from WISE in image overlays
1388
+
1389
+ - 'sdss_overlay_mag' = str
1390
+ name of default magnitude to use from SDSS in image overlays
1391
+
1392
+ - 'twomass_overlay_mag' = str
1393
+ name of default magnitude to use from 2MASS in image overlays
1394
+
1395
+ - 'skymapper_overlay_mag' = str
1396
+ name of default magnitude to use from SkyMapper in image overlays
1397
+
1398
+ - 'panstarrs_overlay_mag' = str
1399
+ name of default magnitude to use from PanSTARRS in image overlays
1400
+
1401
+
1402
+ - 'search_radius' = float
1403
+ sets the default radius to use for search (SIMBAD and Vizier query) tool in arcseconds
1404
+
1405
+
1406
+ - 'datapage_search_button_radius' = float
1407
+ sets the default radius to use for SIMBAD/Vizier search buttons in arcseconds
1408
+
1409
+ - 'datapage_datatable_radius' = float
1410
+ sets the default radius to use for datatable queries
1411
+
1412
+ - 'datapage_grid_size' = int
1413
+ sets the default size to scale all plots to in gridsetup
1414
+ ```
1415
+
1416
+ <br>
1417
+
1418
+ ### 3. outputconfig<a id="outputconfig"></a>
1419
+
1420
+ Prints the current config values.
1421
+
1422
+ **Usage:**
1423
+
1424
+ ```
1425
+ outputconfig()
1426
+ ```
1427
+
1428
+ **Returns:**
1429
+ None
1430
+
1431
+ <br>
1432
+
1433
+ ### 4. resetconfig<a id="resetconfig"></a>
1434
+
1435
+ Resets the config to default settings.
1436
+
1437
+ **Usage:**
1438
+
1439
+ ```
1440
+ resetconfig()
1441
+ ```
1442
+
1443
+ **Returns:**
1444
+ None
1445
+
1446
+ <br>
1447
+
1448
+ ## Examples<a id="examples"></a>
1449
+
1450
+ ### 1. Query Examples<a id='queryexamples'></a>
1451
+
1452
+ ```
1453
+ from AstroToolkit.Tools import query
1454
+
1455
+ # specify a Gaia source
1456
+ source = 587316166180416640
1457
+
1458
+ # retrieve GALEX data, no radius is given so this will be taken from the config.
1459
+ galex_data = query(kind="data", source=source, survey="galex")
1460
+
1461
+ # output this data to the terminal
1462
+ print(galex_data.data)
1463
+
1464
+
1465
+ # retrieve Gaia data, this time supplying a radius - overriding the config value.
1466
+ gaia_data = query(kind="data", source=source, survey="gaia", radius=5)
1467
+
1468
+ # grab the parallax from Gaia
1469
+ parallax = gaia_data.data["parallax"][0]
1470
+
1471
+
1472
+ # retrieve WISE photometry
1473
+ wise_phot = query(kind="phot", source=source, survey="wise")
1474
+
1475
+
1476
+ # retrieve all available photometry
1477
+ bulkphot = query(kind="bulkphot", source=source)
1478
+
1479
+ # grab the panstarrs and skymapper photometry from bulkphot
1480
+ panstarrs_phot = bulkphot.data["panstarrs"]
1481
+ skymapper_phot = bulkphot.data["skymapper"]
1482
+ ```
1483
+
1484
+ <br>
1485
+
1486
+ ### 2. Lightcurve Example<a id="lightcurveexample"></a>
1487
+
1488
+ ```
1489
+ from AstroToolkit.Tools import query
1490
+
1491
+ # specify a Gaia source
1492
+ source = 587316166180416640
1493
+
1494
+ # retrieve ZTF light curve data and plot it, specifying the colours for each band.
1495
+ # No radius is given, so this will be taken from the config.
1496
+ figure = query(kind="lightcurve", source=source, survey="ztf").plot(
1497
+ colours=["green", "red", "blue"]
1498
+ )
1499
+
1500
+ # show the lightcurves in the browser (and save to a static .html file)
1501
+ figure.show()
1502
+ ```
1503
+
1504
+ ![](https://github.com/WD-planets/AstroToolkit/raw/latest/README_Images/lightcurve_example.png?raw=true)
1505
+
1506
+ **Note:** This example can be loaded from within the package using:
1507
+
1508
+ ```
1509
+ from AstroToolkit.Examples import lightcurve
1510
+ ```
1511
+
1512
+ <br>
1513
+
1514
+ ### 3. Timeseries Example<a id="timeseriesexample"></a>
1515
+
1516
+ ```
1517
+ from AstroToolkit.Tools import query
1518
+
1519
+ # specify a Gaia source
1520
+ source = 6050296829033196032
1521
+
1522
+ # retrieve ztf data for our Gaia source, plot it as a power spectrum, and then show it.
1523
+ power_spectrum=query(kind='lightcurve',source=source,survey='ztf').plot(kind='powspec').show()
1524
+
1525
+ # retrieve ztf data for our Gaia source, phase fold it, and then show it.
1526
+ phase_fold=query(kind='lightcurve',source=source,survey='ztf').plot(kind='phase').show()
1527
+ ```
1528
+
1529
+ ![](https://github.com/WD-planets/AstroToolkit/raw/latest/README_Images/timeseries_example.png?raw=true)
1530
+
1531
+ **Note:** This example can be loaded from within the package using:
1532
+
1533
+ ```
1534
+ from AstroToolkit.Examples import timeseries
1535
+ ```
1536
+
1537
+ <br>
1538
+
1539
+
1540
+ ### 4. Image Example<a id="imageexample"></a>
1541
+
1542
+ ```
1543
+ from AstroToolkit.Tools import query
1544
+
1545
+ # specify a Gaia source
1546
+ source = 587316166180416640
1547
+
1548
+ """
1549
+ Retrieve any available image and plot it.
1550
+ No size or band is given, so these will be taken from the config.
1551
+ Since overlays is given as a list, only the magnitude listed for each survey in the config
1552
+ will be overlayed as a detection (in this case, phot_g_mean_mag for gaia, and NUVmag for GALEX)
1553
+ """
1554
+ figure = query(
1555
+ kind="image", source=source, survey="any", overlays=["gaia", "galex"]
1556
+ ).plot()
1557
+
1558
+ # show the image in the browser (and save to a static .html file)
1559
+ figure.show()
1560
+
1561
+ # Now, give overlays as a dict containing all magnitudes to overlay.
1562
+ figure_allmags = query(
1563
+ kind="image",
1564
+ source=source,
1565
+ survey="any",
1566
+ overlays={
1567
+ "gaia": ["phot_g_mean_mag", "phot_bp_mean_mag", "phot_rp_mean_mag"],
1568
+ "galex": ["NUVmag", "FUVmag"],
1569
+ },
1570
+ ).plot()
1571
+
1572
+ # show the image in the browser (and save to a static .html file)
1573
+ figure_allmags.show()
1574
+
1575
+ """
1576
+ Now, include a light curve survey as an overlay. For surveys with enough positional
1577
+ precision, this can be used to trace the motion of the object through time.
1578
+ We have also specified an image size, which will override the value in the config.
1579
+ A different gaia source with a large proper motion has been used.
1580
+ """
1581
+ figure_tracer = query(
1582
+ kind="image",
1583
+ source=2552928187080872832,
1584
+ survey="panstarrs",
1585
+ overlays=["crts"],
1586
+ size=60,
1587
+ ).plot()
1588
+
1589
+ figure_tracer.show()
1590
+ ```
1591
+
1592
+ ![](https://github.com/WD-planets/AstroToolkit/raw/latest/README_Images/image_example.png?raw=true)
1593
+
1594
+ **Note:** This example can be loaded from within the package using:
1595
+
1596
+ ```
1597
+ from AstroToolkit.Examples import image
1598
+ ```
1599
+
1600
+ <br>
1601
+
1602
+ ### 5. Spectrum Example<a id="spectrumexample"></a>
1603
+
1604
+ ```
1605
+ from AstroToolkit.Tools import query
1606
+
1607
+ # specify a Gaia source
1608
+ source = 587316166180416640
1609
+
1610
+ # retrieve an SDSS spectrum for the gaia source, plot it and then show it.
1611
+ # As no radius is given, this will be taken from the config.
1612
+ spectrum = query(kind="spectrum", source=source, survey="sdss").plot().show()
1613
+ ```
1614
+
1615
+ ![](https://github.com/WD-planets/AstroToolkit/raw/latest/README_Images/spectrum_example.png?raw=true)
1616
+
1617
+ **Note:** This example can be loaded from within the package using:
1618
+
1619
+ ```
1620
+ from AstroToolkit.Examples import spectrum
1621
+ ```
1622
+
1623
+ <br>
1624
+
1625
+ ### 6. SED Example<a id="sedexample"></a>
1626
+
1627
+ ```
1628
+ from AstroToolkit.Tools import query
1629
+
1630
+ # specify a Gaia source
1631
+ source = 587316166180416640
1632
+
1633
+ # retrieve and plot an sed, with an overlayed SDSS spectrum.
1634
+ sed=query(kind='sed',source=source).plot(spectrum_overlay=True,survey='sdss')
1635
+
1636
+ # show the figure in the browser (and save to a static .html file)
1637
+ sed.show()
1638
+ ```
1639
+
1640
+ ![](https://github.com/WD-planets/AstroToolkit/raw/latest/README_Images/sed_example.png?raw=true)
1641
+
1642
+ **Note:** This example can be loaded from within the package using:
1643
+
1644
+ ```
1645
+ from AstroToolkit.Examples import sed
1646
+ ```
1647
+
1648
+ <br>
1649
+
1650
+ ### 7. HRD Example<a id="hrdexample"></a>
1651
+
1652
+ ```
1653
+ from AstroToolkit.Tools import query
1654
+
1655
+ # specify a Gaia source
1656
+ source1 = 587316166180416640
1657
+
1658
+ # Specify a second Gaia source. This is not necessary - any number of sources can be overlayed.
1659
+ source2 = 6050296829033196032
1660
+
1661
+ # retrieve Gaia hrd data for our list of sources, plot it and then show it.
1662
+ hrd=query(kind='hrd',sources=[source1,source2]).plot().show()
1663
+ ```
1664
+
1665
+ ![](https://github.com/WD-planets/AstroToolkit/raw/latest/README_Images/hrd_example.png?raw=true)
1666
+
1667
+ **Note:** This example can be loaded from within the package using:
1668
+
1669
+ ```
1670
+ from AstroToolkit.Examples import hrd
1671
+ ```
1672
+
1673
+ <br>
1674
+
1675
+ ### 8. Local Files Example<a id="localfileexample"></a>
1676
+
1677
+ ```
1678
+ from AstroToolkit.Tools import query, readdata, savedata
1679
+
1680
+ # specify a Gaia source
1681
+ source = 587316166180416640
1682
+
1683
+ # retrieve ZTF light curve data for our source
1684
+ lightcurve_data = query(kind="lightcurve", source=source, survey="ztf")
1685
+
1686
+ # save data to a local file and retrieve the name of this file
1687
+ filename = savedata(lightcurve_data)
1688
+
1689
+ # recreate the original data structure from the local file
1690
+ recreated_data = readdata(filename)
1691
+
1692
+ # plot only the g band of this data in the colour green, and show it.
1693
+ recreated_data.plot(colours=["green"], bands=["g"]).show()
1694
+ ```
1695
+
1696
+ ![](https://github.com/WD-planets/AstroToolkit/raw/latest/README_Images/localfiles_example.png?raw=true)
1697
+
1698
+ **Note:** This example can be loaded from within the package using:
1699
+
1700
+ ```
1701
+ from AstroToolkit.Examples import localfiles
1702
+ ```
1703
+
1704
+ <br>
1705
+
1706
+ ### 9. Datapage Example<a id="datapageexample"></a>
1707
+
1708
+ ```
1709
+ from bokeh.layouts import column, layout, row
1710
+ from bokeh.plotting import output_file, show
1711
+
1712
+ from AstroToolkit.Datapages import buttons, datatable, gridsetup
1713
+ from AstroToolkit.Tools import query
1714
+
1715
+ # source = Hu Leo
1716
+ source = 587316166180416640
1717
+
1718
+ # set grid size (scales size of datapage)
1719
+ grid_size = 250
1720
+
1721
+ # get image data and plot it
1722
+ image = query(
1723
+ kind="image", survey="any", source=source, overlays=["gaia", "galex"]
1724
+ ).plot()
1725
+
1726
+ # get hrd data and plot it
1727
+ hrd = query(kind="hrd", sources=source).plot()
1728
+
1729
+ # get sed data and plot it
1730
+ sed = query(kind="sed", source=source).plot(spectrum_overlay=True, survey="sdss")
1731
+
1732
+ # get spectrum data and plot it
1733
+ spectrum = query(kind="spectrum", survey="sdss", source=source).plot()
1734
+
1735
+ # get lightcurve data [g,r,i] and plot it
1736
+ lightcurves = query(kind="lightcurve", survey="ztf", source=source).plot(
1737
+ colours=["green", "red", "blue"]
1738
+ )
1739
+
1740
+ # get SIMBAD and Vizier buttons
1741
+ buttons = buttons(source=source, grid_size=grid_size)
1742
+
1743
+ # make a custom metadatatable entry
1744
+ custom_entry = {
1745
+ "parameters": ["one"],
1746
+ "values": ["two"],
1747
+ "errors": ["three"],
1748
+ "notes": ["four"],
1749
+ }
1750
+
1751
+ # get a metadata table with default parameters for various surveys
1752
+ metadata = datatable(
1753
+ source=source,
1754
+ selection={
1755
+ "gaia": "default",
1756
+ "galex": "default",
1757
+ "panstarrs": "default",
1758
+ "skymapper": "default",
1759
+ "sdss": "default",
1760
+ "wise": "default",
1761
+ "twomass": "default",
1762
+ "custom": custom_entry,
1763
+ },
1764
+ )
1765
+
1766
+ # formats plots for use in grid
1767
+ grid_plots = gridsetup(
1768
+ dimensions={"width": 6, "height": 6},
1769
+ plots=[
1770
+ {"name": "image", "figure": image, "width": 2, "height": 2},
1771
+ {"name": "hrd", "figure": hrd, "width": 2, "height": 2},
1772
+ {"name": "sed", "figure": sed, "width": 2, "height": 2},
1773
+ {"name": "lightcurves", "figure": lightcurves, "width": 2, "height": 1},
1774
+ {"name": "buttons", "figure": buttons, "width": 2, "height": 1},
1775
+ {"name": "spectrum", "figure": spectrum, "width": 4, "height": 2},
1776
+ {"name": "metadata_table", "figure": metadata, "width": 6, "height": 2},
1777
+ ],
1778
+ grid_size=grid_size,
1779
+ )
1780
+
1781
+ # set up the final grid
1782
+ datapage = layout(
1783
+ column(
1784
+ row(
1785
+ grid_plots["image"],
1786
+ grid_plots["hrd"],
1787
+ column(grid_plots["buttons"], grid_plots["lightcurves"]),
1788
+ ),
1789
+ row(grid_plots["sed"], grid_plots["spectrum"]),
1790
+ row(grid_plots["metadata_table"]),
1791
+ )
1792
+ )
1793
+
1794
+ # give output file a name
1795
+ output_file(f"{source}_datapage.html")
1796
+
1797
+ # show the datapage (also saves it)
1798
+ show(datapage)
1799
+ ```
1800
+
1801
+ ![](https://github.com/WD-planets/AstroToolkit/raw/latest/README_Images/datapage_example.png?raw=true)
1802
+
1803
+ **Note:** This example can be loaded from within the package using:
1804
+
1805
+ ```
1806
+ from AstroToolkit.Examples import datapage
1807
+ ```