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

Acceptable SampleRate value for pre-digital channels #144

Closed
jcrummey opened this issue Dec 9, 2021 · 10 comments
Closed

Acceptable SampleRate value for pre-digital channels #144

jcrummey opened this issue Dec 9, 2021 · 10 comments

Comments

@jcrummey
Copy link

jcrummey commented Dec 9, 2021

Rule 305 prohibits the value of 0 for Channel:SampleRate or leaving the element blank. There is a need to represent channels that were not ever digitized. Using a value of 0 for Channel:SampleRate seems to be the best option because it implies there is no sample rate. Leaving the Channel:SampleRate element blank is not ideal because it is difficult to determine if the value was left blank on purpose or was unintentionally omitted.

Unless there is another alternative proposed for characterizing data without a sample rate; Rule 305 should be changed so that 0 is a passing value for Channel:SampleRate.

@jcrummey jcrummey changed the title Acceptable sample rate value for pre-digital channels Acceptable SampleRate value for pre-digital channels Dec 9, 2021
@crotwell
Copy link
Contributor

crotwell commented Dec 9, 2021

+1

Zero sample rate makes sense for old pure analog channels, where preserving some response information is useful. A response might be m/s -> V -> m displacement of pen on paper for example. Also some SOH channels like LOG might not have a meaningful sample rate.

A future revision of stationxml might incorporate a element to indicate no sample rate, but for now zero seems the best choice.

But I would still have an error if sample rate is zero but the channels's response has atod and/or digitial stages. If the response says there is a non-zero sample rate, the channel sample rate shouldn't be zero.

@metempleton
Copy link
Collaborator

metempleton commented Dec 9, 2021 via email

@crotwell
Copy link
Contributor

crotwell commented Dec 9, 2021

@metempleton just to clarify, there are at least 2 sample rates, directly in Channel, and then in Stage -> Decimation as input and output sample rates. I understand a LOG channel would not have a Response, so no Decimation in a Stage, but what about the Channel -> SampleRate? Are you saying that element should not be present for SOH channels? Or should it be there but have value zero?

I assume lots of old SEED based metadata will have zero in the Channel SampleRate as there was no way to leave it out, but what should the preferred way be for new metadata, zero or not there?

I think rule 305 should probably be modified from:

If Channel:SampleRate equals 0 or is not included then Response must not be included.

to something like:

If Channel:SampleRate equals 0 or is not included then Response must not include digital stages, such as Decimation, FIR, or where output units of last stage is count.

@timronan
Copy link
Collaborator

@jcrummey can you please provide an example channel and response?

@jcrummey
Copy link
Author

I couldn't upload a xml file as an attachment, so I inserted it as code. This is a simple example of a station with only one non-digital channel and a single stage. Many of our non-digital channels will include a pre-amp (VCO) stage as well.

<?xml version="1.0" encoding="UTF-8"?>
<FDSNStationXML xmlns="http://www.fdsn.org/xml/station/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaVersion="1.1" xsi:schemaLocation="http://www.fdsn.org/xml/station/1 http://www.fdsn.org/xml/station/fdsn-station-1.1.xsd">
  <Source>ANSS Station Information System</Source>
  <Sender>ANSS Station Information System</Sender>
  <Created>2021-12-08T18:22:32.486165+00:00</Created>
  <Network code="NC" startDate="1967-01-01T00:00:00+00:00">
    <Description>USGS Northern California Regional Network</Description>
    <TotalNumberStations>977</TotalNumberStations>
    <SelectedNumberStations>1</SelectedNumberStations>
    <Station code="SEG" startDate="1973-06-16T00:00:00+00:00" endDate="1973-07-13T23:59:00+00:00">
      <Latitude>34.1325</Latitude>
      <Longitude>-119.147163</Longitude>
      <Elevation>3.0</Elevation>
      <Site>
        <Name>Egg Ranch</Name>
        <Country>USA</Country>
      </Site>
      <Operator>
        <Agency>NCSN</Agency>
      </Operator>
      <CreationDate>1973-06-16T00:00:00+00:00</CreationDate>
      <TotalNumberChannels>1</TotalNumberChannels>
      <SelectedNumberChannels>1</SelectedNumberChannels>
      <Channel code="EHZ" startDate="1973-06-16T00:00:00+00:00" endDate="1973-07-13T23:59:00+00:00" locationCode="">
        <Comment subject="Edit configuration (channel epoch)">
          <Value>Sample rate changed. Old value: , new value: 0.</Value>
          <BeginEffectiveTime>1973-06-16T00:00:00+00:00</BeginEffectiveTime>
          <EndEffectiveTime>1973-07-13T23:59:00+00:00</EndEffectiveTime>
          <Author>
            <Name>SIS Field Action</Name>
          </Author>
        </Comment>
        <Latitude>34.1325</Latitude>
        <Longitude>-119.147163</Longitude>
        <Elevation>3.0</Elevation>
        <Depth>0.0</Depth>
        <Azimuth>0.0</Azimuth>
        <Dip>-90.0</Dip>
        <SampleRate>0.0</SampleRate>
        <Sensor>
          <Type>SERCEL</Type>
          <Description>Velocity Sensor</Description>
          <Manufacturer>SERCEL</Manufacturer>
          <Model>L-4C VERTICAL</Model>
          <SerialNumber>L4C_SEG</SerialNumber>
          <CalibrationDate>1973-06-16T00:00:00+00:00</CalibrationDate>
        </Sensor>
        <Response>
          <InstrumentSensitivity>
            <Value>100.0</Value>
            <Frequency>1.0</Frequency>
            <InputUnits>
              <Name>m/s</Name>
              <Description>Velocity in meters per second</Description>
            </InputUnits>
            <OutputUnits>
              <Name>counts</Name>
              <Description>Digital Count in Digital counts</Description>
            </OutputUnits>
          </InstrumentSensitivity>
          <Stage number="1">
            <PolesZeros name="L4_DEFAULT_DERIVED">
              <Description>CISN</Description>
              <InputUnits>
                <Name>m/s</Name>
                <Description>Velocity in meters per second</Description>
              </InputUnits>
              <OutputUnits>
                <Name>V</Name>
                <Description>Voltage in Volts</Description>
              </OutputUnits>
              <PzTransferFunctionType>LAPLACE (RADIANS/SECOND)</PzTransferFunctionType>
              <NormalizationFactor>1.599984006407977</NormalizationFactor>
              <NormalizationFrequency>1.0</NormalizationFrequency>
              <Zero number="0">
                <Real>0.0</Real>
                <Imaginary>0.0</Imaginary>
              </Zero>
              <Zero number="1">
                <Real>0.0</Real>
                <Imaginary>0.0</Imaginary>
              </Zero>
              <Pole number="0">
                <Real>-5.026498</Real>
                <Imaginary>3.76987349</Imaginary>
              </Pole>
              <Pole number="1">
                <Real>-5.026498</Real>
                <Imaginary>-3.76987349</Imaginary>
              </Pole>
            </PolesZeros>
            <StageGain>
              <Value>100.0</Value>
              <Frequency>10.0</Frequency>
            </StageGain>
          </Stage>
        </Response>
      </Channel>
    </Station>
  </Network>
</FDSNStationXML>

@crotwell
Copy link
Contributor

Maybe not directly related to the issue, but this xml shows the output of stage 1 to be V, but the InstrumentSensitivity OutputUnits are counts. Since there is only one stage and no AtoD, it is probably better if the output units in the sensitivity are also V.

@jcrummey
Copy link
Author

I agree, the OutputUnits under InstrumentSensitivity should be V (volts) in this case. Thank you for pointing out that error.

This XML file was one generated to migrate from our old metadata system to SIS. We have not yet worked out all the bugs in this process.

@timronan
Copy link
Collaborator

What about changing the rule to a warning rather than an error for cases were sample rate=0? This is the least invasive fix, and can be implemented the quickest. It doesn't seems like there will a ton of these metadata for analog instruments so it may not be worth making a specific rule for this case.

@jcrummey
Copy link
Author

Changing the rule to a warning makes sense to me.

@timronan
Copy link
Collaborator

@jcrummey stationxml-validator 1.7.2 has been released and addresses this issue by turning rule 305 from an error into a warning. The stationxml-loader has also been updated to include this changed rule. Please close this issue after you verify the update.

https://github.com/iris-edu/stationxml-validator/releases/tag/stationxml-validator-1.7.2

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

4 participants