Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug in index_miniseed #490

Closed
pavlis opened this issue Jan 18, 2024 · 0 comments · Fixed by #491
Closed

bug in index_miniseed #490

pavlis opened this issue Jan 18, 2024 · 0 comments · Fixed by #491

Comments

@pavlis
Copy link
Collaborator

pavlis commented Jan 18, 2024

I'm not sure if this bug is in index_minseed or how the new version of read_data handles miniseed data. The problem is easily seen in this output:

doc=db.wf_miniseed.find_one()
d = db.read_data(doc,collection='wf_miniseed')
print(d)
print(d.tref)

generates:

{'_id': ObjectId('6580a1519f5344e14cfdbd15'), 'chan': 'BHE', 'channel_endtime': 1427673599.000000, 'channel_hang': 90.000000, 'channel_id': ObjectId('6580a29030aaf53a22c03210'), 'channel_starttime': 1276646400.000000, 'channel_vang': 90.000000, 'delta': 0.050000, 'dfile': 'event401.mseed', 'dir': '/N/slate/pavlis/usarray/wf/2012', 'foff': 0, 'format': 'mseed', 'is_abortion': False, 'last_packet_time': 1344691259.549998, 'nbytes': 69632, 'net': '2G', 'npts': 72000, 'sampling_rate': 20.000000, 'site_endtime': 1427673599.000000, 'site_id': ObjectId('6580a29030aaf53a22c03210'), 'site_starttime': 1276646400.000000, 'source_id': ObjectId('6580a2a330aaf53a22c047c2'), 'sta': 'IUGFS', 'starttime': 1344687797.699998, 'storage_mode': 'file'}
TimeReferenceType.Relative

where the biggest issue is the last line printed: TimeReferencType.Relative. miniseed data is dogmatically UTC time standard.

The following trivial function is an easy workaround for a parallel workflow:

def set_tref(d):
     d.tref = TimeReferenceType.UTC
    return d

where you just use that function in map operator to fix the problem. We still need to fix it though as it is blatantly wrong. I think the main fix needs to be applied to index_mseed_file as it should be setting the metadata attribute "time_standard" and as the print(doc) statement shows that is not set in that or any other wf_miniseed the current container creates.

BTW I think this problem has been around for a while. I didn't touch index_mseed_file in the major revision of Database in the current container.

@wangyinz wangyinz linked a pull request Jan 18, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant