extract module

The extract module is used to extract das data within a given time window from a dataset defined by multiple files. The dataset is first scanned to build a basic database (a Panda DataFrame), then the dabase is used to select and extract to data of interest

Build Database

extract.scan_data(pathname, pattern='*.h5', recursive=False)

Description

Scan a directory given by path and return a list of das files with their respective time span. The scanning recognize das files in format Febus-Optics (version>2) or a1das reducted format

path:

(str) directory containing the DAS files

pattern:

(str) string pattern defining the DAS file (default = *.h5)

recursive:

(logical) scan recursively (True) or not (False), default=False

return:

(Panda DataFrame) list of available files

extract.save_database(df, database)

Description

Save a data catalog containing the list of file with their time span as a Panda dataframe in a pickle file

df:

(panda DataFrame)

database:

(str) name of catalog (suffix .pickle is automatically added)

extract.load_database(database)

Description

Load a data catalog containing the list of file with their time span as a Panda dataframe in a pickle file

catalog:

(str) name of catalog (suffix .pickle is automatically added)

return:

df (panda DataFrame)

select and extract

extract.select(database, stime, etime=None, drange=None, dist_step=None, duration=None, verbose=0)

Description

Select the das data from the database (built using function scan_data() that satisfy the time window criterion given by (start_time, end_time) or (start_time, duration) Data are returned as a list of core.A1Section() das section.

Input

database:

(Panda DataFrame) catalog of file with their time span as obtain by scan_data

stime:

UTCDateTime(obsPy) start time

path:

string data location on disc.

etime:

UTCDateTime(obsPy), optional end time. default is None.

drange:

(tuple, float), optional DESCRIPTION. default is None.

dist_step:

(float), distance in meter

duration:

(float), duration in sec if etime not supplied. The default is None.

verbose:

(int), verbosity, The default is 0.

raises ValueError:

DESCRIPTION.

rtype:

a list of das sections in core.A1Section() format (i.e. header and data)