Data Processing: Raspberry Shake 3D - RJbalikian/SPRIT-HVSR GitHub Wiki
The basic summary for processing data from a Raspberry Shake 3D instrument is outlined below:
- Copy/Export data archive from Raspberry Shake to your PC. A few options for doing this include
- Copy using FileZilla
- Copy using command-line tools
- Copy data acquired using the SpRIT-adjacent HVSR Script
- Process the data using SpRIT. This can be done in multiple ways, including:
- Process data acquired using the SpRIT-adjacent HVSR Script
- Process data from a directory with the three files for the channel-day
- Process data directly from a copy of the on-board, BUD-formatted archive.
Several options for downloading data from your Raspberry Shake are included in the Raspberry Shake Manual. Some of these methods are highlighed here as well.
FileZilla is an open source software that supports FTP, FTPS and SFTP protocols for transferring files between computers. You can download FileZilla here
After downloading/installing FileZilla, make sure you are connected to your Raspberry Shake (either directly via an ethernet cable or by connecting to the same network). Then, enter the following along the top bar:
- Host: rs.local
- Username: myshake
- Password:
- Port: 22
Then click the "Quickconnect" button.
On the left-side panels, you will see the directory tree and files for your local system. In the right panels, you will see the directory tree and files for the Raspberry Shake. Your data is located at the following filepath on the shake:
/opt/data/archive/{YEAR}/AM/{STATION}/EH?.D/"
NOTE: {YEAR}, {STATION}, and EH? will be replaced with their respective values (there are three channel directories: EHZ.D, EHE.D, EHN.D
In order to get into the "/opt" folder (and the other root-level folders), you may need to double click on the top-most folder with a question-mark symbol (?) on it.
Click the folder from which you wish to copy files/folders to open it in the bottom-right panel. Also select the local PC folder to which you wish to copy the files on the left panel. Drag the files from the bottom-right panel and drop them in the bottom-left panel to copy the files from the Raspberry Shake to your PC.
Open PowerShell (on Windows) or the terminal (Linux). Enter the following command:
scp -r "[email protected]:/opt/data/archive/<YEAR>/AM/<STATION>" "/path/to/directory/on/your/PC/"
NOTE: Replace and with the year the data was acquired and the name of the station. Also replace "/path/to/directory/on/your/PC/" with the filepath of the directory to which you would like to copy files on your PC.
After you run this command you will be asked to enter the password for your shake.
The -r option of the scp
command tells it to copy "recursively" (i.e., all the files in the directory as well as all files in the directories contained in the specified directory.
You can use either method described above (FileZilla or the scp
command) to copy files directly from the directory to which the HVSR script saves the individual HVSR site files. Usually, this is /opt/hvsr/data
.
When data has been saved/combined using the HVSR script, you will already have a complete file that can be used for processing. In this case, the default value for the source
parameter (source="file"
) will be used, so that does not need to be specified, nor does the instrument. You can enter the values for the network
, station
, and channels
parameters, but these will be read from the file itself in any case. A minimal working example of how to process data in this way is shown below:
import sprit
hvsrData = sprit.run(input_data="/path/to/your/hvsr_data_file.mseed")
NOTE: It is recommended to specify the following parameters whenever processing data using any method in SpRIT to ensure the primary metadata is saved to the
HVSRData
object:
site
(defaults to "HVSRSite")project
(no default)xcoord
ycoord
input_crs
anything can the can be read by pyproj'sfrom_user_input()
functionelevation
elev_unit
See here for more information on those parameters.
Data that is in the format as exported from the Raspberry Shake (one file per channel per day in separate subdirectories) can be extracted and processed using the source="raw"
specification in combination with instrument="raspberry shake"
.
In this case, the input_data
parameter should be set to the file path of the directory named for the station (this directory should contain three subdirectories called EHE.D
, EHN.D
, EHZ.D
, which each contain one file per day (the last three characters of the filenames will be the day of the year, and the files are in MiniSEED format, but do not have the .mseed extension).
You will need to specify several parameters when reading "raw" Raspberry Shake data in this way: station
, acq_date
, starttime
, and endtime
. There are various other parameters that may be helpful to specify. For example, specifying a directory filepath for the data_export_path
parameter will export your site data as a self-contained MiniSEED file. The following is a minimal example of data processed in this way.
import sprit
hvsrData = sprit.run(input_data="/path/to/your/shake/station/directory/",
source="raw",
instrument="raspberry shake",
station="RS000",
acq_date="2025-01-01",
starttime="12:00",
endtime="13:00",
data_export_path= "/path/to/export/directory/"
)
In some cases, it may be easier to move the three files associated with different channels from the same day into a single directory. In this case, you can use the source="directory"
option. This is similar to the source="raw"
option, except that all three channels' files are in the same directory.
import sprit
hvsrData = sprit.run(input_data="/path/to/directory/where/you/placed/the/three/channel/files/",
source="directory",
instrument="raspberry shake",
station="RS000",
acq_date="2025-01-01",
starttime="12:00",
endtime="13:00",
data_export_path= "/path/to/export/directory/"
)