Skip to content

Commit 1fa9303

Browse files
authored
Merge pull request #1102 from rzellem/develop
Properly indexing BJD times for lightcurve analysis
2 parents 9df6d32 + 8476201 commit 1fa9303

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

exotic/exotic.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -1196,6 +1196,12 @@ def stellar_variability(ref_flux, lmfit, times, comp_stars, id, vsp_comp_stars,
11961196
comp_mask = [True if i in intx_times else False for i in comp_flux['myfit'].time]
11971197
OOT = (np.array(comp_flux['myfit'].transit)[comp_mask] == 1)
11981198

1199+
if not OOT.any():
1200+
log_info("Data does not contain any Out-Of-Transit portions.\n"
1201+
"Magnitude of star will not be calculated.\n"
1202+
"EXOTIC will continue to produce a lightcurve.\n", warn=True)
1203+
return None
1204+
11991205
vsp_label = [key for key, value in vsp_comp_stars.items() if value['xy'] == comp_xy][0]
12001206
curr = OOT[0]
12011207
idxs = []
@@ -1846,7 +1852,7 @@ def main():
18461852
log_info(f"\nChecking for variability in Comparison Star #{compn+1}:"
18471853
f"\n\tPixel X: {comp[0]} Pixel Y: {comp[1]}")
18481854
if variableStarCheck(ra_file[int(comp[1])][int(comp[0])], dec_file[int(comp[1])][int(comp[0])]):
1849-
log_info("\nCurrent comparison star is variable, proceeding to next star.")
1855+
log_info("\nCurrent comparison star is variable, proceeding to next star.", warn=True)
18501856
exotic_infoDict['comp_stars'].remove(comp)
18511857

18521858
if exotic_infoDict['aavso_comp'] == 'y':
@@ -2203,10 +2209,10 @@ def main():
22032209
if "BJD_TDB" in image_header or "BJD" in image_header or "BJD_TBD" in image_header:
22042210
goodTimes = nonBJDTimes
22052211

2206-
index_list = np.intersect1d(times, nonBJDTimes)
2212+
index_list = [i for i, time_ in enumerate(times) if time_ in nonBJDTimes]
22072213
good_jd_times = [jd_times[i] for i in index_list]
22082214
for key, val in ref_flux_dict.items():
2209-
index_list = np.intersect1d(times, ref_flux_dict[key]['myfit'].time)
2215+
index_list = [i for i, time_ in enumerate(times) if time_ in ref_flux_dict[key]['myfit'].time]
22102216
ref_flux_dict[key]['time'] = [jd_times[i] for i in index_list]
22112217

22122218
# If not in there, then convert all the final times into BJD - using astropy alone

exotic/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '2.1.1'
1+
__version__ = '2.2.0'

0 commit comments

Comments
 (0)