Code Review: generate_waveform.py
-
It may be good to add a few more sanity checks at the start of the validate_parameters
. For example, check if the masses are positive here? One could pass m1 = 100 and m2 = -10 and this won't be caught until sometime later? -
Similarly, add a check that the spin magnitudes <= 1? -
Given the earlier confusion, maybe a one-line comment to explain why this and this are happenning would be good (for future reference) -
InGeraint was looking at the wrong line of code, should be this one which hasgenerate_td_polarizations_conditioned_2
we have a line in the frequency bound with(1.0 + extra_time_fraction) * tchirp + tmerge + textra
whearas the line in lalsimulation implementsfstart = XLALSimInspiralChirpStartFrequencyBound((1.0 + extra_time_fraction) * tchirp, m1, m2);
. So a factor of (tmerge + textra) difference?XLALSimInspiralTDConditionStage1(*hplus, *hcross, extra_time_fraction * tchirp + textra, original_f_min);
, so all good. -
In generate_fd_polarizations
this line hasf_nyquist = np.ldexp(0.5, chirplen_exp[1]) * deltaF
wheras SimInspiralFD usesf_nyquist = ldexp(1.0, chirplen_exp) * deltaF;
here. 0.5 vs 1.0 passed to ldexp? -
Add sanity checks to parameters when calling generate_modes_opt
-
Add sanity checks to generate_td_modes
: delta_t, f_min, distance, approximant,
Edited by Geraint Pratten