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