8000 Spectrum App · s-schneider/frospy Wiki · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Spectrum App

lisanne-jagt edited this page Nov 1, 2021 · 11 revisions

Spectrum App

Spectrum is an example tool that uses frospy's core classes to plot normal mode frequency spectra.

Run

To use the app in a python script use the following lines:

>>> from frospy.spectrum.app import spectrum
>>> data = 'PATH-TO-DATA-FILE'
>>> syn = 'PATH-TO-SYNTHETICS-FILE'
>>> spectrum(data, syn)

To run spectrum from the command line enter the following line, while in the folder of the repo

(nmpy) $ ipython run_spectrum.py

Which asks for the data file location, enter the test data file which is provided.

Enter:
data file location ('PATH/FILE.ahx')
 -->  /Users/simon/dev/frospy/frospy/data/test/test.ahx
Reading files ...
	 No synthetic files loaded
	 No cmt file loaded
	 No segment file read.


---------------------------
Input start time in hours  > 5
Input end time in hours    > 30
Input start frequency in mHz > 1
Input end frequency in mHz   > 1.2
Current station: TAM VHT

Giving you this output pick

Command Description
bts Back to the start
d Delete current station
fsep Alter the amount of shown modes
fsep frequency resolution of mode-lines in plot
fw re-enter the frequency window
goto Jump to Station/Channel by index
help display this window
list or l list all stations and indices
list all or la list all station with meta informaton
load segments or ls Load and plot segment file
mfac Multiplication factor for synthetics
modes Display Mode-frequencies
next, nsp go to next station
p all Pick freq-windows, set for all stations
p Pick freq-windows for segment-file
print fpeaks write max freqs to file
print segments write segments to file ($IDdat)
print station Print all stations to 'stationdat'
printw all write curr win for all stations to file
printw write curr win for curr station to file
psp go to previous station
qcycle sets tw and fw for a given mode
quit exit spectrum
reset Reload original files
save Save current stream
set segments or ss Set loaded segments as picks
search search for station attribut
taper set shape of taper window in time-domain
taper test testing all available taper shapes
tw re-enter the time-window
tw test testing different timewindows around qcycle
unload segments Unload segment file, remove plotted lines

For most of the commands keyword-arguments (kwargs) are allowed

Commands and kwargs

After a command is entered, some additional information or keywords may be needed as a keyword argument (kwarg). E.g. after entering modes, the name of the modes is asked:
Example 1

Waiting for user input (type help for all commands)
 -->  modes
Showing modes? (all / none / names (separated by space), e.g. 0S15) -->  0s15

The additional keyword can be added after the command as well, separated by -, having the same outcome as Example 1:
Example 2

Waiting for user input (type help for all commands)
 -->  modes - 0s15

The same goes for tw, fw etc.

Picking Frequency Windows

To pick a frequency window for a segment file enter:

Waiting for user input (type help for all commands)
-->  p

A window will pop up, in which you can pick 2 frequencies by clicking on the data. If you already now your frequencies you can enter

Waiting for user input (type help for all commands)
-->  p - f1 f2

The same goes for pa, which sets/calculates the frequency picks, timewindow and weighting for all stations, and pf, which does it only for the following stations.

Timewindow and tapershape test

  • To test a range of timewindows you may enter tw test, which will ask for a mode to calculate the qcycle 'qT' of that it. 2 new plot windows pop up with timewindows in a range of [1, qT/2] to [1, 3/2*qT] for data and synthetics.

  • To test a range of taper shapes you may enter taper test, calculating the spectrum in the current time- and frequency-window for the following functions (more documentation here):

    • hanning - window
    • hamming - window
    • blackman - window
    • kaiser - window
    • bartlett - window

sourcecode

Clone this wiki locally
0