Previous topic

Module correlationsCorrelation

Next topic

Module correlationsLoader

This Page

Classes and methods to save the traces.

Module correlationsWriter

Inheritance diagram of WriterCorrelation, WriterOneCorrelationNpy, WriterOneCorrelationMat

class correlations.correlationsWriter.WriterCorrelation(param)

Provide a method getDirAndFileSaveCorrelation() to get the path directory and the file name for save the correlation and a method tryMakeDirectories() in order to create a path directory.

Parameter :

param : obj

Object with attributes FormatSave, SaveDirectory, ComponentFirstStation, ComponentSecondStation.

getDirAndFileSaveCorrelation(Date, FirstStation, SecondStation)

Return a path directory dependent of the date and a file name dependent of the a couple of stations.

tryMakeDirectories(DirSave)

Write all the directories defined in the path directory with right 770 if they do not exist.

Parameter :
DirSave: str

The path directory.

Note

If it is not possible, catch the exception and print a message. (Try twice for concurrency problems.)

writeOneCorrelation()

Abstract method, not implemented.

class correlations.correlationsWriter.WriterOneCorrelationNpy(param)
Base class:

WriterCorrelation Inherits all attibutes of the base class.

Parameter :

param : obj

Object with attributes FormatSave, SaveDirectory, ComponentFirstStation, ComponentSecondStation.

writeOneCorrelation(DirSave, FileSave, corr)

Save a correlation with the file path given and the format numpy (.npy).

Parameters :
corr: numpy array

The correlation to be saved.

DirSave: str

Directory name to save the trace.

FileSave: str

File name of the trace saved.

(Try twice to save the correlations for concurrency problems.)

class correlations.correlationsWriter.WriterOneCorrelationMat(param)
Base class:

WriterCorrelation Inherits all attibutes of the base class.

Parameter :

param : obj

Object with attributes FormatSave, SaveDirectory, ComponentFirstStation, ComponentSecondStation.

writeOneCorrelation(DirSave, FileSave, corr)

Save a correlation with the file path given and the format matlab (.mat).

Parameters :
corr: numpy array

The correlation to be saved.

DirSave: str

Directory name to save the trace.

FileSave: str

File name of the trace saved.

(Try twice to save the correlations for concurrency problems.)


Whisper project: FP7 ERC Advanced grant 227507 (WHISPER).
Codes are develop for the Whisper project (Seismic ambient noise).
If you use this code, specify it is provide by: Whisper project FP7 ERC Advanced grant 227507 (WHISPER).
Author: Xavier Briand. For questions, send email to xav.briand.whisper@gmail.com with subject begin exactly with [whisper].