Difference between revisions of "Geopsy: Waveform Command Line"
Line 29: | Line 29: | ||
geopsy -waveform setheader.qs input_file.txt | geopsy -waveform setheader.qs input_file.txt | ||
− | "setheader.qs' might contain these commands for a text file with three components to set sampling frequency to 100 Hz (see [[Geopsy: Waveform Scripting Language]] for details): | + | "setheader.qs' might contain these commands for a text file with three components to set sampling frequency to 100 Hz (see [[Geopsy: Waveform Scripting Language|waveform scripting language]] for details): |
setHeader(0, "DeltaT", 0, 0.01); | setHeader(0, "DeltaT", 0, 0.01); |
Revision as of 12:30, 8 March 2010
All the scripts that can be executed in waveform console can be also processed through the command line interface.
geopsy -waveform scriptfile.qs input_file.mseed
For instance, this command does the following tasks:
- Import file "input_file.mseed"
- Execute all actions listed in "scriptfile.qs"
To save the results, the script must end with an 'export command:
[...] // Some processings come here exportFile("output_file.sac", "SAC");
Input and output formats for signal files are of course any of the supported file formats for input and output.
geopsy -export-formats geopsy -import-formats
These two commands list the supported file formats on input and output.
"scriptfile.qs" can contain any series of command specified in waveform scripting language.
Setting header information of ascii files
Ascii files does not refer to a particular format. It describes the encoding of each character, other option can be: ASCII, UNICODE, UTF8, UTF16,... Hence, text files might have arbitrary format. This is particularly true for organizing header information where absolutely no standard exists. For the signal samples this is less the case. They are usually organized in various columns or in several bunch of data separated by special characters (see supported file formats for details.
The annoying thing with this kind of file is that you cannot automatically convert or process them in a script. This can be solved by using a script for setting the basic header information upon loading the files.
geopsy -waveform setheader.qs input_file.txt
"setheader.qs' might contain these commands for a text file with three components to set sampling frequency to 100 Hz (see waveform scripting language for details):
setHeader(0, "DeltaT", 0, 0.01); setHeader(1, "DeltaT", 0, 0.01); setHeader(2, "DeltaT", 0, 0.01); exportFile("output_file.sac", "SAC");
$ geopsy tmp/text_file -waveform setheader.qs -----INFO----- Loading ASCII Columns---- The ASCII format without header imply that you fill in the correct information yourself in a table. Choose menu "view/new table" and change the DeltaT (inverse of the sampling frequency) to allow correct plotting in a graphic tmp/text_file File tmp/output.mseed already exists, saving to /home/mwathele/tmp/output.mseed
Once converted to miniseed, the sampling frequency is properly set and the files can be handled in a much easier way. A better script should adapt itself to the number of input signals:
n=signalCount(); for(i=0;i<n;i++) { setHeader(i, "DeltaT", 0, 0.01); } exportFile("output_file.sac", "SAC");