brandynlucca / acousticTS

Theoretical TS models
Other
9 stars 0 forks source link

Pre-allocate model inputs within scatterer objects #32

Open brandynlucca opened 1 year ago

brandynlucca commented 1 year ago

Currently, some model parameters (e.g. frequency) are calculated when a scatterer object is initialized for a specific TS model. Generally, most model inputs are re-calculated with each call of target_strength(...). Once QOL changes listed in #28 are implemented, this would result in identical results being re-calculated over and over again which will significantly increase computation times for otherwise shared variables (such as for ESS objects via #30). In lieu of caching the results and potentially creating more overhead than necessary, the model slot can be amended to either permanently or temporarily store shared intermediate calculations (similar to the current implementation of SDWBA with reforged FLS objects held for different frequency bandwidths based on the number of position matrix segments).