Closed renereimann closed 11 months ago
Think issue is addressed if users stick to the CRESanaModel class. AnalyticSimulation
does not take sampling rate as parameter by design because the trajectory needs to be oversampled compared to the sampling of the antenna and thus the Electron simulation sampling rate should be different.
While
Simulation()
takessr
as parameter,AnalyticSimulation()
takesn_samples
andt_max
as parameters. Sampling rate, n_sample and t_max are not independent but given by n_sample = sampling rate t_max. Inconsistent use of them leads to random issues in the simulation. In AnalyticSimulation() the sampling rate is calculated based on n_samples and t_max. If the user does not pay attention to relating the three quantities together the output may be random, e.g. if n_sample > srt_max the array contains the singal of length sr*t_max followed by zeros or random things.If Simulation and AnalyticSimulation takes the same set of parameters the confusion may be reduced. If the consistency is checked explicitly the consistent use is enforced and the user can not produce random things.