Convert CSV to Mseed Utility Program. Works on any size of the CSV file and interpolate the data for the sampling rate of 50Hz.
Utpal Kumar, 2021/04
conda create -n rfidgetenvconda activate rfidgetenvconda install -c conda-forge obspy pandas
python -m venv venvsource venv/bin/activatepip install obspy pandas
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 INPUTinput CSV file to convert to mseed, e.g. network_station_data.csv-stn STATION, --station STATIONstation name, e.g. XYZ-net NETWORK, --network NETWORKnetwork name, e.g. TW-sr SAMPLE_RATE, --sample_rate SAMPLE_RATEsampling 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 datacsv file format: 'Datetime', 'X', 'Y', 'Z' (2021-04-17 00:00:00.005829,0.00824,-0.01095,1.00362)
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.mseedFinished writing file TW-RCEC7B-BNY.mseedFinished writing file TW-RCEC7B-BNZ.mseed... with sampling rate: 50 Hz
