diff --git a/docs/README.md b/docs/README.md index 0642264..dae689d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,6 +1,6 @@ # StationXML Validator -The IRIS stationxml-validator is a Java library and related command-line tool for validating FDSN-StationXML documents against a set of rules. +The IRIS stationxml-validator is a Java library and related command-line utility for validating FDSN-StationXML documents against a set of rules. For more information please refer to the project Wiki: diff --git a/docs/index.md b/docs/index.md index c8ea0f3..185f001 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,6 +1,6 @@ ## Description -The IRIS stationxml-validator is a Java library and related command-line tool for validating [FDSN StationXML](http://www.fdsn.org/xml/station/) documents. The purpose is ensure that FDSN StationXML metadata is complete and formatted sufficiently for acceptance at the [IRIS DMC](http://ds.iris.edu/). +The IRIS stationxml-validator is a Java library and related command-line utility for validating [FDSN StationXML](http://www.fdsn.org/xml/station/) 1.1 documents. The program's purpose is to ensure that FDSN StationXML metadata are complete and formatted to standards set by [IRIS DMC](http://ds.iris.edu/). ## Documentation * [Validation tests](tests.md) @@ -10,55 +10,77 @@ The IRIS stationxml-validator is a Java library and related command-line tool fo ### Downloading releases -Releases of the StationXML Validator can be downloaded from the project release page: +Releases of the StationXML Validator can be downloaded from the project's release page: https://github.com/iris-edu/StationXML-Validator/releases The compiled .jar may be used immediately. -If you wish to compile you can download the source code and follow the [instructions below](#building-the-command-line-validator-from-source). +If you wish to compile the program, the source code is available. Follow the [instructions below](#building-the-command-line-validator-from-source) to download the source code. ## Using the Validator -The command line version of the Validator requires [Java](https://www.java.com/) 8 or 11. A usage message will be printed if no arguments are supplied: +The Validator's jar runs in both [Java](https://www.java.com/) 8 or 11 enviroments. A usage message will be printed if the stationxml-validator is run with no arguments are supplied: - java -jar station-xml-validator-1.5.9.6.jar + java -jar stationxml-validator-1.7.0.jar -To validate a StationXML file provide the name of the StationXML formatted document with the file extensaion .xml on the command line: +The Validator contains arguments that output messages to help users understand its function. The Validator's --help argument prints out a list of all of the available validator arguments. + + java -jar stationxml-validator-1.7.0.jar --help - java -jar station-xml-validator-1.5.9.6.jar IU.ANMO.00.BHZ.xml +The rules argument prints the list of rules that the validator uses to check metadata integrety. + + java -jar stationxml-validator-1.7.0.jar --rules -The Validator accepts dataless seed files as input arguments. If dataless files are provided, the Validator automatically converters these files to station-xml and performs a validation. +The units argument prints a table of SI units names that are acceptable in stationXML metadata. - java -jar station-xml-validator-1.5.9.6.jar IU.ANMO.00.BHZ.dataless + java -jar stationxml-validator-1.7.0.jar --units -Users interested in generating StationXML formatted metadata from dataless seed files should refer to the [stationxml-seed-converter](https://github.com/iris-edu/stationxml-seed-converter). +To validate stationXML metadata, provide the path and name of a stationXML formatted document as an argument. -The Validator has options for formatting results. By default, the validator returns html. For viewing results quickly the argument `--format report` is helpful and returns text output to the terminal. + java -jar stationxml-validator-1.7.0.jar IU.ANMO.00.BHZ.xml - java -jar station-xml-validator-1.5.9.3.jar IU.ANMO.00.BHZ.xml --format report +The input argument may be prepended before the path. -Refer to the usage message for more arguments. + java -jar stationxml-validator-1.7.0.jar --input IU.ANMO.00.BHZ.xml + +The Validator accepts dataless SEED metadata and directories in addation to stationXML. If dataless files are provided, the Validator automatically converters these files to stationXML and performs validation. If a directory is provided as an argument, the Validator will loop through it's contents and validate both stationXML and dataless files. + + java -jar station-xml-validator-1.7.0.jar IU.ANMO.00.BHZ.dataless + java -jar stationxml-validator-1.7.0.jar /path/to/metadata + +Output are printed to System.out by default. The ouput argument directs Validator messages to the full path name supplied to the argument. + + java -jar stationxml-validator-1.7.0.jar /path/to/metadata --output /path/for/output.txt + +Additional arguments may be provided to the Validator including: `--verbose` which provides additional output messages to the user, and `continue-on-error` which forces the validator to continue if an exception is encountered. `continue-on-error` is only useful when validating directories. + + java -jar stationxml-validator-1.7.0.jar /path/to/metadata --verbose --continue-on-error --output /path/for/output.txt + +Users interested in generating stationXML formatted metadata from dataless SEED files should refer to the [stationxml-seed-converter](https://github.com/iris-edu/stationxml-seed-converter). ## Validation tests -The validator performs a number of tests starting with validation of the StationXML schema followed by a number of other tests to ensure completeness sufficient for long-term archiving. All tests with descriptions are listed on the wiki pages: +The validator performs a number of tests. First, it validates the metadata against the StationXML 1.1 schema. After, a suite of test are run on the metadata to ensure completeness sufficient for long-term archiving. The test and their descriptions can be accessed using the `--rules` argument or can be found on the wiki pages: [[Validation tests]] - ## Convention for Units -The Validator includes a rule to check the unit names specified in StationXML metadata. The guidelines for unit names and the list of accepted names are available on the page below: +The Validator includes rules that check if unit names specified in StationXML metadata are SI compliant. The guidelines for unit names and the list of accepted unit names can be accessed using the `--units` argument or can be found on the wiki pages: [[Unit name overview for IRIS StationXML validator]] ## Building the command line validator from source -To build the stationXML-validator from source code you will need a working instance of the Java Development Kit (JDK 1.8) and [Apache Maven](https://maven.apache.org/). The validator can be built using these steps: +Building the stationxml-validator from source code is dependent on the Java Development Kit (JDK 1.8) and [Apache Maven](https://maven.apache.org/). The validator can be built using these steps: + +1. Download source code and untar/unzip. The code can be downloaded either from the project's [release](https://github.com/iris-edu/StationXML-Validator/releases) page or it can be cloned from the Validator's [git repository](https://github.com/iris-edu/stationxml-validator/) +1. cd to the newly created stationxml-=validator directory +1. run the command: `mvn clean install` + +The resulting jar is under the target directory. e.g. stationxml-validtor-.jar -1. Download source code and untar/unzip, either a [release](https://github.com/iris-edu/StationXML-Validator/releases) or clone the repository -1. Change to the created StationXML-Validator- directory -1. `mvn clean install` +Pleae report any any issues to the project's [issues page](https://github.com/iris-edu/stationxml-validator/issues). -The resulting jar is under the _target_ directory, e.g. stationxml-validtor-.jar +[Updated 04-2020] diff --git a/docs/orientation.md b/docs/orientation.md index d65c53b..b5f24c6 100644 --- a/docs/orientation.md +++ b/docs/orientation.md @@ -4,14 +4,16 @@ From the SEED 2.4 (August 2012) Manual, Appendix A **Azimuth: degrees from north, clockwise.** **Dip: degrees from horizontal.** -The azimuth and dip describe the direction of an instrument's sensitive axis (if applicable). Motion in the same direction as this axis is positive. If instruments are reversed in the field, reverse the dip/azimuth fields. Data collection centers and data management centers should never actually modify the data, but report on its orientation. +The azimuth and dip describe the direction of an instrument's sensitive axis (if applicable). Motion in the same direction as the axis is positive. An instrument's reported dip and azimuth must reflect how an instrument is deployed. If instrument polarity is reversed in the field than the dip and azimuth must be consistent with this fact. Best practices in metadata exchange suggest that insturment orientation should never be corrected and subsquently exchanged using post processing techniques. ## Orthogonal Orientations
N — Dip 0, Azimuth 0 degrees (Reversed: Dip 0, Azimuth 180 degrees).
E — Dip 0, Azimuth 90 degrees (Reversed: Dip 0, Azimuth 270 degrees).
Z — Dip -90, Azimuth 0 degrees (Reversed: Dip 90, Azimuth 0 degrees). If orthogonal instrument orientations are not within a 5 degree tolerance of N,E,Z, use non-traditional orthogonal orientations. + ## Non-traditional Orthogonal Orientations +
1 — Channel Azimuth is greater than 5 degrees from north (Reversed: south).
2 — Channel Azimuth is greater than 5 degrees from east (Reversed: west).
3 — Channel Dip is greater than 5 degrees from vertical. -[2018-08-02] +[Updated 04-2020] diff --git a/docs/restrictions.md b/docs/restrictions.md index af002ae..a2e87bb 100644 --- a/docs/restrictions.md +++ b/docs/restrictions.md @@ -1,10 +1,10 @@ # Network # Station # Channel -* **[C1](https://github.com/iris-edu/StationXML-Validator/blob/master/Validator_TestSuite/Restrictions/P1_C1.xml)** : Channel:Code == "SOH", "ACE", "OCF", "LOG", "VCE", "LCE", "LCQ","VCO", "VEA", "VEC", "VEP", "VKI", "VM1", "VM2", "VM3", "VPB" does not trigger [Validation tests](https://github.com/iris-edu/StationXML-Validator/wiki/Validation-tests) that are subject to this restriction. +* **[C1](https://github.com/iris-edu/StationXML-Validator/blob/master/Validator_TestSuite/Restrictions/P1_C1.xml)** : Channel:Code =="ACE", "ATC", "BDO", "EX1", "EX2", "EX3", "EX4", "EX5", "EX6", "EX7", "EX8", "EX9", "GAN", "GEL", "GLA", "GLO", "GNS", "GPL", "GPS", "GST", "LCA", "LCB", "LCC", "LCD", "LCE", "LCF", "LCG", "LCH", "LCI", "LCJ", "LCK", "LCL", "LCM", "LCN", "LCO", "LCP", "LCQ", "LCR", "LCS", "LCT", "LCU", "LCV", "LCW", "LCX", "LCY", "LCZ", "LDE", "LDN", "LDZ", "LEE", "LED", "LEO", "LEP", "LII", "LKI", "LOG", "LPL", "OAC", "OCF", "QBD", "QBP", "QDG", "QDL", "QDR", "QEF", "QG1", "QGD", "QID", "QLD", "QPD", "QRD", "QRT", "QTP", "QTH", "QTP", "QWD", "SBT", "SCA", "SCB", "SCC", "SCD", "SCE", "SCF", "SCG", "SCH", "SCI", "SCJ", "SCK", "SCL", "SCM", "SCN", "SCO", "SCP", "SCQ", "SCR", "SCS", "SCT", "SCU", "SCV", "SCW", "SCX", "SCY", "SCZ", "SDG", "SDL", "SDT", "SIO", "SOH", "SMD", "SNI", "SPK", "SPO", "SRD", "SSL", "SSQ", "STH", "SWR", "TSA", "TSB", "TSC", "TSD", "TSE", "TSF", "TSG", "TSH", "TSI", "TSJ", "TSK", "TSL", "TSM", "TSN", "TSO", "TSP", "TSQ", "TSR", "TSS", "TST", "TSU", "TSV", "TSW", "TSX", "TSY", "TSZ", "TS0", "TS1", "TS2", "TS3", "TS4", "TS5", "TS6", "TS7", "TS8", "TS9", "VAP", "VCE", "VCO", "VCQ", "VDT", "VEA", "VEB", "VEC", "VED", "VEE", "VEF", "VEG", "VEH", "VEI", "VEJ", "VEK", "VEL", "VEM", "VEN", "VEO", "VEP", "VEQ", "VER", "VES", "VET", "VEU", "VEV", "VEW", "VEX", "VEY", "VEZ", "VFP", "VKI", "VPB", "VMA", "VMB", "VMC", "VMD", "VME", "VMF", "VMG", "VMH", "VMI", "VMJ", "VMK", "VML", "VMM", "VMN", "VMO", "VMP", "VMQ", "VMR", "VMS", "VMT", "VMU", "VMV", "VMW", "VMX", "VMY", "VMZ", "VM0", "VM1", "VM2", "VM3", "VM4", "VM5", "VM6", "VM7", "VM8", "VM9", "VPB" does not trigger [Validation tests](https://github.com/iris-edu/StationXML-Validator/wiki/Validation-tests) that are subject to this restriction. * **[C2](https://github.com/iris-edu/StationXML-Validator/blob/master/Validator_TestSuite/Restrictions/P1_C2.xml)** : Channel:Type == "HEALTH", "FLAG", "MAINTENANCE" does not trigger [Validation tests](https://github.com/iris-edu/StationXML-Validator/wiki/Validation-tests) that are subject to this restriction. # Response -* **[R1](https://github.com/iris-edu/StationXML-Validator/blob/master/Validator_TestSuite/Restrictions/P1_R1.xml)** : Channels containing Response:InstrumentPolynomial at stage 0 do not trigger [Validation tests](https://github.com/iris-edu/StationXML-Validator/wiki/Validation-tests) that are subject to this restriction. +u* **[R1](https://github.com/iris-edu/StationXML-Validator/blob/master/Validator_TestSuite/Restrictions/P1_R1.xml)** : Channels containing Response:InstrumentPolynomial at stage 0 do not trigger [Validation tests](https://github.com/iris-edu/StationXML-Validator/wiki/Validation-tests) that are subject to this restriction. -[As of 2018-08-24] +[As of 04-2020] diff --git a/docs/tests.md b/docs/tests.md index 625c2c4..91329b5 100644 --- a/docs/tests.md +++ b/docs/tests.md @@ -1,7 +1,8 @@ -# Rule Set Updated 01/2020 +# Rule Set Updated 04/2020 + Enforces FDSN StationXML Schema Version 1.1 Compliance -Rules ID: Rule indexing that follows the StationXML hierarchical structure, organized by level +Rule ID: Rule indexing follows the StationXML hierarchical structure, organized by level * Level 100: Rules that apply to Network level * Level 200: Rules that apply to Station level * Level 300: Rules that apply to Channel level @@ -9,7 +10,7 @@ Rules ID: Rule indexing that follows the StationXML hierarchical structure, orga Type: Categories of validation rules * Error: IF Error==False then document is invalid -* Warning: IF Warning==TRUE then Return message and PASS else PASS +* Warning: IF Warning==False then Return message and PASS else PASS Restriction: Classes of StationXML that are not subject to specific validation rules * C1: State of Health Channel:Codes do not trigger rules containing C1 restrictions. Refer to the Restrictions page. @@ -28,8 +29,7 @@ DICTIONARY: External reference, such as the units name list [###] at end of rule descriptions denote rules that can concurrently trigger -Updated:02/03/2020 - +[Updated: 04-2020] | Rule ID | Rule Description |Type| Restrictions | Test Case Fail | Test Case Pass | |:----:|-------------|:--:|:---:|:---:|:--:| @@ -65,6 +65,8 @@ Updated:02/03/2020 |||||| | | **`Channel Time Errors`** |||| | 310 | Channel:startDate must be included and must occur before Channel:endDate if included.
Channel:startDate must be **INCLUDED AND** < Channel:endDate **IF INCLUDED**
|Error||[F1_310](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/F1_310.xml), [F2_310](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/F2_310.xml)|[PASS](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/Validator_Pass.xml)| +| 320 | If Channel:Code[2]==(H | L | M | N) THEN Channel:Azimuth and Channel:Dip must be included. |Error|| [F1_320](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/F1_320.xml)|[PASS](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/Validator_Pass.xml)| +| 321 |If Channel:Code[2] == (H | L | M | N) then Stage[1]:InputUnit must equal *m/s* AND Stage[Last]:OutputUnits must equal count*|WARNING|| [F1_321](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/F1_320.xml)|[PASS](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/Validator_Pass.xml)| |||||| | | **`Channel Orientation Errors`** |||| | 332 |If Channel:Code[LAST]==N then Channel:Azimuth must be assigned (>=355.0 or <=5.0) or (>=175.0 and <=185.0) and Channel:Dip must be assigned (>=-5 AND <=5.0). |Warning|[C1](https://github.com/iris-edu/StationXML-Validator/wiki/Restrictions#channel), [C2](https://github.com/iris-edu/StationXML-Validator/wiki/Restrictions#channel)|[F1_332](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/F1_332.xml)|[PASS](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/Validator_Pass.xml), [P1_332](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/P1_332.xml), [P2_332](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/P2_332.xml), [P3_332](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/P3_332.xml), [P4_332](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/P4_332.xml)| @@ -85,11 +87,13 @@ Updated:02/03/2020 | 412 | InstrumentSensitivity:Value must equal the product of all StageGain:Value if all StageGain:Frequency are equal to InstrumentSensitivity:Frequency [Normalization Frequency].
**IF** InstrumentSensitivity is **INCLUDED AND** InstrumentSensitivity:Frequency == Stage[1:LAST]:StageGain:Frequency **THEN** InstrumentSensitivity:Value == **PRODUCT**(Stage[1:LAST]:StageGain:Value)
|Error|[C1](https://github.com/iris-edu/StationXML-Validator/wiki/Restrictions#channel), [C2](https://github.com/iris-edu/StationXML-Validator/wiki/Restrictions#channel), [R1](https://github.com/iris-edu/StationXML-Validator/wiki/Restrictions#response)|[F1_412](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/F1_412.xml)|[PASS](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/Validator_Pass.xml), [P1_412](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/P1_412.xml), [P2_412](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/P2_412.xml)| | 413 | All Stages must include StageGain:Value assigned as a double > 0.0 and StageGain:Frequency assigned as a double.
Stage[1:N]:StageGain must be **INCLUDED AND** Stage[1:N]:StageGain:Value must be **ASSIGNED** a > 0.0 **AND** Stage[1:N]:StageGain:Frequency must be **ASSIGNED** a double
|Error|[C1](https://github.com/iris-edu/StationXML-Validator/wiki/Restrictions#channel), [C2](https://github.com/iris-edu/StationXML-Validator/wiki/Restrictions#channel), [R1](https://github.com/iris-edu/StationXML-Validator/wiki/Restrictions#response)|[F1_413](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/F1_413.xml)|[PASS](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/Validator_Pass.xml)| | 414 | If Stage[N]:PolesZeros contains Zero:Real==0 and Zero:Imaginary==0 then InstrumentSensitivity:Frequency cannot equal 0 and Stage[N]:StageGain:Frequency cannot equal 0.
**IF** Stage[N]:PolesZeros is **INCLUDED AND** Stage[N]:PolesZeros:Zero[N]:Real == 0 **AND** Stage[N]:PolesZeros:Zero[N]:Imaginary == 0 **THEN** InstrumentSensitivity:Frequency cannot != 0 **AND** Stage[N]:StageGain:Frequency != 0
|Error|[C1](https://github.com/iris-edu/StationXML-Validator/wiki/Restrictions#channel), [C2](https://github.com/iris-edu/StationXML-Validator/wiki/Restrictions#channel), [R1](https://github.com/iris-edu/StationXML-Validator/wiki/Restrictions#response)|[F1_414](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/F1_414.xml), [F2_414](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/F2_414.xml), [F3_414](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/F3_414.xml)|[PASS](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/Validator_Pass.xml), [P1_414](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/P1_414.xml)| -| 415 | If 1 or more Polynomial stages are included then the Response must also include an overall InstrumentPolynomial.
**IF** Stage[N]:Polynomial is **INCLUDED THEN** InstrumentPolynomial must be **INCLUDED AND** InstrumentSensitivity must be **NOT INCLUDED**
|Error|[C1](https://github.com/iris-edu/StationXML-Validator/wiki/Restrictions#channel), [C2](https://github.com/iris-edu/StationXML-Validator/wiki/Restrictions#channel)|[F1_415](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/F1_415.xml)|[PASS](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/Validator_Pass.xml), [P1_415](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/P1_415.xml), [P2_415](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/Response_400/P2_415.xml)| -| 416 | Response must include InstrumentSensitivity if no Polynomial stages are included.
**IF** Stage[N]:Polynomial is **NOT INCLUDED THEN** InstrumentSensitivity must be **INCLUDED**
|Error|[C1](https://github.com/iris-edu/StationXML-Validator/wiki/Restrictions#channel), [C2](https://github.com/iris-edu/StationXML-Validator/wiki/Restrictions#channel)|| +| 415 | If 1 or more Polynomial stages are included then the Response must also include an InstrumentPolynomial.
**IF** Stage[N]:Polynomial is **INCLUDED THEN** InstrumentPolynomial must be **INCLUDED AND** InstrumentSensitivity must be **NOT INCLUDED**
|Error|[C1](https://github.com/iris-edu/StationXML-Validator/wiki/Restrictions#channel), [C2](https://github.com/iris-edu/StationXML-Validator/wiki/Restrictions#channel)|[F1_415](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/F1_415.xml)|[PASS](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/Validator_Pass.xml), [P1_415](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/P1_415.xml), [P2_415](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/Response_400/P2_415.xml)| +| 416 | Response must include InstrumentSensitivity if no Polynomial stages are included.
**IF** Stage[N]:Polynomial is **NOT INCLUDED THEN** InstrumentSensitivity must be **INCLUDED**
|Error|[C1](https://github.com/iris-edu/StationXML-Validator/wiki/Restrictions#channel), [C2](https://github.com/iris-edu/StationXML-Validator/wiki/Restrictions#channel)|[F1_416](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/F1_416.xml)|[PASS](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/Validator_Pass.xml)| +| 417 | If Stage[N]:PolesZeros contains Zeros and Poles then Zero:Number and Pole:Number must start at 0 and be sequential.|Error|[C1](https://github.com/iris-edu/StationXML-Validator/wiki/Restrictions#channel), [C2](https://github.com/iris-edu/StationXML-Validator/wiki/Restrictions#channel)|[F1_417](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/F1_417.xml)|[PASS](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/Validator_Pass.xml)| ||||||| | | **`Response Decimation Errors`** |||| | 420 | A Response must contain at least one instance of Response:Stage:Decimation.
**IF** Response is **INCLUDED THEN** Response:Stage:Decimation must be **INCLUDED**
|Warning|[C1](https://github.com/iris-edu/StationXML-Validator/wiki/Restrictions#channel), [C2](https://github.com/iris-edu/StationXML-Validator/wiki/Restrictions#channel), [R1](https://github.com/iris-edu/StationXML-Validator/wiki/Restrictions#response)|[F1_420](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/F1_420.xml)|[PASS](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/Validator_Pass.xml)| | 421 | Stage[LAST]:Decimation:InputSampleRate divided by Stage[LAST]:Decimation:Factor must equal Channel:SampleRate.
**IF** Stage[LAST]:Decimation:InputSampleRate/Stage[LAST]:Decimation:Factor != Channel:SampleRate **THEN FAIL**
|Error|[C1](https://github.com/iris-edu/StationXML-Validator/wiki/Restrictions#channel), [C2](https://github.com/iris-edu/StationXML-Validator/wiki/Restrictions#channel), [R1](https://github.com/iris-edu/StationXML-Validator/wiki/Restrictions#response)|[F1_421](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/F1_421.xml)|[PASS](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/Validator_Pass.xml)| | 422 | Stage[N]:Decimation:InputSampleRate must equal the previously assigned Stage[M]:Decimation:InputSampleRate divided by Stage[M]:Decimation:Factor.
**IF** Stage[N]:Decimation:InputSampleRate != Stage[M]:Decimation:InputSampleRate/Stage[M]:Decimation:Factor **WHERE** M < N **THEN FAIL**
|Error|[C1](https://github.com/iris-edu/StationXML-Validator/wiki/Restrictions#channel), [C2](https://github.com/iris-edu/StationXML-Validator/wiki/Restrictions#channel), [R1](https://github.com/iris-edu/StationXML-Validator/wiki/Restrictions#response)|[F1_422](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/F1_422.xml)|[PASS](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/Validator_Pass.xml)| +| 423 | If Decimation and StageGain are included in Stage[N] then PolesZeros or Coefficients or ResponseList or FIR must also be included in Stage[N].
**IF** Stage[N]:Decimation and Stage[N]:StageGain are **INCLUDED THEN** Stage[N]:PolesZeros or Stage[N]:Coefficients or Stage[N]:ResponseList or Stage[N]:FIR must also be **INCLUDED**.
|Error|[C1](https://github.com/iris-edu/StationXML-Validator/wiki/Restrictions#channel), [C2](https://github.com/iris-edu/StationXML-Validator/wiki/Restrictions#channel), [R1](https://github.com/iris-edu/StationXML-Validator/wiki/Restrictions#response)|[F1_423](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/F1_423.xml)|[PASS](https://github.com/iris-edu/StationXML-Validator/blob/master/src/test/resources/Validator_Pass.xml)| |||||| diff --git a/docs/units.md b/docs/units.md index 903991c..8bd134e 100644 --- a/docs/units.md +++ b/docs/units.md @@ -45,6 +45,7 @@ Below are the common unit names checked by the IRIS validator. The values are b "watt", "W", "milliwatt", "mW", "V/m", "W/m**2", + "hit/(cm**2*hour)", "gap", "reboot", "byte","bit", diff --git a/src/main/java/edu/iris/dmc/Application.java b/src/main/java/edu/iris/dmc/Application.java index a2d8e93..197928c 100644 --- a/src/main/java/edu/iris/dmc/Application.java +++ b/src/main/java/edu/iris/dmc/Application.java @@ -394,7 +394,6 @@ public static void printUnits() { public static void help() throws IOException { String version = "Version " + getVersion(); - System.out.println(getVersion()); version = center(version, 62, " "); System.out.println("==============================================================="); diff --git a/src/main/java/edu/iris/dmc/station/RuleEngineRegistry.java b/src/main/java/edu/iris/dmc/station/RuleEngineRegistry.java index 4bc490d..daed2f3 100644 --- a/src/main/java/edu/iris/dmc/station/RuleEngineRegistry.java +++ b/src/main/java/edu/iris/dmc/station/RuleEngineRegistry.java @@ -166,12 +166,12 @@ private void defaultChannelRules(Set set) { } if (!set.contains(320)) { add(320, new AzimuthDipCondition(true, - "IF Channel:Code[2]==(H | L | M | N) THEN Channel:Azimuth and Channel:Dip must be included."), + "If Channel:Code[2]==(H | L | M | N) THEN Channel:Azimuth and Channel:Dip must be included."), Channel.class); } if (!set.contains(321)) { add(321, new InstrumentCodeUnitsCondition(true, - " IF Channel:Code[2] == (H | L | M | N) then Stage[1]:InputUnit must equal *m/s* AND Stage[Last]:OutputUnits must equal count*"), + "If Channel:Code[2] == (H | L | M | N) then Stage[1]:InputUnit must equal *m/s* AND Stage[Last]:OutputUnits must equal count*"), Channel.class); } if (!set.contains(332)) { @@ -285,7 +285,7 @@ private void defaultResponseRules(Set s) { } if (!s.contains(423)) { add(423, new DecimationStageGainCondition(true, - "Stage[N]:Decimation:InputSampleRate must equal the previously assigned Stage[M]:Decimation:InputSampleRate divided by Stage[M]:Decimation:Factor.", + "If Stage[N]:Decimation and Stage[N]:StageGain are included then Stage[N]:PolesZeros or Stage[N]:Coefficients or Stage[N]:ResponseList or Stage[N]:FIR must also be included.", restrictions), Response.class); } diff --git a/src/main/java/edu/iris/dmc/station/restrictions/ChannelCodeRestriction.java b/src/main/java/edu/iris/dmc/station/restrictions/ChannelCodeRestriction.java index fc71c16..6667dda 100644 --- a/src/main/java/edu/iris/dmc/station/restrictions/ChannelCodeRestriction.java +++ b/src/main/java/edu/iris/dmc/station/restrictions/ChannelCodeRestriction.java @@ -11,7 +11,7 @@ public class ChannelCodeRestriction implements Restriction { private String[] codes = new String[] { "ACE", "ATC", "BDO", "EX1", "EX2", "EX3", "EX4", "EX5", "EX6", "EX7", "EX8", "EX9", "GAN", "GEL", "GLA", "GLO", "GNS", "GPL", "GPS", "GST", "LCA", "LCB", "LCC", "LCD", "LCE", "LCF", "LCG", "LCH", "LCI", "LCJ", "LCK", "LCL", "LCM", "LCN", "LCO", "LCP", "LCQ", "LCR", "LCS", "LCT", "LCU", - "LCV", "LCW", "LCX", "LCY", "LCZ", "LDE", "LDN", "LDZ", "LDO", "LEE", "LED", "LEO", "LEP", "LII", "LKI", + "LCV", "LCW", "LCX", "LCY", "LCZ", "LDE", "LDN", "LDZ", "LEE", "LED", "LEO", "LEP", "LII", "LKI", "LOG", "LPL", "OAC", "OCF", "QBD", "QBP", "QDG", "QDL", "QDR", "QEF", "QG1", "QGD", "QID", "QLD", "QPD", "QRD", "QRT", "QTP", "QTH", "QTP", "QWD", "SBT", "SCA", "SCB", "SCC", "SCD", "SCE", "SCF", "SCG", "SCH", "SCI", "SCJ", "SCK", "SCL", "SCM", "SCN", "SCO", "SCP", "SCQ", "SCR", "SCS", "SCT", "SCU", "SCV", "SCW",