exovetter 0.0.9__py3-none-any.whl → 0.0.10__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.
@@ -4,6 +4,7 @@ import exovetter.centroid.disp as disp
4
4
  import exovetter.utils as utils
5
5
  import matplotlib.pyplot as plt
6
6
  import numpy as np
7
+ import warnings
7
8
 
8
9
 
9
10
  def compute_diff_image_centroids(
@@ -12,7 +13,7 @@ def compute_diff_image_centroids(
12
13
  period_days,
13
14
  epoch,
14
15
  duration_days,
15
- remove_transits,
16
+ remove_transits=None,
16
17
  max_oot_shift_pix=1.5,
17
18
  starloc_pix = None,
18
19
  plot=False
@@ -71,6 +72,9 @@ def compute_diff_image_centroids(
71
72
  OOT from In-transit.
72
73
  """
73
74
 
75
+ if remove_transits is None:
76
+ remove_transits = []
77
+
74
78
  isnan = np.isnan(time)
75
79
  time = time[~isnan]
76
80
  cube = cube[~isnan]
@@ -135,7 +139,18 @@ def measure_centroid_shift(centroids, kept_transits, plot=False):
135
139
  dcol = centroids[:, 4] - centroids[:, 0]
136
140
  drow = centroids[:, 5] - centroids[:, 1]
137
141
 
142
+ if centroids.size == 0:
143
+ raise RuntimeError("No difference-image centroids could be computed for this target.")
144
+
138
145
  flags = centroids[:, -1].astype(bool)
146
+ N_use = np.sum(~flags) # Check if there are enough TPFs left to actually centroid
147
+
148
+ if N_use < 2:
149
+ raise RuntimeError("TPF data quality flagged too many difference-image centroids "
150
+ "(<2 usable transits); centroid significance cannot be computed.")
151
+ elif N_use == 2:
152
+ warnings.warn("Only 2 usable difference-image centroids available; "
153
+ "centroid significance is not statistically reliable.", RuntimeWarning, stacklevel=2)
139
154
 
140
155
  offset_pix, signif = covar.compute_offset_and_signif(
141
156
  dcol[~flags], drow[~flags])
@@ -179,7 +194,18 @@ def measure_centroid_shift_cat(centroids, kept_transits, starloc_pix, plot=False
179
194
  dcol = centroids[:, 4] - starloc_pix[0]
180
195
  drow = centroids[:, 5] - starloc_pix[1]
181
196
 
197
+ if centroids.size == 0:
198
+ raise RuntimeError("No difference-image centroids could be computed for this target.")
199
+
182
200
  flags = centroids[:, -1].astype(bool)
201
+ N_use = np.sum(~flags)
202
+
203
+ if N_use < 2:
204
+ raise RuntimeError("TPF data quality flagged too many difference-image centroids "
205
+ "(<2 usable transits); centroid significance cannot be computed.")
206
+ elif N_use == 2:
207
+ warnings.warn("Only 2 usable difference-image centroids available; "
208
+ "centroid significance is not statistically reliable.", RuntimeWarning, stacklevel=2)
183
209
 
184
210
  offset_pix, signif = covar.compute_offset_and_signif(
185
211
  dcol[~flags], drow[~flags])
exovetter/version.py CHANGED
@@ -5,4 +5,4 @@ try:
5
5
  from setuptools_scm import get_version
6
6
  version = get_version(root='..', relative_to=__file__)
7
7
  except Exception:
8
- version = '0.0.9'
8
+ version = '0.0.10'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: exovetter
3
- Version: 0.0.9
3
+ Version: 0.0.10
4
4
  Summary: Exoplanet vetting package
5
5
  Home-page: https://github.com/spacetelescope/exovetter
6
6
  Author: Susan Mullally et al.
@@ -10,19 +10,19 @@ exovetter/tce.py,sha256=5JFKkbKoKCtdhm5EuW6FMAvp0LiaHLuqpFUbY0joyLI,7302
10
10
  exovetter/transit_coverage.py,sha256=Wix6TaQmEgRxlEZKB6WF3OFQVXqtJN1tBkltFaMDrHM,2194
11
11
  exovetter/trapezoid_fit.py,sha256=Dok-H0zRsfigh4zfVO4R6Wi2TgK6hQXh4EIIYGouxiQ,31097
12
12
  exovetter/utils.py,sha256=1K34N6sQ7iomf4oFHyqGubcDhNwTa2lF_uKEOGJGrCk,24909
13
- exovetter/version.py,sha256=aTtkNj5pQ4n7dp0c5uDacra2xVgSIstpL1dwb53cYWw,337
13
+ exovetter/version.py,sha256=Vkob9J5v8PZ7JQ_jf3gstZP71dMTETD1NfQnvhu4t_o,338
14
14
  exovetter/vetters.py,sha256=muqjSzFRs5gCrOV1OAjnTd2y7y_dU9hWJfKpqUK_9RY,37732
15
15
  exovetter/viz_transits.py,sha256=FUc8DEedaQQ8YDoeVvR1QyGPmh2oPGmVg27W3WrVguQ,5648
16
16
  exovetter/centroid/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
17
- exovetter/centroid/centroid.py,sha256=tNT1ZEQqN1t1Sijn9hJYjGQYCnguVE9iJp2MlL-vWN8,10785
17
+ exovetter/centroid/centroid.py,sha256=p7KWo12FgFmNUaBCzfAupMZjyco45U8wUoc5bKdZLZo,12125
18
18
  exovetter/centroid/covar.py,sha256=Ot_gLmVtuJ9T9REThOdOKzGPhHAT-AmE4mWaAcI8pic,8975
19
19
  exovetter/centroid/disp.py,sha256=Y7UeecpHuhzEyNb6F6_FoureXdIttongS_L4jbdNYgE,3692
20
20
  exovetter/centroid/fastpsffit.py,sha256=eRMxYUJ_4hsCxso4u1d1zQvFSJQlJ_gRzhNa2PXkKuE,4532
21
21
  exovetter/modshift/__init__.py,sha256=j5665q0RHVzbzdPBXv_jUozGB4sex8ANXtzB41EYzRQ,68
22
22
  exovetter/modshift/modshift.py,sha256=VEnj7ITvYRfqICyRiNeCZ9tqQ4d4fPOw8avB6TTbhIU,14773
23
23
  exovetter/modshift/plotmodshift.py,sha256=MMLkvxkOqBGIYGPN97_WtrHgTZsDzY_XRRNswhz5YQI,2452
24
- exovetter-0.0.9.dist-info/LICENSE.rst,sha256=uhiFz7eEG8WszLtRtYIT89FNMI3ijy1aACnvl5BOz2Y,1492
25
- exovetter-0.0.9.dist-info/METADATA,sha256=HJ5erRbKMEdxfb8-Ex3WDAo-lYD_shmONAUfj3T1UXk,3798
26
- exovetter-0.0.9.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
27
- exovetter-0.0.9.dist-info/top_level.txt,sha256=wh0_U5IPEspONX8zhGRaFUqfuovCGkgYjAmWuQe0w6Q,10
28
- exovetter-0.0.9.dist-info/RECORD,,
24
+ exovetter-0.0.10.dist-info/LICENSE.rst,sha256=uhiFz7eEG8WszLtRtYIT89FNMI3ijy1aACnvl5BOz2Y,1492
25
+ exovetter-0.0.10.dist-info/METADATA,sha256=Hu6Q353m2oscJ7YFuCVlEah3kP8BbSxnEmSkH5wYWAE,3799
26
+ exovetter-0.0.10.dist-info/WHEEL,sha256=WnJ8fYhv8N4SYVK2lLYNI6N0kVATA7b0piVUNvqIIJE,91
27
+ exovetter-0.0.10.dist-info/top_level.txt,sha256=wh0_U5IPEspONX8zhGRaFUqfuovCGkgYjAmWuQe0w6Q,10
28
+ exovetter-0.0.10.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.3.2)
2
+ Generator: setuptools (75.3.3)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5