AstroToolkit 1.5.0__tar.gz → 1.5.2__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 (58) hide show
  1. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/PKG-INFO +83 -3
  2. astrotoolkit-1.5.0/src/AstroToolkit.egg-info/PKG-INFO → astrotoolkit-1.5.2/README.md +80 -25
  3. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/pyproject.toml +3 -2
  4. astrotoolkit-1.5.2/src/AstroToolkit/Data/bin_lightcurves.py +106 -0
  5. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Data/dataquery.py +4 -3
  6. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Data/fetch_crts.py +3 -3
  7. astrotoolkit-1.5.2/src/AstroToolkit/Data/fetch_tess.py +75 -0
  8. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Data/imageoverlay.py +2 -1
  9. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Data/lightcurvequery.py +216 -13
  10. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Examples/datapage.py +0 -9
  11. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Input/input_validation.py +1 -1
  12. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Misc/coordinate_conversions.py +5 -0
  13. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Plotting/imageplotting.py +1 -1
  14. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Plotting/lightcurveplotting.py +20 -11
  15. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Plotting/plotmap.py +19 -7
  16. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Plotting/sedplotting.py +1 -3
  17. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Plotting/spectrumplotting.py +5 -4
  18. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Timeseries/lomb_scargle.py +61 -13
  19. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Tools.py +21 -12
  20. astrotoolkit-1.5.0/README.md → astrotoolkit-1.5.2/src/AstroToolkit.egg-info/PKG-INFO +105 -1
  21. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit.egg-info/SOURCES.txt +2 -0
  22. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit.egg-info/requires.txt +1 -0
  23. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/LICENSE +0 -0
  24. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/MANIFEST.in +0 -0
  25. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/setup.cfg +0 -0
  26. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Config.py +0 -0
  27. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Configuration/baseconfig.py +0 -0
  28. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Data/hrdquery.py +0 -0
  29. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Data/imagequery.py +0 -0
  30. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Data/photquery.py +0 -0
  31. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Data/reddeningquery.py +0 -0
  32. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Data/rename_headers.py +0 -0
  33. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Data/sedquery.py +0 -0
  34. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Data/sigmaclip.py +0 -0
  35. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Data/spectrumquery.py +0 -0
  36. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/DatapageElements/datapage_buttons.py +0 -0
  37. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/DatapageElements/metadata_table.py +0 -0
  38. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Datapages.py +0 -0
  39. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Examples/hrd.py +0 -0
  40. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Examples/image.py +0 -0
  41. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Examples/lightcurve.py +0 -0
  42. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Examples/localfiles.py +0 -0
  43. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Examples/sed.py +0 -0
  44. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Examples/spectrum.py +0 -0
  45. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Examples/timeseries.py +0 -0
  46. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/FileHandling/file_naming.py +0 -0
  47. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/FileHandling/file_reading.py +0 -0
  48. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/FileHandling/file_writing.py +0 -0
  49. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Misc/fitsfiles.py +0 -0
  50. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Misc/gridsetup.py +0 -0
  51. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Misc/identifier_generation.py +0 -0
  52. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Misc/pmcorrection.py +0 -0
  53. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Misc/search.py +0 -0
  54. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Plotting/backdrop_hrd_allmags.fits +0 -0
  55. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Plotting/hrdplotting.py +0 -0
  56. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit/Timeseries/timeseries_formatting.py +0 -0
  57. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit.egg-info/dependency_links.txt +0 -0
  58. {astrotoolkit-1.5.0 → astrotoolkit-1.5.2}/src/AstroToolkit.egg-info/top_level.txt +0 -0
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: AstroToolkit
3
- Version: 1.5.0
3
+ Version: 1.5.2
4
4
  Summary: A package for the gathering and plotting of astronomical data.
5
5
  Author-email: Ethan Moorfield <ethan.moorfield@hotmail.co.uk>
6
6
  Project-URL: Homepage, https://github.com/WD-planets/AstroToolkit
7
7
  Project-URL: Issues, https://github.com/WD-planets/AstroToolkit/issues
8
8
  Classifier: Programming Language :: Python :: 3
9
9
  Classifier: Operating System :: OS Independent
10
- Requires-Python: >=3.8
10
+ Requires-Python: >=3.11
11
11
  Description-Content-Type: text/markdown
12
12
  License-File: LICENSE
13
13
  Requires-Dist: astropy==6.0.1
@@ -21,6 +21,7 @@ Requires-Dist: pandas==2.2.2
21
21
  Requires-Dist: Requests==2.31.0
22
22
  Requires-Dist: beautifulsoup4==4.12.3
23
23
  Requires-Dist: scipy==1.13.0
24
+ Requires-Dist: selenium==4.21.0
24
25
 
25
26
  # AstroToolkit
26
27
 
@@ -49,6 +50,7 @@ AstroToolkit (ATK) is a set of tools for fetching, plotting, and analysing astro
49
50
  * [Spectrum Query](#spectrumquery)
50
51
  * [SED Query](#sedquery)
51
52
  * [HRD Query](#hrdquery)
53
+ * [Reddening Query](#reddeningquery)
52
54
  * [Proper Motion Correction](#correctpm)
53
55
  * [Local File Saving](#savedata)
54
56
  * [Local File Reading](#readdata)
@@ -499,10 +501,13 @@ Arguments:
499
501
  - 'powspec' - Lomb-Scargle power spectrum
500
502
  - 'phase' - phase folded light curve using Lomb-Scargle
501
503
 
502
- Additional Arguments (only valid light curve plots):
504
+ Additional Arguments:
505
+ For lightcurve plots:
503
506
  - colours: list = colour to plot each band that returned data. Defaults to black for all bands.
504
507
  - bands: list = bands to include. Includes all by default.
505
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.
506
511
  ```
507
512
 
508
513
  ```
@@ -855,6 +860,81 @@ save() - saves the plot created by the plot() method to local storage.
855
860
 
856
861
  <br>
857
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
+
858
938
  ### 2. correctpm<a id="correctpm"></a>
859
939
 
860
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.
@@ -1,27 +1,3 @@
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
1
  # AstroToolkit
26
2
 
27
3
  AstroToolkit (ATK) is a set of tools for fetching, plotting, and analysing astronomical data.
@@ -49,6 +25,7 @@ AstroToolkit (ATK) is a set of tools for fetching, plotting, and analysing astro
49
25
  * [Spectrum Query](#spectrumquery)
50
26
  * [SED Query](#sedquery)
51
27
  * [HRD Query](#hrdquery)
28
+ * [Reddening Query](#reddeningquery)
52
29
  * [Proper Motion Correction](#correctpm)
53
30
  * [Local File Saving](#savedata)
54
31
  * [Local File Reading](#readdata)
@@ -499,10 +476,13 @@ Arguments:
499
476
  - 'powspec' - Lomb-Scargle power spectrum
500
477
  - 'phase' - phase folded light curve using Lomb-Scargle
501
478
 
502
- Additional Arguments (only valid light curve plots):
479
+ Additional Arguments:
480
+ For lightcurve plots:
503
481
  - colours: list = colour to plot each band that returned data. Defaults to black for all bands.
504
482
  - bands: list = bands to include. Includes all by default.
505
483
 
484
+ For phase fold plots:
485
+ - freq: float = frequency on which to fold the lightcurve data. If none is given, it will be folded on the peak Lomb-Scargle frequency.
506
486
  ```
507
487
 
508
488
  ```
@@ -855,6 +835,81 @@ save() - saves the plot created by the plot() method to local storage.
855
835
 
856
836
  <br>
857
837
 
838
+ #### 1.9. reddening query<a id="reddeningquery"></a>
839
+
840
+ **Additional Parameters:**
841
+
842
+ ```
843
+ survey: str = target survey
844
+ Can be one of:
845
+ - 'stilism'
846
+ - 'gdre'
847
+ ```
848
+
849
+ ```
850
+ !radius: int = search radius in arcseconds
851
+ ```
852
+
853
+ Additionally, requires one of:
854
+
855
+ ```
856
+ pos: list = [right ascension (deg), declination (deg)], target position
857
+ ```
858
+
859
+ ```
860
+ source: int = Gaia DR3 source_id.
861
+ Target Gaia DR3 source
862
+ ```
863
+
864
+ **Note:** For stilism queries, source input is required as a parallax is needed for distance calculations.
865
+
866
+ **Returns:**
867
+
868
+ ```
869
+ DataStruct: class = ATK Data Structure
870
+ ```
871
+
872
+ *Attributes:*
873
+
874
+ ```
875
+ kind: str = 'data'
876
+ ```
877
+
878
+ ```
879
+ subkind: str = kind of query (as listed above)
880
+ ```
881
+
882
+ ```
883
+ survey: str = target survey of query
884
+ ```
885
+
886
+ ```
887
+ catalogue: str = None
888
+ ```
889
+
890
+ ```
891
+ source: int = target Gaia DR3 source
892
+ ```
893
+
894
+ ```
895
+ pos: list = target position
896
+ ```
897
+
898
+ ```
899
+ identifier: str = positional identifier of target in format JHHMMSS.SS±DDMMSS.SS
900
+ ```
901
+
902
+ ```
903
+ data: dict = returned data, where:
904
+ keys: str = column headers
905
+ values : float = column values
906
+ ```
907
+
908
+ *Methods:*
909
+ None
910
+
911
+ <br>
912
+
858
913
  ### 2. correctpm<a id="correctpm"></a>
859
914
 
860
915
  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.
@@ -7,13 +7,13 @@ include-package-data = true
7
7
 
8
8
  [project]
9
9
  name = "AstroToolkit"
10
- version = "1.5.0"
10
+ version = "1.5.2"
11
11
  authors = [
12
12
  { name="Ethan Moorfield", email="ethan.moorfield@hotmail.co.uk"},
13
13
  ]
14
14
  description = "A package for the gathering and plotting of astronomical data."
15
15
  readme = "README.md"
16
- requires-python = ">=3.8"
16
+ requires-python = ">=3.11"
17
17
  classifiers = [
18
18
  "Programming Language :: Python :: 3",
19
19
  "Operating System :: OS Independent",
@@ -30,6 +30,7 @@ dependencies = [
30
30
  "Requests==2.31.0",
31
31
  "beautifulsoup4==4.12.3",
32
32
  "scipy==1.13.0",
33
+ "selenium==4.21.0",
33
34
  ]
34
35
 
35
36
  [project.urls]
@@ -0,0 +1,106 @@
1
+ def binning(data, bins=None, bin_size=None):
2
+ import numpy as np
3
+
4
+ ra = data["ra"]
5
+ dec = data["dec"]
6
+
7
+ mag = data["mag"]
8
+ mag_err = data["mag_err"]
9
+ if "mjd_ori" in data:
10
+ time = data["mjd_ori"]
11
+ time_unit = "mjd_ori"
12
+ else:
13
+ time = data["hjd_ori"]
14
+ time_unit = "hjd_ori"
15
+
16
+ bin_edges_arr = []
17
+
18
+ if bins:
19
+ bin_edge_lower = 0
20
+ bin_size = int(len(time) / bins)
21
+ bin_edge_higher = bin_size
22
+
23
+ while True:
24
+ reached_end = False
25
+ if bin_edge_higher + bin_size >= len(time):
26
+ bin_edge_higher = len(time) - 1
27
+ reached_end = True
28
+
29
+ bin_edges_arr.append([bin_edge_lower, bin_edge_higher])
30
+ bin_edge_lower = bin_edge_higher
31
+ bin_edge_higher += bin_size
32
+
33
+ if reached_end:
34
+ break
35
+
36
+ for i, val in enumerate(bin_edges_arr):
37
+ bin_edges_arr[i][0] = time[val[0]]
38
+ bin_edges_arr[i][1] = time[val[1]]
39
+
40
+ elif bin_size:
41
+ bin_edge_lower = min(time)
42
+
43
+ try:
44
+ bin_unit = bin_size[-1]
45
+ bin_size = float(bin_size[:-1])
46
+ except:
47
+ raise Exception("No binsize unit given.")
48
+
49
+ if bin_unit == "d":
50
+ bin_size = bin_size
51
+ elif bin_unit == "h":
52
+ bin_size = bin_size / 24
53
+ elif bin_unit == "m":
54
+ bin_size = bin_size / (24 * 60)
55
+ else:
56
+ raise Exception("Invalid binsize unit.")
57
+
58
+ bin_edge_higher = bin_edge_lower + bin_size
59
+
60
+ while True:
61
+ reached_end = False
62
+ if bin_edge_higher + bin_size >= max(time):
63
+ bin_edge_higher = max(time)
64
+ reached_end = True
65
+
66
+ bin_edges_arr.append([bin_edge_lower, bin_edge_higher])
67
+ bin_edge_lower = bin_edge_higher
68
+ bin_edge_higher += bin_size
69
+
70
+ if reached_end:
71
+ break
72
+
73
+ final_mags, final_times, final_errors, final_ra, final_dec = [], [], [], [], []
74
+ for bin_edges in bin_edges_arr:
75
+ mask = [i for i, val in enumerate(time) if bin_edges[0] <= val < bin_edges[1]]
76
+
77
+ if len(mask) == 0:
78
+ continue
79
+
80
+ binned_mags = [val for i, val in enumerate(mag) if i in mask]
81
+ binned_ra = [val for i, val in enumerate(ra) if i in mask]
82
+ binned_dec = [val for i, val in enumerate(dec) if i in mask]
83
+
84
+ weights = [1 / pow(err, 2) for i, err in enumerate(mag_err) if i in mask]
85
+
86
+ weighted_mean, norm = np.average(binned_mags, weights=weights, returned=True)
87
+
88
+ mean_ra = sum(binned_ra) / len(binned_ra)
89
+ mean_dec = sum(binned_dec) / len(binned_dec)
90
+
91
+ final_mags.append(weighted_mean)
92
+ final_ra.append(mean_ra)
93
+ final_dec.append(mean_dec)
94
+ final_times.append((bin_edges[1] + bin_edges[0]) / 2)
95
+ final_errors.append(1 / np.sqrt(norm))
96
+
97
+ base_time_unit = time_unit[:-4]
98
+
99
+ data["mag"] = final_mags
100
+ data[time_unit] = final_times
101
+ data["mag_err"] = final_errors
102
+ data[base_time_unit] = [t - min(final_times) for t in final_times]
103
+ data["ra"] = final_ra
104
+ data["dec"] = final_dec
105
+
106
+ return data
@@ -35,7 +35,7 @@ class SurveyInfo:
35
35
  "gaia": [2016, 0],
36
36
  "panstarrs": [2012, 0],
37
37
  "skymapper": [2016, 0],
38
- "galex": [2007, 0],
38
+ "galex": [2006, 8],
39
39
  "rosat": [1991, 0],
40
40
  "sdss": [2017, 0],
41
41
  "wise": [2010, 5],
@@ -46,6 +46,7 @@ class SurveyInfo:
46
46
  "gaia_lc": [2016, 0],
47
47
  "asassn": [2015, 0],
48
48
  "crts": [2000, 0],
49
+ "tess": [2020, 0],
49
50
  }
50
51
  self.catalogues = {
51
52
  "gaia": "I/355/gaiadr3",
@@ -255,7 +256,7 @@ class SurveyInfo:
255
256
  "ztf",
256
257
  ]
257
258
 
258
- self.lightcurve_surveys = ["atlas", "ztf", "crts", "asassn", "gaia"]
259
+ self.lightcurve_surveys = ["atlas", "ztf", "crts", "asassn", "gaia", "tess"]
259
260
 
260
261
  self.reddening_surveys = ["stilism", "gdre"]
261
262
 
@@ -278,7 +279,7 @@ class SurveyInfo:
278
279
  "overlay_type": "detection_mag",
279
280
  "ra_name": "ra",
280
281
  "dec_name": "dec",
281
- "colours": ["green", "blue", "red"],
282
+ "colours": ["limegreen", "blue", "red"],
282
283
  "default_overlay_mag": "phot_g_mean_mag",
283
284
  },
284
285
  "galex": {
@@ -11,7 +11,7 @@ from bs4 import BeautifulSoup as bs
11
11
  from importlib_resources import files
12
12
  from numpy import extract, genfromtxt
13
13
 
14
- TIMER = files("AstroToolkit.Settings").joinpath("CRTS_TIMER.txt")
14
+ TIMER = files("AstroToolkit.Configuration").joinpath("CRTS_TIMER.txt")
15
15
 
16
16
  if not os.path.isfile(str(TIMER)):
17
17
  with open(str(TIMER), "w") as timer:
@@ -19,11 +19,11 @@ if not os.path.isfile(str(TIMER)):
19
19
  timer.write(current_time)
20
20
 
21
21
 
22
- # Adapted from codee given by Keith, as CRTS interface is not well-suited to scripted queries
22
+ # Adapted from code given by Keith, as CRTS interface is not well-suited to scripted queries
23
23
  def get_CRTS_lightcurve(pos, radius):
24
24
  ra, dec = pos[0], pos[1]
25
25
 
26
- survey_radius = int(radius/60)
26
+ survey_radius = int(radius / 60)
27
27
 
28
28
  with open(str(TIMER), "r") as timer:
29
29
  prev_query_time = timer.readline().split(":")
@@ -0,0 +1,75 @@
1
+ # Adapted from code given by Keith
2
+ def get_TESS_lightcurve(pos, radius):
3
+ """
4
+ Note on converting to magnitudes:
5
+
6
+ https://heasarc.gsfc.nasa.gov/docs/tess/observing-technical.html
7
+ says that 15000 e/s gives a magnitude of 10
8
+
9
+ Tess returns data in astropy quantities - flux in e/s
10
+
11
+ u.Magnitude(lc['flux']) is the same as -2.5*log10(lc['flux'])
12
+
13
+ so plugging in 15000 and m=10 gives zp=20.44*u.ABmag
14
+ """
15
+
16
+ import warnings
17
+
18
+ import astropy.units as u
19
+ import lightkurve as lk
20
+ import numpy as np
21
+ from astropy.table import Table, vstack
22
+
23
+ ra, dec = pos
24
+
25
+ Search = lk.search_lightcurve(
26
+ str(ra) + " " + str(dec), mission="TESS", radius=radius
27
+ )
28
+
29
+ if len(Search) > 0:
30
+ lcurve = []
31
+ for s in Search:
32
+ try:
33
+ lqq = s.download_all()
34
+ lcurve += lqq
35
+ except:
36
+ print("Note: experiencing issues with TESS.")
37
+ sectors = []
38
+ LC = Table([])
39
+ for lc in lcurve:
40
+ if lc.meta["SECTOR"] not in sectors:
41
+ sectors += [lc.meta["SECTOR"]]
42
+ warnings.simplefilter("ignore")
43
+ lc = lc[lc["flux"] > 0]
44
+ lc["mag"] = u.Magnitude(lc["flux"]) + 20.44 * u.ABmag
45
+ lc["mjd"] = lc["time"].mjd.astype("float")
46
+ try:
47
+ tab = lc.to_table()[
48
+ [
49
+ "time",
50
+ "flux",
51
+ "flux_err",
52
+ "sap_flux",
53
+ "quality",
54
+ "mag",
55
+ "mjd",
56
+ ]
57
+ ]
58
+ except:
59
+ tab = lc.to_table()[
60
+ ["time", "flux", "flux_err", "quality", "mag", "mjd"]
61
+ ]
62
+ tab["sap_flux"] = 0
63
+ has_nan = np.zeros(len(tab), dtype=bool)
64
+ for col in tab.itercols():
65
+ if col.info.dtype.kind in ["f", "i"]:
66
+ has_nan |= np.isnan(col)
67
+ tab_nonan = tab[~has_nan]
68
+ if len(LC) == 0:
69
+ LC = tab_nonan
70
+ else:
71
+ LC = vstack([LC, tab_nonan])
72
+ return LC.to_pandas()
73
+ else:
74
+ print("Note: TESS query returned no data.")
75
+ return None
@@ -82,9 +82,10 @@ class OverlayData(object):
82
82
  self.returned_data["non_gaia"][f"{mag}_marker_size"].append(
83
83
  (
84
84
  half_image_size / 50
85
- + (half_image_size / 75) ** radius_multiplier
85
+ + (half_image_size / 75) ** (radius_multiplier * 1.15)
86
86
  )
87
87
  * base_marker_size
88
+ + 0.0005
88
89
  )
89
90
  else:
90
91
  self.returned_data["non_gaia"][f"{mag}_marker_size"].append(None)