Closed jkingslake closed 1 month ago
cc @glugeorge
This errors has been in the code form the beginning, so all power profiles we have processed with this code were made with chirps containing two erroneous zeros. I don't know if this makes a significant difference, but it is something worth double checking I think.
PR #51 will close this.
closed with #51
When the chirps are padded and rolled (in one step) prior to performing the fft in
ChirpObject.FormProfile
, the indexing is slightly wrong and it does not replace two values in an array of zeros with data when they should be.In the two lines starting here parts of an array of zeros are replaces with two parts of the chirp - the first half and the second half. The Indexing goes to -1, as follows
but because numpy's index excludes the final index, indexing till -1 is like saying you want to stop at the penultimate element.
returns [0 1]
This didn't raise an error because it simply didn't replace the final value in padchirp (padchirp[-1]) and a value to the right of the data on the left (padchirp[math.floor(Nt/2)-1]).
A simple patch would be to replace these two lines with
A better solution would be overhaul that section of the code and instead use
np.pad
andnp.roll