readgssi.translate
(outputs)¶
-
readgssi.translate.
csv
(ar, outfile_abspath, header=None, verbose=False)¶ Output to csv. Data is read into a
pandas.DataFrame
, then written usingpandas.DataFrame.to_csv()
.- Parameters
ar (numpy.ndarray) – Radar array
outfile_abspath (str) – Output file path
header (dict) – File header dictionary to write, if desired. Defaults to None.
verbose (bool) – Verbose, defaults to False
-
readgssi.translate.
dzt
(ar, outfile_abspath, header, verbose=False)¶ Warning
DZT output is only currently compatible with single-channel files.
This function will output a RADAN-compatible DZT file after processing. This is useful to circumvent RADAN’s distance-normalization bug when the desired outcome is array migration.
Users can set DZT output via the command line by setting the
-f dzt
flag, or in Python by doing the following:from readgssi.dzt import readdzt from readgssi import translate from readgssi.arrayops import stack, distance_normalize # first, read a data file header, data, gps = readdzt('FILE__001.DZT') # do some stuff # (distance normalization must be done before stacking) for a in data: header, data[a], gps = distance_normalize(header=header, ar=data[a], gps=gps) header, data[a], stack = stack(header=header, ar=data[a], stack=10) # output as modified DZT translate.dzt(ar=data, outfile_abspath='FILE__001-DnS10.DZT', header=header)
This will output
FILE__001-DnS10.DZT
as a distance-normalized DZT.- Parameters
ar (numpy.ndarray) – Radar array
infile_basename (str) – Input file basename
outfile_abspath (str) – Output file path
header (dict) – File header dictionary to write, if desired. Defaults to None.
verbose (bool) – Verbose, defaults to False
-
readgssi.translate.
gprpy
(ar, header, outfile_abspath, verbose=False)¶ Save in a format GPRPy can open (numpy binary .npy and a .json formatted header file).
Note
GPRPy support for this feature is forthcoming (https://github.com/NSGeophysics/GPRPy/issues/3#issuecomment-460462612).
- Parameters
ar (numpy.ndarray) – Radar array
outfile_abspath (str) – Output file path
header (dict) – File header dictionary to write, if desired. Defaults to None.
verbose (bool) – Verbose, defaults to False
-
readgssi.translate.
h5
(ar, infile_basename, outfile_abspath, header, verbose=False)¶ Warning
HDF5 output is not yet available.
In the future, this function will output to HDF5 format.
- Parameters
ar (numpy.ndarray) – Radar array
infile_basename (str) – Input file basename
outfile_abspath (str) – Output file path
header (dict) – File header dictionary to write, if desired. Defaults to None.
verbose (bool) – Verbose, defaults to False
-
readgssi.translate.
json_header
(header, outfile_abspath, verbose=False)¶ Save header values as a .json so another script can take what it needs. This is used to export to GPRPy.
-
readgssi.translate.
numpy
(ar, outfile_abspath, header=None, verbose=False)¶ Output to binary numpy binary file (.npy) with the option of writing the header to .json as well.
- Parameters
ar (numpy.ndarray) – Radar array
outfile_abspath (str) – Output file path
header (dict) – File header dictionary to write, if desired. Defaults to None.
verbose (bool) – Verbose, defaults to False
-
readgssi.translate.
segy
(ar, outfile_abspath, header, verbose=False)¶ Warning
SEGY output is not yet available.
In the future, this function will output to SEGY format.
- Parameters
ar (numpy.ndarray) – Radar array
outfile_abspath (str) – Output file path
header (dict) – File header dictionary to write, if desired. Defaults to None.
verbose (bool) – Verbose, defaults to False
-
readgssi.translate.
writetime
(d)¶ Function to write dates to
rfDateByte
binary objects in DZT headers. An inverse of thereadgssi.dzt.readtime()
function.DZT
rfDateByte
objects are 32 bits of binary (01001010111110011010011100101111), structured as little endian u5u6u5u5u4u7 where all numbers are base 2 unsigned int (uX) composed of X number of bits. Four bytes is an unnecessarily high level of compression for a single date object in a filetype that often contains tens or hundreds of megabytes of array information anyway.So this function reads a datetime object and outputs (seconds/2, min, hr, day, month, year-1980).
For more information on
rfDateByte
, see page 55 of GSSI’s SIR 3000 manual.- Parameters
d (datetime) – the
datetime.datetime
to be encoded- Return type