https://github.com/earthinversion/csv2mseed_utility
Convert CSV to Mseed Utility Program. Works on any size of the CSV file and interpolate the data for the sampling rate of 50Hz.
https://github.com/earthinversion/csv2mseed_utility
csv mseed plot
Last synced: 3 months ago
JSON representation
Convert CSV to Mseed Utility Program. Works on any size of the CSV file and interpolate the data for the sampling rate of 50Hz.
- Host: GitHub
- URL: https://github.com/earthinversion/csv2mseed_utility
- Owner: earthinversion
- License: bsd-2-clause
- Created: 2021-04-26T13:16:47.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-19T03:44:07.000Z (almost 5 years ago)
- Last Synced: 2025-01-18T15:57:18.460Z (about 1 year ago)
- Topics: csv, mseed, plot
- Language: Python
- Homepage:
- Size: 1.45 MB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Python utility program to write mseed file from csv
Utpal Kumar, 2021/04
## Installation
### Using Anaconda/Miniconda
```
conda create -n rfidgetenv
conda activate rfidgetenv
conda install -c conda-forge obspy pandas
```
### Using venv
```
python -m venv venv
source venv/bin/activate
pip install obspy pandas
```
## Usage
type `python csv2mseed.py -h`
```
usage: csv2mseed.py [-h] -inp INPUT [-stn STATION] [-net NETWORK] [-sr SAMPLE_RATE] [-gal GAL] [-p] [-dm]
Python utility program to write mseed file from csv based on Pandas, Numpy and Obspy (by Utpal Kumar, IESAS, 2021/04)
optional arguments:
-h, --help show this help message and exit
-inp INPUT, --input INPUT
input CSV file to convert to mseed, e.g. network_station_data.csv
-stn STATION, --station STATION
station name, e.g. XYZ
-net NETWORK, --network NETWORK
network name, e.g. TW
-sr SAMPLE_RATE, --sample_rate SAMPLE_RATE
sampling rate as integer
-gal GAL, --gal GAL 1 for Gal and 0 for g
-p, --plot_data plot the output mseed data
-dm, --demean remove mean from the data
csv file format: 'Datetime', 'X', 'Y', 'Z' (2021-04-17 00:00:00.005829,0.00824,-0.01095,1.00362)
```
- Convert to mseed, remove mean and plot
```bash
python csv2mseed.py -inp "RCEC7B/phidgetData_0009.csv" -p -dm -stn RCEC7B
```
```
Reading file /mnt/d/csv2mseed_utility/RCEC7B/phidgetData_0009.csv in chunks...
Finished writing file TW-RCEC7B-BNX.mseed
Finished writing file TW-RCEC7B-BNY.mseed
Finished writing file TW-RCEC7B-BNZ.mseed... with sampling rate: 50 Hz
```
