This Page

Classes and methods to load and save the dictionaries of doublets.

Module doubletDictOfDoublet

Inheritance diagram of DictOfDoubletIO, WriterDictOfDoubletPickle, LoadDictOfDoubletPickle

class doublet.doubletDictOfDoublet.DictOfDoubletIO(**kwargs)

Provide a method getDirAndFileSaveDictOfDoublet() to get the path directory and the file name for doublet and a method MakeDirectories() in order to create a path directory.

Parameter :

Dictionary with the key:

param : obj

Object with attributes PathDirDictDoublet, FirstComponent, SecondComponent, PrefixNameFileDictOfDoublet.

getKeyCoupleStations(FirstStation, SecondStation)

Get the name of a key for a couple of stations.

getDirAndFileDictOfDoublet(Date, FirstStation=None, SecondStation=None)

Return the directory and the filename for saving the dictionary of doublet either for:

  • A date.
  • A date and a station.
  • A date and a couple of stations.

Note

If the date contains separators, it will be replace by character ‘_’ in the file name.

makeDirectories(DirSave)

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

Parameter :
DirSave: str

The path directory.

writeOneDictDoublet()

Abstract method, not implemented.

loadOneDictDoublet()

Abstract method, not implemented.

class doublet.doubletDictOfDoublet.WriterDictOfDoubletPickle(**kwargs)
Base class:DictOfDoubletIO Inherits all attributes of the base class.

Provide a method writeOneDictDoublet() to load the dictionary of doublets.

writeOneDictDoublet(DirSave, FileSave, DictOfDoublet)

Save a dictionary of doublet with the file path given with cPickle.

Parameters :
DictOfDoublet: dict

The dictionary of doublets.

DirSave: str

Directory name to save the dictionary.

FileSave: str

File name of the dictionary saved.

(Try twice to save the dictionary, with the highest protocol (-1).)

class doublet.doubletDictOfDoublet.LoadDictOfDoubletPickle(**kwargs)
Base class:DictOfDoubletIO Inherits all attributes of the base class.

Provide a method loadOneDictDoublet() to load the dictionary of doublets.

loadOneDictDoublet(DirSave, FileSave)

Load a dictionary of doublets with the file path given and open by cPickle.

Parameters :
DirSave: str

Directory name to load the dictionary of doublets.

FileSave: str

File name of the dictionary of doublets loaded.


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].