jpdeleon/quicklook

ValueError: output array is read-only

Opened this issue · 0 comments

from quicklook import TessQuickLook

eb = TessQuickLook(target_name=tic_value, sector=71, pipeline="qlp")

Generating TQL for TIC 387515920...
All available lightcurves:
author mission t_exptime
0 SPOC TESS Sector 71 120.0
1 SPOC TESS Sector 70 120.0
2 TESS-SPOC TESS Sector 04 1800.0
3 TESS-SPOC TESS Sector 31 600.0
4 TESS-SPOC TESS Sector 42 600.0
5 TESS-SPOC TESS Sector 43 600.0
6 TESS-SPOC TESS Sector 44 600.0
7 TESS-SPOC TESS Sector 70 200.0
8 QLP TESS Sector 04 1800.0
9 QLP TESS Sector 31 600.0
10 QLP TESS Sector 42 600.0
11 QLP TESS Sector 43 600.0
12 QLP TESS Sector 44 600.0
13 QLP TESS Sector 70 200.0
14 QLP TESS Sector 71 200.0
15 TGLC TESS Sector 04 1800.0
16 GSFC-ELEANOR-LITE TESS Sector 04 1800.0
17 TASOC TESS Sector 04 1800.0
18 TASOC TESS Sector 04 1800.0

Downloaded QLP (exp=200.0 s) lc in sector 71.

Querying ephemeris for TIC 387515920:
epoch: 2459520.191396, 0.0015062
per: 3.9544873, 1.35e-05
dur: 1.716, 0.307

Using wotan's biweight method to flatten raw lc.
Transit Least Squares TLS 1.32 (5 Apr 2024)
Creating model cache for 38 durations
Searching 10724 data points, 2321 periods from 0.601 to 12.86 days
Using all 8 CPU threads
100%|██████████| 2321/2321 periods | 00:06<00:00
Searching for best T0 for period 12.83062 days
100%|██████████| 10724/10724 [00:01<00:00, 10071.47it/s]

fig = eb.plot_tql()

Estimating rotation period using Generalized Lomb-Scargle (GLS) periodogram.
WARNING: Highest peak is at the edge of the frequency range.
No output of frequency error.
Increase frequency range to sample the peak maximum.
Generalized LS - statistical output

Number of input points: 10666
Weighted mean of dataset: nan
Weighted rms of dataset: nan
Time base: 25.923914
Number of frequency points: 2573

Maximum power p [ZK]: nan
RMS of residuals: nan
Mean weighted internal error: nan
Best sine frequency: 0.077149 +/- nan
Best sine period: 12.961957 +/- nan
Amplitude: nan +/- nan

lightkurve.Periodogram properties:
Attribute Description Units


            nterms              1      
          targetid      387515920      
      default_view         period      
             label  TIC 387515920      
         ls_method           fast      

frequency_at_max_power 3.0965 1 / d
max_power 0.0064
nyquist 215.9975 1 / d
period_at_max_power 0.3229 d
frequency array (27988,) 1 / d
period array (27988,) d
power array (27988,)
meta <class 'dict'>
None
Plotting nearby Gaia sources on survey image.
Querying Gaia sources around the target.
Querying dss1 (2.97 arcmin x 2.97 arcmin) archival image

ValueError Traceback (most recent call last)
Cell In[703], line 1
----> 1 fig = eb.plot_tql()

File ~/src/quicklook/quicklook/tql.py:925, in TessQuickLook.plot_tql(self, **kwargs)
923 # +++++++++++++++++++++ax: odd-even
924 ax = axes.flatten()[6]
--> 925 _ = plot_odd_even_transit(
926 self.fold_lc, self.tls_results, bin_mins=10, ax=ax
927 )
929 # +++++++++++++++++++++ax: secondary eclipse
930 ax = axes.flatten()[7]

File ~/src/quicklook/quicklook/plot.py:63, in plot_odd_even_transit(fold_lc, tls_results, bin_mins, ax)
53 fold_lc.scatter(ax=ax, c="k", alpha=0.5, label="nolegend", zorder=1)
54 fold_lc[fold_lc.even_mask].bin(time_bin_size=bin_mins * u.minute).errorbar(
55 label="even transit",
56 c="#1f77b4",
(...)
61 zorder=2,
62 )
---> 63 fold_lc[fold_lc.odd_mask].bin(time_bin_size=bin_mins * u.minute).errorbar(
64 label="odd transit",
65 c="#d62728",
66 marker="o",
67 lw=2,
68 markersize=8,
69 ax=ax,
70 zorder=2,
71 )
72 ax.plot(
73 (tls_results.model_folded_phase - 0.5) * tls_results.period,
74 tls_results.model_folded_model,
(...)
78 label="TLS model",
79 )
80 ax.axhline(yline, 0, 1, lw=2, ls="--", c="k")

File /opt/anaconda3/envs/envM1v3123/lib/python3.12/site-packages/astropy/utils/decorators.py:603, in deprecated_renamed_argument..decorator..wrapper(*args, **kwargs)
600 msg += f"\n Use {alternative} instead."
601 warnings.warn(msg, warning_type, stacklevel=2)
--> 603 return function(*args, **kwargs)

File /opt/anaconda3/envs/envM1v3123/lib/python3.12/site-packages/lightkurve/lightcurve.py:1568, in LightCurve.bin(self, time_bin_size, time_bin_start, time_bin_end, n_bins, aggregate_func, bins, binsize)
1565 with warnings.catch_warnings():
1566 # ignore uninteresting empty slice warnings
1567 warnings.simplefilter("ignore", (RuntimeWarning, AstropyUserWarning))
-> 1568 ts = aggregate_downsample(
1569 self,
1570 time_bin_size=time_bin_size,
1571 n_bins=n_bins,
1572 time_bin_start=time_bin_start,
1573 aggregate_func=aggregate_func,
1574 **kwargs
1575 )
1577 # If flux_err is populated, assume the errors combine as the root-mean-square
1578 if np.any(np.isfinite(self.flux_err)):

File /opt/anaconda3/envs/envM1v3123/lib/python3.12/site-packages/astropy/timeseries/downsample.py:264, in aggregate_downsample(time_series, time_bin_size, time_bin_start, time_bin_end, n_bins, aggregate_func)
262 data = np.ma.zeros(n_bins, dtype=values.dtype)
263 data.mask = 1
--> 264 data[unique_indices] = reduceat(values, groups, aggregate_func)
265 data.mask[unique_indices] = 0
267 binned[colname] = data

File /opt/anaconda3/envs/envM1v3123/lib/python3.12/site-packages/astropy/timeseries/downsample.py:31, in reduceat(array, indices, function)
29 result.append(function(array[indices[i]]))
30 else:
---> 31 result.append(function(array[indices[i] : indices[i + 1]]))
32 result.append(function(array[indices[-1] :]))
33 return np.array(result)

File /opt/anaconda3/envs/envM1v3123/lib/python3.12/site-packages/numpy/lib/nanfunctions.py:1048, in nanmean(a, axis, dtype, out, keepdims, where)
1044 cnt = np.sum(~mask, axis=axis, dtype=np.intp, keepdims=keepdims,
1045 where=where)
1046 tot = np.sum(arr, axis=axis, dtype=dtype, out=out, keepdims=keepdims,
1047 where=where)
-> 1048 avg = _divide_by_count(tot, cnt, out=out)
1050 isbad = (cnt == 0)
1051 if isbad.any():

File /opt/anaconda3/envs/envM1v3123/lib/python3.12/site-packages/numpy/lib/nanfunctions.py:215, in _divide_by_count(a, b, out)
213 if isinstance(a, np.ndarray):
214 if out is None:
--> 215 return np.divide(a, b, out=a, casting='unsafe')
216 else:
217 return np.divide(a, b, out=out, casting='unsafe')

ValueError: output array is read-only