Task: Convert Between CLR and ND

Convert from CLR to ND

A conversion from the continuous layer representation to a discrete layering is necessary for the computation of travel times, since all the computational routines are based on MODEL structures and .nd files.

To compute travel times for a velocity model that is stored in a .clr file, do the following:

  1. load the .clr file by executing clr=mkreadclr('path/to/your/clr_file.clr','silent');
    clr is now a structure variable containing all information about the velocity model.
  2. convert the CLR structure into a MODEL structure by executing model=mkclr2model(clr,deltaz,mode);
    where
    clr
    is the structure variable obtained in step 1
    deltaz
    is either the depth sampling width in km or a list of depths at which the model will be sampled. If the sample distance is too big, spurious caustics and traveltime triplications may result. Problems caused by a crude sampling can partly be "repaired" by later model interpolation, but if you have an analytic model, you better use a sufficiently dense discretization.
    mode
    a string "spherical" or "flat" which denotes the sampling method: "spherical" denotes a sampling which is equidistant in spherical coordinates, whereas "flat" sampling is equidistant in flat earth coordinates. The latter produces a larger number of samples, resulting in longer computation times for ray paths and travel times, but also much better results especially for core phases. (The mode will be ignored if deltaz is a depth list)
    model
    is then a structure variable containing a discrete layer model as needed by the routines for travel time computation.
  3. Perform your computations with model as input data (see the section on routine tasks to learn how).
    Or
    execute mkwritend(model,'path/to/save/nd_file.nd'); to store the model in an .nd file for later use.
Convert from ND to CLR

Currently only a verly limited transformation from .nd to .clr files is possible, using the MKND2CLR routine. The conversion is limited to velocity models with constant velocity layers.

  1. Read the model from a .nd file: model=mkreadnd(path)
  2. Convert the model structure into a CLR structure: clrout=mknd2clr(model,mode), where
    model
    a model structure, as read from file
    mode
    conversion mode: currently only the "constant" mode is available, where it is assumed that the velocity and all other parameters remain constant throughout a layer.
  3. write the CLR structure to disk, using mkwriteclr(clr,path);

eof.