Skip to main content

A tool to manage and roll embargo statuses for EIDA StationXML files.

Project description

EIDA Embargo Roller

Description

This program processes a stationXML file in input and updates channels epochs to reflect the embargo start date specified.

Processing Logic:

  1. If the channel epoch ends before the embargo: No changes are made.
  2. If the channel epoch ends after the embargo:
    • If the epoch starts before the embargo and the restriction policy is closed, the epoch is split at the embargo date:
      1. The restriction policy before the embargo is forced to open.
      2. The restriction policy after the embargo remains closed.
  3. After processing, the program merges channels that are contiguous in time and have the same content.

Usage

You can run eida_embargo_roller in two ways:

  1. Using uv (Recommended)
  2. Directly via Python

Installation

Option 1: Using uv (Recommended)

Install and run using uvx

uvx eida_embargo_roller [-i] [-e YYYY-MM-DD] station.xml

Or install from the repository:

#Clone the repository
git clone https://github.com/your-repo/embargo-roller.git
cd embargo-roller

# Sync dependencies
uv sync 

# Run the script
uv run eida_embargo_roller -e YYYY-MM-DD station.xml

If uv is not already installed, you can add it by following this guide.

Rust and Cargo Requirement

Certain dependencies (e.g., pendulum) require Rust and Cargo to build. If you encounter errors such as maturin failing due to missing Cargo, install Rust and Cargo by following the official Rust installation guide.

Option 2: Using pip

1. Install the package via pip:

python -m pip install --user eida_embargo_roller

2. Run the script:

eida_embargo_roller -e YYYY-MM-DD station.xml

Examples

This section provides examples of how to use eida_embargo_roller in different scenarios.


Writing a New XML File

To write a new XML file with an embargo date:

uvx eida_embargo_roller Z3.A190A.xml -e 2023-01-01 > result.xml

or without uv:

eida_embargo_roller Z3.A190A.xml -e 2023-01-01 > result.xml

Modifying an Existing XML File (In-Place)

To transform the file in place:

uvx eida_embargo_roller -e 2023-01-01 -i Z3.A190A.xml

or without uv:

eida_embargo_roller -e 2023-01-01 -i Z3.A190A.xml

Tests and Debugging

Running Tests

To run the entire test suite using pytest, execute:

uv run pytest

PyPI package

The EIDA Embargo Roller is also available as a PyPI package: https://pypi.org/project/eida-embargo-roller/

Updating SeisComP configuration

Embargo roller works with FDSN XML only, not with inventoryXML used by SeisComP. Following steps describe the procedure for updating config:

  1. Convert to stationXML:
   fdsnxml2inv --to-staxml inventory.xml > FDSNstation.xml
  1. Update embargo period:
   uv run eida_embargo_roller -e 2022-12-31 FDSNstation.xml > FDSNstation-embargoFree.xml
  1. Replace restrictedStatus “partial” by “open” in FDSNstation-embargoFree.xml (Seiscomp does not recognize “partial” status):
   sed -e 's/"partial"/"open"/'
  1. Convert FDSNstation-embargoFree.xml to invXML:
   fdsnxml2inv FDSNstation-embargoFree.xml > inventory-embargoFree.xml
  1. Update SEISCOMP:
   scinv sync [--test]
   seiscomp update-config
   seiscomp restart
  1. Test query for open data: https://EIDA-node/fdsnws/dataselect/1/query?start=2022-12-22T00:00:00&end=2022-12-22T00:10:00&net=XX&sta=YYY&cha=*Z

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eida_embargo_roller-1.0.6.tar.gz (23.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eida_embargo_roller-1.0.6-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

Details for the file eida_embargo_roller-1.0.6.tar.gz.

File metadata

  • Download URL: eida_embargo_roller-1.0.6.tar.gz
  • Upload date:
  • Size: 23.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for eida_embargo_roller-1.0.6.tar.gz
Algorithm Hash digest
SHA256 90120457dc65c27e3fed49229613eda98535f525e3d9fb25ffb9d9ac125b94b0
MD5 3b2416e7bab6f5a2ea31e2cdbc2e358b
BLAKE2b-256 f6e71b1ab2ea5267b9313bfa010cfb02e69a3a799036d37da369a2dd3853bb8f

See more details on using hashes here.

Provenance

The following attestation bundles were made for eida_embargo_roller-1.0.6.tar.gz:

Publisher: publish.yml on EIDA/embargo-roller

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file eida_embargo_roller-1.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for eida_embargo_roller-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 cfecd15a9f30ded806dfbd6f4ada494d2c17d0c09e178d9e5db91c46b379a51c
MD5 1ec3ede0c3ae77e3d084c439ac30c36c
BLAKE2b-256 5a6754b8207d1c55ea64df824ba016191d7552a5c764a2ca3b2089a2a837001d

See more details on using hashes here.

Provenance

The following attestation bundles were made for eida_embargo_roller-1.0.6-py3-none-any.whl:

Publisher: publish.yml on EIDA/embargo-roller

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page