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

check stage 1 input units against instrument code #96

Closed
crotwell opened this issue Jan 31, 2020 · 11 comments
Closed

check stage 1 input units against instrument code #96

crotwell opened this issue Jan 31, 2020 · 11 comments

Comments

@crotwell
Copy link
Contributor

Potentially useful to have a rule that the Stage 1 input units for a channel with instrument code of H or L should be m/s and for instrument code N to be m/s**2, so input units for a velocity seismometer should be velocity, and accelerometer should be acceleration?

Also apply similar to InstrumentSensitivity input units.

Similarly output units of last stage should be count.

Other instrument codes might also have similar input unit rules.

@metempleton
Copy link
Collaborator

metempleton commented Feb 3, 2020 via email

@chad-earthscope
Copy link

That would disallow using centimeters, millimeters, micrometers, nanometers. They are not common, but do we want to error-out on them? Hmm. It would be good to catch the expected time dimension for sure.

@crotwell
Copy link
Contributor Author

crotwell commented Feb 4, 2020

Point take, but a rule saying BHZ should have input units of some kind of velocity, ie convertible to m/s, would be good.

For old L instrument code accelerometers, the rule could be to allow either velocity or acceleration, but would error on displacement, or temperature or...

@timronan
Copy link
Collaborator

timronan commented Feb 4, 2020

This seems like these rules would be too restrictive as errors and should be potentially included as warnings. The rules could be something similar too:

| Rule ID | Description | Type |

| 406 | IF Channel:Code == ("?H?" OR "?L?") AND (Stage[1]:InputUnit != ?m/s OR Stage[Last]:OutputUnits != count?) THEN FAIL | Warning |

| 407 | IF Channel:Code == "?N?" AND (Stage[1]:InputUnit != (?m/s OR ?m/s**2) OR Stage[Last]:OutputUnits != count?) THEN FAIL | Warning |

Are there any objections to including these?

@rcasey-earthscope
Copy link

rcasey-earthscope commented Feb 4, 2020 via email

@timronan
Copy link
Collaborator

timronan commented Apr 8, 2020

Should this warning be added? Have we come to a consensus?

@metempleton
Copy link
Collaborator

metempleton commented Apr 8, 2020 via email

@timronan
Copy link
Collaborator

timronan commented Apr 8, 2020

Thanks Mary, I will add this rule as a warning.

timronan pushed a commit that referenced this issue Apr 10, 2020
@timronan
Copy link
Collaborator

This issue has been addressed by rule:

321: If Channel:Code[2] == (H | L | M | N) then Stage[1]:InputUnit must equal m/s AND Stage[Last]:OutputUnits must equal count*

Validator version stationxml-validator-1.7.0-RC-01, available on the Validator's releases page, includes this rule.

Please verify this function works satisfactorily and report or close the issue based on your findings.

@metempleton
Copy link
Collaborator

metempleton commented Apr 27, 2020 via email

@timronan
Copy link
Collaborator

We will omit M in this next RC. Thanks for catching this.

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

No branches or pull requests

5 participants