Inconsistent behaviour of tstart and tseg after using lc.truncate
I maintainer di solito rispondono entro 3 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 38/100
Direzione di ricerca
Riproduci gli esempi forniti con GTI e no-GTI, quindi esamina il metodo truncate in base.py, in particolare le assegnazioni a new_ts.tstart e new_ts.tseg. Confronta i valori troncati con l'array temporale aggiornato e dt in entrambi i casi. Il lavoro è completato quando tstart e tseg si comportano in modo coerente prima e dopo il troncamento.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description of the Bug
If a lightcurve with a gti is truncated, tstart and tseg behave inconsistently before and after the truncation. Prior to truncation, both are defined based on the times and dt e.g. tstart is defined in the usual way time[0] - dt/2.
After truncating tstart is defined by the first GTI starting time and tseg (incorrectly) based on the gti first and last times. I would have reopened #751 but I don't have privileges.
In truncate method of base.py, I don't think this is correct:
new_ts.tstart = new_ts.gti[0, 0]
new_ts.tseg = new_ts.gti[-1, 1] - new_ts.gti[0, 0]
I think the new tstart and tseg should be defined based on the updated times, unless I'm missing something. If we agree on that I could try to fix it myself.
Steps/Code to Replicate the Bug
from stingray import Lightcurve
import numpy as np
times = np.arange(50)
mean_flux = 100.0
std_flux = 2.0
flux = np.random.normal(loc=mean_flux, scale=std_flux, size=len(times))
flux_err = np.ones_like(flux) * std_flux
lc = Lightcurve(times, flux, err=flux_err, err_dist="None", dt=1.0, skip_checks=True)
# No GTI
lc = Lightcurve(times, flux, err=flux_err, err_dist="None", dt=1.0, skip_checks=True)
print("No GTI\n=====")
print("Tstart before truncating", lc.tstart)
print("Tseg before truncating", lc.tseg)
newlc = lc.truncate(10, method="time")
print("Tstart after truncating", newlc.tstart)
print("Tstart after truncating", newlc.tseg)
# GTI
gti = [[25, 30], [40, 45]]
lc = Lightcurve(times, flux, err=flux_err, gti=gti, err_dist="None", dt=1.0, skip_checks=True)
print("GTI\n=====")
print("Tstart before truncating", lc.tstart)
print("Tseg tefore truncating", lc.tseg)
newlc = lc.truncate(10, method="time")
print("Tstart after truncating", newlc.tstart)
print("Tseg after truncating", newlc.tseg)
Expected Results
tstart should be defined consistently throughout, as lc.time[0] - lc.dt/2 I would say.
Same thing for tseg, which should be defined based on lc.time and lc.dt and not on the gti.
Actual Results
No GTI
Tstart before truncating -0.5
Tseg before truncating 50.0
Tstart after truncating 9.5
Tstart after truncating 40.0
GTI
Tstart before truncating -0.5
Tseg tefore truncating 50.0
Tstart after truncating 25.0
Tseg after truncating 20.0
- Lingua principale
- Python
- Stelle
- 229
- Fork
- 196
- Merge medio
- 4g 12h
- PR unite (30g)
- 20
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di StingraySoftware/stingray
-
create_gti_mask drops valid points after empty GTIs and crashes with min_length > 0 and dtForse già presa @Rohan-Dedhia l’ha presa 5 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
StingraySoftware/stingray#1044 ·
I maintainer di solito rispondono entro 3 giorni
-
Docstrings that name parameters the function does not take: full list, categorised (25 sites)Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
StingraySoftware/stingray#1042 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
StingraySoftware/stingray#1039 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
-
stingray: arbitrary code execution reading a pickle-format data product (read fmt=pickle) (CWE-502)Forse di nuovo libera @yash-8923 l’ha presa 11 giorni fa e non c’è nessuna pull request aperta. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
StingraySoftware/stingray#1037 · 3 commenti ·
I maintainer di solito rispondono entro 3 giorni
-
AveragedCrossspectrum returns zeros when using simulated light curves with input_counts=False.Forse già presa @VrtxOmega l’ha presa 176 giorni fa. Apertabug help wanted
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
StingraySoftware/stingray#977 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
Tutte le issue di StingraySoftware/stingray
Issue simili
-
Public benchmark import end-to-end test fails when the test stack's worker runs the parity jobApertaaccepted
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
future-agi/future-agi#6392 ·
I maintainer di solito rispondono entro 1 giorno
-
memmapped_arange ignores the start value and drops the last point above the memmap thresholdForse già presa @prathameshfuke l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
StingraySoftware/HENDRICS#213 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni
-
bot-triaged module: decompositions module: edge cases module: int overflow module: primTorch oncall: pt2 triage review
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno