Open Brtle opened 6 years ago
Refers to #152. Yes, that should be done.
Hold on a second ... where do you send the messages to? scmag does not listen for MAGNITUDE group and would not get the messages anyway. What do you expect from scmag once it receives the information about removed magnitudes? To recompute them?
I indeed want to recompute the magnitudes. My script looks like:
ep = DataModel.EventParameters()
DataModel.Notifier.Enable()
if self.remove_magnitudes is not None:
self._remove_magnitudes(origin)
if self.remove_amplitudes is not None:
self._remove_amplitudes(ep, origin)
DataModel.Notifier.Create(ep, DataModel.OP_UPDATE, origin)
DataModel.Notifier.Disable()
message = DataModel.Notifier.GetMessage(True)
self.connection().send(message)
The idea is to remove amplitudes and magnitudes and let scamp
and scmag
recompute the new objects. The message is sent to the LOCATION group.
However, if scamp
isn't enable or doesn't calculate a new amplitude, the old cached magnitude will still exist in scmag
. I think magnitudes should be removed from the cache in the removeObject
method so that the old magnitudes are not reused without amplitudes.
Some times ago, the
removeObject
method have been implemented inscamp
to allow the removal of amplitude in its cache. Could you implement it for thescmag
module as well?I have the same issue that the
scamp
module. I have a custom Python script which remove Magnitude, StationMagnitude and StationMagnitudeContribution but I think the cache keep them in memory. It would be great if the magnitudes could be removed!