astro-otter 0.0.1__py3-none-any.whl → 0.1.0__py3-none-any.whl
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.
Potentially problematic release.
This version of astro-otter might be problematic. Click here for more details.
- astro_otter-0.1.0.dist-info/METADATA +127 -0
- astro_otter-0.1.0.dist-info/RECORD +17 -0
- {astro_otter-0.0.1.dist-info → astro_otter-0.1.0.dist-info}/WHEEL +1 -1
- otter/__init__.py +4 -0
- otter/_version.py +1 -1
- otter/exceptions.py +48 -0
- otter/io/data_finder.py +744 -0
- otter/io/host.py +106 -0
- otter/io/otter.py +82 -56
- otter/io/transient.py +240 -147
- otter/plotter/otter_plotter.py +10 -8
- otter/plotter/plotter.py +19 -18
- otter/util.py +102 -1
- astro_otter-0.0.1.dist-info/METADATA +0 -866
- astro_otter-0.0.1.dist-info/RECORD +0 -15
- {astro_otter-0.0.1.dist-info → astro_otter-0.1.0.dist-info}/LICENSE +0 -0
- {astro_otter-0.0.1.dist-info → astro_otter-0.1.0.dist-info}/top_level.txt +0 -0
otter/plotter/plotter.py
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Some utilities to create common plots for transients that use the OtterPlotter
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
+
from __future__ import annotations
|
|
5
6
|
from .otter_plotter import OtterPlotter
|
|
6
7
|
|
|
7
8
|
|
|
@@ -21,15 +22,15 @@ def plot_light_curve(
|
|
|
21
22
|
Plot the light curve for the input data
|
|
22
23
|
|
|
23
24
|
Args:
|
|
24
|
-
date
|
|
25
|
-
flux
|
|
26
|
-
date_err
|
|
27
|
-
flux_err
|
|
28
|
-
fig
|
|
29
|
-
ax
|
|
30
|
-
backend
|
|
31
|
-
xlabel
|
|
32
|
-
ylabel
|
|
25
|
+
date (float): MJD dates
|
|
26
|
+
flux (float): Flux
|
|
27
|
+
date_err (float): optional error on the MJD dates
|
|
28
|
+
flux_err (float): optional error on the flux
|
|
29
|
+
fig (float): matplotlib fig object, optional. Will be created if not provided.
|
|
30
|
+
ax (float): matplitlib axis object, optional. Will be created if not provided.
|
|
31
|
+
backend (str): backend for plotting. options: "matplotlib" (default) or "plotly"
|
|
32
|
+
xlabel (str): x-axis label
|
|
33
|
+
ylabel (str): y-axis label
|
|
33
34
|
**kwargs: keyword arguments to pass to either plotly.graph_objects.add_scatter
|
|
34
35
|
or matplotlib.pyplot.errorbar
|
|
35
36
|
|
|
@@ -66,15 +67,15 @@ def plot_sed(
|
|
|
66
67
|
Plot the SED for the input data
|
|
67
68
|
|
|
68
69
|
Args:
|
|
69
|
-
wave_or_freq
|
|
70
|
-
flux
|
|
71
|
-
wave_or_freq_err
|
|
72
|
-
flux_err
|
|
73
|
-
fig
|
|
74
|
-
ax
|
|
75
|
-
backend
|
|
76
|
-
xlabel
|
|
77
|
-
ylabel
|
|
70
|
+
wave_or_freq (float): wave or frequency array
|
|
71
|
+
flux (float): Flux
|
|
72
|
+
wave_or_freq_err (float): optional error on the MJD dates
|
|
73
|
+
flux_err (float): optional error on the flux
|
|
74
|
+
fig (float): matplotlib fig object, optional. Will be created if not provided.
|
|
75
|
+
ax (float): matplitlib axis object, optional. Will be created if not provided.
|
|
76
|
+
backend (str): backend for plotting. Options: "matplotlib" (default) or "plotly"
|
|
77
|
+
xlabel (str): x-axis label
|
|
78
|
+
ylabel (str): y-axis label
|
|
78
79
|
**kwargs: keyword arguments to pass to either plotly.graph_objects.add_scatter
|
|
79
80
|
or matplotlib.pyplot.errorbar
|
|
80
81
|
|
otter/util.py
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Some constants, mappings, and functions to be used across the software
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
+
from __future__ import annotations
|
|
5
6
|
import os
|
|
6
7
|
import ads
|
|
7
8
|
import astropy.units as u
|
|
@@ -187,6 +188,10 @@ FILTER_MAP_WAVE = {
|
|
|
187
188
|
"F2100W": 20842.526633138932,
|
|
188
189
|
"F2550W": 25408.228367890282,
|
|
189
190
|
}
|
|
191
|
+
"""
|
|
192
|
+
Mapping for the effective wavelength in nanometers for all filters used in the dataset.
|
|
193
|
+
"""
|
|
194
|
+
|
|
190
195
|
|
|
191
196
|
# gives the effective frequency for all filters
|
|
192
197
|
# These are all in THz
|
|
@@ -302,6 +307,10 @@ FILTER_MAP_FREQ = {
|
|
|
302
307
|
"F2100W": 14.581938602646188,
|
|
303
308
|
"F2550W": 11.919267708332558,
|
|
304
309
|
}
|
|
310
|
+
"""
|
|
311
|
+
Mapping for the effective frequencies in THz for all the filters used in OTTER
|
|
312
|
+
"""
|
|
313
|
+
|
|
305
314
|
|
|
306
315
|
# x-ray telescope areas for converting
|
|
307
316
|
# NOTE: these are estimates from the links provided
|
|
@@ -319,10 +328,27 @@ XRAY_AREAS = {
|
|
|
319
328
|
# https://cxc.harvard.edu/cdo/about_chandra
|
|
320
329
|
"chandra": 600 * u.cm**2,
|
|
321
330
|
}
|
|
331
|
+
"""
|
|
332
|
+
X-Ray telescope areas that are used for converting from counts to other units.
|
|
333
|
+
|
|
334
|
+
NOTE: These are estimates from the following links
|
|
335
|
+
* https://swift.gsfc.nasa.gov/about_swift/Sci_Fact_Sheet.pdf
|
|
336
|
+
* https://heasarc.gsfc.nasa.gov/docs/rosat/ruh/handbook/node39.html#SECTION00634000000000000000
|
|
337
|
+
* https://www.cosmos.esa.int/web/xmm-newton/technical-details-mirrors
|
|
338
|
+
* https://cxc.harvard.edu/cdo/about_chandra
|
|
339
|
+
"""
|
|
340
|
+
|
|
322
341
|
|
|
323
342
|
# define a working base directory constant
|
|
324
343
|
BASEDIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
|
344
|
+
"""
|
|
345
|
+
Base directory for the OTTER API software package
|
|
346
|
+
"""
|
|
347
|
+
|
|
325
348
|
DATADIR = os.path.join(BASEDIR, "data", "base")
|
|
349
|
+
"""
|
|
350
|
+
Deprecated database directory that IS NOT always constant anymore
|
|
351
|
+
"""
|
|
326
352
|
|
|
327
353
|
# Overarching schema that stops once we get down to a string or list
|
|
328
354
|
schema = {
|
|
@@ -337,10 +363,16 @@ schema = {
|
|
|
337
363
|
"spectra": [],
|
|
338
364
|
"filter_alias": [],
|
|
339
365
|
}
|
|
340
|
-
|
|
366
|
+
"""
|
|
367
|
+
Schema dictionary to be filled with values from the subschemas
|
|
368
|
+
"""
|
|
341
369
|
|
|
342
370
|
# sub schemas that get filled into lists
|
|
343
371
|
name_alias_schema = {"value": None, "reference": None}
|
|
372
|
+
"""
|
|
373
|
+
Subschema for the name and alias dictionary
|
|
374
|
+
"""
|
|
375
|
+
|
|
344
376
|
coordinate_schema = {
|
|
345
377
|
"ra": None,
|
|
346
378
|
"dec": None,
|
|
@@ -367,6 +399,10 @@ coordinate_schema = {
|
|
|
367
399
|
"reference": None,
|
|
368
400
|
"default": None,
|
|
369
401
|
}
|
|
402
|
+
"""
|
|
403
|
+
Subschema to describe the possible attributes for the coordinate dictionary
|
|
404
|
+
"""
|
|
405
|
+
|
|
370
406
|
|
|
371
407
|
distance_schema = {
|
|
372
408
|
"value": None,
|
|
@@ -379,6 +415,10 @@ distance_schema = {
|
|
|
379
415
|
"default": None,
|
|
380
416
|
"distance_type": None,
|
|
381
417
|
}
|
|
418
|
+
"""
|
|
419
|
+
Subschema to describe the possible attributes for the distance dictionary
|
|
420
|
+
"""
|
|
421
|
+
|
|
382
422
|
|
|
383
423
|
classification_schema = {
|
|
384
424
|
"object_class": None,
|
|
@@ -387,8 +427,14 @@ classification_schema = {
|
|
|
387
427
|
"reference": None,
|
|
388
428
|
"default": None,
|
|
389
429
|
}
|
|
430
|
+
"""
|
|
431
|
+
Subschema to describe the attributes for the classification dictionary
|
|
432
|
+
"""
|
|
390
433
|
|
|
391
434
|
reference_alias_schema = {"name": None, "human_readable_name": None}
|
|
435
|
+
"""
|
|
436
|
+
Subschema to describe the attributes for the reference alias dictionary
|
|
437
|
+
"""
|
|
392
438
|
|
|
393
439
|
date_reference_schema = {
|
|
394
440
|
"value": None,
|
|
@@ -397,6 +443,9 @@ date_reference_schema = {
|
|
|
397
443
|
"reference": None,
|
|
398
444
|
"computed": None,
|
|
399
445
|
}
|
|
446
|
+
"""
|
|
447
|
+
Subschema to describe the date_reference dictionary attributes
|
|
448
|
+
"""
|
|
400
449
|
|
|
401
450
|
photometry_schema = {
|
|
402
451
|
"raw": None,
|
|
@@ -436,6 +485,10 @@ photometry_schema = {
|
|
|
436
485
|
"val_host": None,
|
|
437
486
|
"val_hostav": None,
|
|
438
487
|
}
|
|
488
|
+
"""
|
|
489
|
+
Subschema to describe all of the possible attributes that can be used in the photometry
|
|
490
|
+
dictionary
|
|
491
|
+
"""
|
|
439
492
|
|
|
440
493
|
spectra_schema = {
|
|
441
494
|
"wavelength": None,
|
|
@@ -495,6 +548,9 @@ filter_alias_schema = {
|
|
|
495
548
|
"zp_units": None,
|
|
496
549
|
"zp_system": None,
|
|
497
550
|
}
|
|
551
|
+
"""
|
|
552
|
+
Subschema to describe the attributes in the filter_alias dictionary
|
|
553
|
+
"""
|
|
498
554
|
|
|
499
555
|
# package the subschemas by the key used for that location in the Transient object
|
|
500
556
|
subschema = {
|
|
@@ -508,3 +564,48 @@ subschema = {
|
|
|
508
564
|
"spectra": spectra_schema,
|
|
509
565
|
"filter_alias": filter_alias_schema,
|
|
510
566
|
}
|
|
567
|
+
"""
|
|
568
|
+
A useful variable to describe all of the subschemas that are available and can be used
|
|
569
|
+
"""
|
|
570
|
+
|
|
571
|
+
VIZIER_LARGE_CATALOGS = [
|
|
572
|
+
"2MASS-PSC",
|
|
573
|
+
"2MASX",
|
|
574
|
+
"AC2000.2",
|
|
575
|
+
"AKARI",
|
|
576
|
+
"ALLWISE",
|
|
577
|
+
"ASCC-2.5",
|
|
578
|
+
"B/DENIS",
|
|
579
|
+
"CMC14",
|
|
580
|
+
"Gaia-DR1",
|
|
581
|
+
"GALEX",
|
|
582
|
+
"GLIMPSE",
|
|
583
|
+
"GSC-ACT",
|
|
584
|
+
"GSC1.2",
|
|
585
|
+
"GSC2.2",
|
|
586
|
+
"GSC2.3",
|
|
587
|
+
"HIP",
|
|
588
|
+
"HIP2",
|
|
589
|
+
"IRAS",
|
|
590
|
+
"NOMAD1",
|
|
591
|
+
"NVSS",
|
|
592
|
+
"PanSTARRS-DR1",
|
|
593
|
+
"PGC",
|
|
594
|
+
"Planck-DR1",
|
|
595
|
+
"PPMX",
|
|
596
|
+
"PPMXL",
|
|
597
|
+
"SDSS-DR12",
|
|
598
|
+
"SDSS-DR7",
|
|
599
|
+
"SDSS-DR9",
|
|
600
|
+
"Tycho-2",
|
|
601
|
+
"UCAC2",
|
|
602
|
+
"UCAC3",
|
|
603
|
+
"UCAC4",
|
|
604
|
+
"UKIDSS",
|
|
605
|
+
"USNO-A2",
|
|
606
|
+
"USNO-B1",
|
|
607
|
+
"WISE",
|
|
608
|
+
]
|
|
609
|
+
"""
|
|
610
|
+
ViZier catalog names that we query for host information in the Host class
|
|
611
|
+
"""
|