Print out more frequency digits
In the PSDs saved to file (for example in glitch_median_PSD_forLI_L1.dat
) the current string format of %g
isn't sufficient to print out the actual frequency series for long-duration PSDs. For example, for a 512s PSD I made the file starts with
0 0.00390625
0.00195312 0.00390625
0.00390625 0.00390625
0.00585938 0.00390625
0.0078125 0.00390625
0.00976562 0.00390625
0.0117188 0.00390625
0.0136719 0.00390625
which almost good enough (the first entry is missing the last 5
in 0.001953125
for it to be an actual deltaF=1/512
.
At the end of the file though it reads
1023.97 6.07368e-48
1023.97 5.99066e-48
1023.97 5.90889e-48
1023.97 5.82836e-48
1023.97 5.74905e-48
1023.98 5.67092e-48
1023.98 5.59397e-48
1023.98 5.51817e-48
1023.98 5.4435e-48
1023.98 5.36994e-48
1023.99 5.29748e-48
1023.99 5.22609e-48
1023.99 5.15576e-48
1023.99 5.08646e-48
1023.99 5.01819e-48
where clearly the saved frequencies have been rounded down to something not super relevant...
Fortunately, just defaulting to saving a (significantly) larger number of digits past the decimal point should be enough, or switching to %e
formatting instead of %g
, but I think that you'd need to increase the number of significant digits anyways.