mspass-team / mspass

Massive Parallel Analysis System for Seismologists
https://mspass.org
BSD 3-Clause "New" or "Revised" License
30 stars 12 forks source link

endtime handling #484

Open pavlis opened 8 months ago

pavlis commented 8 months ago

I don't know if we had this issue before or if I created it with the new Database implementation that was just merged to master. What I'm finding is that save_data is not saving an important metadata attribute with the key "endtime". That absolutely needs to be stored in wf documents as a very very common search is to select waveforms in a time interval. If endtime is not defined that becomes really awkward.

@wangyinz confirm you agree that saving endtime should be always done and I'll fix it.

pavlis commented 8 months ago

I looked at the code and realized this was an easy patch to fix. I just did it here on github and issued a pull request.

Note the problem was even worse than stated above. If a datum was windowed and then saved the start time would also be wrong because it wasn't being replaced in the document constucted form the datum.