Incorrectly reconstructed Fourier frequency array
Maintainers usually reply within 3 days
Nobody has claimed this yet.
- #881 by @Sauravroy34 — closed without merging
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Trace VarEnergyspectrum through avg_pds_from_timeseries and _get_good_frequency_bins, comparing their use of fftfreq and the two bin-count calculations. Reproduce the seg_size=5 and time_res=0.03 example, then verify that both paths produce compatible frequency arrays and that frequency masking no longer fails.
Written by the indexing model from the issue text.
Description
Description of the Bug
We typically have two ways to construct arrays of Fourier frequency. One is to take the size of a segment to calculate the number of bins (e.g. flux.size), another is to calculate the number of bins in a segment of given size with numpy.rint by hand. The bug is these two methods round non-integers differently, and as a result the two arrays are not necessarily the same.
Steps/Code to Replicate the Bug
seg_size = 5
time_res = 0.03
freq_int = fftfreq(int(seg_size/time_res),time_res)
freq_rint = ftfreq(int(np.rint(seg_size/time_res))),time_res)
Expected Results
These two should be the same the parts of the code that use either method to be consistent.
Actual Results
int(5/0.03) = 166 and np.rint(5/0.03) = 167.
The result is that parts of the code that call the two methods, one can get an error due to the array masking not working correctly. For example, VarEnergyspectrum uses the first method in the initialization when calling avg_pds_from_timeseries, and the second in _get_good_frequency_bins().
- Dominant language
- Python
- Stars
- 229
- Forks
- 196
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 20
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from StingraySoftware/stingray
-
create_gti_mask drops valid points after empty GTIs and crashes with min_length > 0 and dtPossibly taken @Rohan-Dedhia claimed this 5 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
StingraySoftware/stingray#1044 ·
Maintainers usually reply within 3 days
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
StingraySoftware/stingray#1042 · 1 comment ·
Maintainers usually reply within 3 days
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
StingraySoftware/stingray#1039 · 1 comment ·
Maintainers usually reply within 3 days
-
stingray: arbitrary code execution reading a pickle-format data product (read fmt=pickle) (CWE-502)May be free again @yash-8923 claimed this 11 days ago, and no pull request is open. Open
Difficulty 3/5 1-2 days Newbie friendliness 55/100
StingraySoftware/stingray#1037 · 3 comments ·
Maintainers usually reply within 3 days
-
AveragedCrossspectrum returns zeros when using simulated light curves with input_counts=False.Possibly taken @VrtxOmega claimed this 176 days ago. Openbug help wanted
Difficulty 4/5 3-5 days Newbie friendliness 52/100
StingraySoftware/stingray#977 · 1 comment ·
Maintainers usually reply within 3 days
All issues in StingraySoftware/stingray
Similar issues
-
accepted
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
future-agi/future-agi#6392 ·
Maintainers usually reply within 1 day
-
memmapped_arange ignores the start value and drops the last point above the memmap thresholdPossibly taken @prathameshfuke claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
StingraySoftware/HENDRICS#213 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days
-
bot-triaged module: decompositions module: edge cases module: int overflow module: primTorch oncall: pt2 triage review
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day