Loading and exporting multiple files

This forum is dedicated to discuss all problems and suggestions related to the use of geopsy database and its plugins (array processing, H/V,...).
Bill M.
Posts: 2
Joined: Mon Oct 01, 2012 4:12 pm

Loading and exporting multiple files

Postby Bill M. » Tue Oct 02, 2012 4:15 pm

I am in the process of importing and exporting (.dat files from Geode software into ascii format) of which I have approximately 500 files. I was hoping to use the Directory Monitoring function to possibly load, but I am unsuccessful so far, even trying to load small batches of 3 files. Was this an intent of Directory Monitoring (mass importing of files)? If not, is there a script that anyone is aware of where I can use Geopsy to convert many files to ascii format? Thank you!

admin
Site Admin
Posts: 417
Joined: Mon Aug 13, 2007 11:48 am
Location: ISTerre
Contact:

Re: Loading and exporting multiple files

Postby admin » Wed Oct 10, 2012 6:14 pm

Directory monitoring is designed to be used for instance with geode software in automatic saving mode. Geode (seismic controller? I cannot remember the exact name of the application) writes a new file after each trigger pulse. Geopsy checks every xx seconds (parameter) for new files in the directory where seismic controller writes its own files. They are opened inside geopsy automatically, ready for processing inside. Interesting for instance with MASW you can run directly on the field.

To convert numerous files geopsy has a command line interface. You can run it from a terminal like this:

Code: Select all

geopsy your_input_file.dat -export your_export_file.sac

".sac" extension is recognized as SAC format for export. Geopsy exits right after conversion. To convert into a simple text file:

Code: Select all

geopsy your_input_file.dat -export your_export_file.txt -export-format Ascii

I'm not quite sure that .txt is an official extension for column-text files. So better to specify it explicitly.

To convert several files, you have to write a bash script like this one:

Code: Select all

#!/bin/bash

for IN_FILE in $(ls your_input_directory); do
  geopsy $IN_FILE -export your_export_directory/$(basename $IN_FILE) -export-format Ascii
done

Bill M.
Posts: 2
Joined: Mon Oct 01, 2012 4:12 pm

Re: Loading and exporting multiple files

Postby Bill M. » Thu Dec 06, 2012 6:42 pm

Thank you!


Return to “Geopsy usage”

Who is online

Users browsing this forum: No registered users and 1 guest