Table Of Contents

Previous topic

Module tracesExceptions

Next topic

Module correlationsMain

This Page

Package correlations

Package for computing correlations from the traces package output.

correlations.correlationsMain Main functionality: provide a function for computing correlations.
correlations.correlationsParam File parameters for the package.
correlations.correlationsGetParam Get the parameters.
correlations.correlationsGeneratorPath Generators of couples traces and save path files.
correlations.correlationsTestParam Test the validity of parameters.
correlations.correlationsCorrelation Compute correlations.
correlations.correlationsWriter Classes and methods to save the traces.
correlations.correlationsLoader Classes and methods to load the traces.
correlations.correlationsUtil Some tools for the package.
correlations.correlationsExceptions Classes of exceptions for the package.

Overview of the Package correlations

General workflow

The package correlations provides some tools in order to compute all the correlations from a directory with a valid architecture (See requirement in the module correlations.correlationsMain):

digraph structs {
    rankdir="TP"
    node [shape=Mrecord];
    Load [label="<LoadDirectory> LoadDirectory |{Should contain files with format numpy 'npy'| Architecture of files: output of the package traces }"];
    Save [label="<SaveDirectory> SaveDirectory |{Architecture of correlations :|  FirstComponent_SecondComponent/Year/JulianDay/...\nFirstStation/FirstStation_SecondStation.npy}"];
    ModuleMain [shape=record, label="<ModuleMain> Module\n correlations.correlationsMain| Compute all the correlations \nfor all the existing couple of traces."];
    Load:LoadDirectory -> ModuleMain:ModuleMain ->Save:SaveDirectory

}

General specification

  1. Centralized case:

    Given:

    • A ‘LoadDirectory’.
    • A ‘SaveDirectory’.
    • A first component.
    • A second component.
    • A set of dates.
    • A set of stations.

    Make:

    1. Compute the correlations of all the couples of traces from the ‘LoadDirectory’ whose correspond to the FirstComponent, the SecondComponent, the set of dates and the set of stations.

    2. Save the correlations in the ‘SaveDirectory’ with architecture:

      SaveDirectory -> FirstComponent_SecondComponent -> Year -> JulianDay -> FirstStation -> FirstStation_SecondStation.npy

  2. Decentralized case:

    Given:

    • A ‘LoadDirectory’.

    • A ‘SaveDirectory’.

    • A first component.

    • A second component.

    • For the dates:

      • A set of dates.
      • A number of sublist of dates.
      • An index of sublist of dates.
    • For the station:

      • A set of stations.
      • A number of sublist of stations.
      • Either one index of sublist of stations.
      • Or either two indexes for two disjoints sublists of stations.

    Make:

    1. Compute the correlations of all the couples of traces from the ‘LoadDirectory’ whose correspond to the FirstComponent, the SecondComponent, the sublists of dates and the one or two sublists of stations.

    2. Save the correlations in the ‘SaveDirectory’ with architecture:

      SaveDirectory -> FirstComponent_SecondComponent -> Year -> JulianDay -> FirstStation -> FirstStation_SecondStation.npy

General architecture

Architecture of modules (prefix “correlations” is omitted):

  • CHANGE the modules correlations.correlationsParam in order to set the parameters.
  • LAUNCH with python the module correlations.correlationsMain with the in line parameters for computing the correlations of a set of couples traces in a directory.
  • REQUIRE python2.7, numpy, scipy (scientific libraries).

digraph structs {
    Main [color="red", shape=tab, label="Main"];
    Param [color="green", shape=tab, label="Param"];
    GetParam [shape=tab, label="GetParam"];
    GeneratorPath [shape=tab, label="GeneratorPath"];
    TestParam [shape=tab, label="TestParam"];
    Loader [shape=tab, label="Loader"];
    Correlation [shape=tab, label="Correlation"]
    Writer [shape=tab, label="Writer"];
    Util [shape=tab, label="Util"];
    Exceptions [shape=tab, label="Exceptions"];

    Main -> GetParam
    Main -> GeneratorPath
    Main -> Loader
    Main -> Correlation
    Main -> Writer
    Main -> Exceptions

    GetParam -> Param
    GetParam -> TestParam
    GetParam -> Util
    GetParam -> Exceptions

    GeneratorPath -> Exceptions

    Loader -> Exceptions

    Correlation -> Param
    Correlation -> Exceptions

    Writer -> Exceptions

    TestParam -> Util

    Exceptions -> Param

}

See also the tutorial


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