Snapshot data handling¶
read_snp.x¶
Snapshot files can be extracted or visualized by the program read_snp.x.
1 2 | |
-h-
Print the header information defined in the snapshot, as in the following example.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
$ ../bin/read_snp.x -i swpc_3d.xz.ps.snp -h [code type] : SWPC_3D [header version]: 3 [title] : swpc_3d [date generated]: 1408015126 2014-08-14T11-18-46 [coordinate] : xz [data type] : ps [ns1] : 256 [ns2] : 256 [beg1] : -63.87500 [beg2] : -9.87500 [ds1] : 0.25000 [ds2] : 0.25000 [dt] : 0.05000 [na1] : 20 [na2] : 20 [nmed] : 3 [nsnp] : 2 [clon] : 143.50000 [clat] : 42.00000 -ppm,-bmp- Visualize and export the image files in ppm or bmp format. Directory for images will be automatically created under the current
directory and image files with sequential numbers will be stored
there. If the snapshot file is displacement or velocity, the
absolute values of the vertical and horizontal amplitudes will be
colored red and green, respectively. For the
PSfile, the absolute values of the divergence and rotation vector will be colored similarly. If the absolute value option is specified, the black-red-yellow-white color palette (similar to the "hot" color palette in GMT) will be adopted. For cross sections along the surface (ob,fs), the topography color map will be overlaid. For other cross sections, the velocity structure in the section will be overlaid. -pall- Visualize including the absorbing boundary region. This option works only if it is used with . By default, the absorbing boundary region will be clipped.
-mul- Multiply
varby the amplitude for visualization. Adjust the visualized color by changing this value. Optionally, by specifying-mul1or-mul2, for example, one may change the weight of the amplitude by component. -abs- Visualize the absolute value of the vector. This only works with the velocity or displacement snapshots.
-bin,-asc- Export the snapshot data to binary (
-bin) or ascii (-asc) files. The data file will be created in the automatically createdbinorascdirectories. The binary formatted data can be directly used inGMTwith thexyz2grdmodule by appending the-bisoption. -skip n- Skip the first snapshots for visualization or data exports.
-notim- Do not plot the elapsed time in the snapshot figures.
-lpf ng- A second-order Butterworth low-pass filter is applied in the wavenumber domain.
ngspecifies the number of pixel points in the snapshot corresponding to the cutoff wavelength. -bgsat n- Adjust the brightness of the background structure or topography by using the parameter
n.n=100(default) produces full color, whilen=0produces grayscale. -color mode- Color palette selection. When
mode=legacy(default), red and green are selected; whenmode=cud, the Color Universal Design orange and light blue are selected.
diff_snp.x¶
This program takes the difference between two snapshots and exports it to another snapshot file.
1 | |
The output file format (NetCDF or binary) depends on the input file
format.
fs2grd.x¶
Although snapshot data from OpenSWPC along the ground surface or ocean bottom follows the NetCDF format, they cannot be used in the GMT's grdimage command because they are not evenly-spaced grid data along longitude and latitude.
The utility program fs2grd.x resamples the OpenSWPC's output dataset in longitude/latitude coordinate to convert it to GMT-friendly grd-format dataset.
1 2 | |
-i- Specify the output file of
OpenSWPCin NetCDF format to be resampled. The snapshot must be on the free surface (fs), ocean bottom (ob) orxycoordinates. -Rlon0/lon1/lat0/lat1- The region of resampling. Minimum(
lon0) and maximum(lon1) longigude, minimum(lat0) and maximum(lat1) latitude. The formatting is similar to that in the GMT, but a blank space is necessary between-Rand arguments. -dlondelta_lon,-dlatdelta_lat- Grid spacings in longitudal and latitudal directions.
-vvariable_name- Variable name to be resampled. Any horizontal-space 2D variables can be specified in the snapshot. One may confirm the list of the variables in the NetCDF file by
ncdump -hcommand. If the specified variable is time-dependent, such asVx, Vy, Vzordiv, rot_x, rot_y, rot_z, thefs2grd.xwill export time-sequential (many) files.