Open anuj137 opened 2 months ago
Some suggestions already discussed with @anuj137 , so that I don't forget :
WaveformModes
object itself. This will avoid unnecessary computing wasted in evaluating the junk portion. WaveformModes
with junk radiation removed. Slicing a WaveformModes
object can be expensive (data - all mode + time axes and attributes will be copied) so that repeated evaluations are not expensive (e.g. if we use this in a PE)WaveformModes
for all choices of junk time ? or cache just the default metadata suggested choice?) and may not be necessaryif
statements are used to iterate through possiblities in get_td_waveform
. So it maybe better to do this at the metadata level before constructing the WaveformModes
obj.
This pull request addresses a bug in the draft pull request: https://github.com/gwnrtools/nr-catalog-tools/pull/49. The following changes have been made compared to the current
master
branch (commit hashe431f348c56f93d859630b8c4853e053405f2a3c
):WaveformModes.get_td_waveform()
via the boolean variableremove_junk
. If set toTrue
, the junk portion of the data is removed usingreference_time
before evaluating the modes.Compared to pull request #49, the following key changes have been made:
remove_junk=True
. This prevents interpolation in the junk-removed portion of the data.remove_junk_from_modes
has been added to handle the removal of modes, while the functionmodes_with_junk_removed
is now only used to check if the junk portion has already been removed.remove_junk_fudge_factor
, has been introduced toWaveformModes.get_td_waveform()
, with a default value of one. The junk portion of the data is now considered up toremove_junk_fudge_factor * reference_time
. This fudge factor allows for the selection of slightly larger or smaller values thanreference_time
for removing the junk.