diff --git a/cxx/src/lib/io/fileio.cc b/cxx/src/lib/io/fileio.cc index 51c9a8333..587ca3298 100644 --- a/cxx/src/lib/io/fileio.cc +++ b/cxx/src/lib/io/fileio.cc @@ -142,9 +142,18 @@ std::vector fwrite_to_file( fseek(fp,0L,2); for (int i = 0; i < d.member.size(); ++i) { +<<<<<<< HEAD + /* Silenetly skip dead data */ + if(d.member[i].dead()) continue; + long int foff = ftell(fp); + foffs.push_back(foff); + TimeSeries& t = d.member[i]; + if (fwrite((void *)t.s.data(), sizeof(double), t.npts(), fp) != t.npts()) +======= if(d.member[i].dead()) foffs.push_back(-1); else +>>>>>>> dac6e7f1729a67e87eaa44658263e18e705488aa { long int foff = ftell(fp); foffs.push_back(foff); @@ -207,9 +216,18 @@ std::vector fwrite_to_file(mspass::seismic::LoggingEnsemble>>>>>> dac6e7f1729a67e87eaa44658263e18e705488aa { if(d.member[i].dead()) continue; long int foff = ftell(fp); diff --git a/data/yaml/mspass.yaml b/data/yaml/mspass.yaml index 7ecd265fb..653a59e1a 100644 --- a/data/yaml/mspass.yaml +++ b/data/yaml/mspass.yaml @@ -66,6 +66,10 @@ Database: concept: Time shift applied to define relative time of 0.0 aliases: t0shift constraint: required + endtime: + type: double + concept: Time of last sample of data (epoch time or relative to some other time mark) + constraint: optional utc_convertible: type: bool concept: When true starttime_shift can be used to convert relative time to UTC. diff --git a/data/yaml/mspass_fdsn.yaml b/data/yaml/mspass_fdsn.yaml index fa35813e5..cc8ef2e9a 100644 --- a/data/yaml/mspass_fdsn.yaml +++ b/data/yaml/mspass_fdsn.yaml @@ -62,6 +62,10 @@ Database: concept: Time shift applied to define relative time of 0.0 aliases: t0shift constraint: required + endtime: + type: double + concept: Time of last sample of data (epoch time or relative to some other time mark) + constraint: optional utc_convertible: type: bool concept: When true starttime_shift can be used to convert relative time to UTC. diff --git a/data/yaml/mspass_lite.yaml b/data/yaml/mspass_lite.yaml index 66d2e3c1b..f70055f2a 100644 --- a/data/yaml/mspass_lite.yaml +++ b/data/yaml/mspass_lite.yaml @@ -37,6 +37,10 @@ Database: concept: Time shift applied to define relative time of 0.0 aliases: t0shift constraint: required + endtime: + type: double + concept: Time of last sample of data (epoch time or relative to some other time mark) + constraint: optional utc_convertible: type: bool concept: When true starttime_shift can be used to convert relative time to UTC. @@ -283,4 +287,5 @@ Metadata: readonly: false loc: collection: wf_Seismogram - readonly: false \ No newline at end of file + readonly: false + diff --git a/data/yaml/mspass_s3.yaml b/data/yaml/mspass_s3.yaml index eb11730fc..2473d8607 100644 --- a/data/yaml/mspass_s3.yaml +++ b/data/yaml/mspass_s3.yaml @@ -62,6 +62,10 @@ Database: concept: Time shift applied to define relative time of 0.0 aliases: t0shift constraint: required + endtime: + type: double + concept: Time of last sample of data (epoch time or relative to some other time mark) + constraint: optional utc_convertible: type: bool concept: When true starttime_shift can be used to convert relative time to UTC. diff --git a/python/mspasspy/db/database.py b/python/mspasspy/db/database.py index d17f265e4..b4a97bdb0 100755 --- a/python/mspasspy/db/database.py +++ b/python/mspasspy/db/database.py @@ -6508,6 +6508,9 @@ def _atomic_save_all_documents( # add tag - intentionally not set in mspass_object returned if data_tag: insertion_dict["data_tag"] = data_tag + # Always set starttime and endtime + insertion_dict["starttime"] = mspass_object.t0 + insertion_dict["endtime"] = mspass_object.endtime() else: # We need to clear data tag if was previously defined in # this case or a the old tag will be saved with this datum