obspy.taup.velocity_model.VelocityModel.read_nd_file

classmethod VelocityModel.read_nd_file(filename)[source]

Read in a velocity model from a “nd” ASCII text file.

This method reads in a velocity model from a “nd” ASCII text file, the format used by Xgbm. The name of the model file for model “modelname” should be “modelname.nd”.

The format of the file is:

depth pVel sVel Density Qp Qs

depth pVel sVel Density Qp Qs

. . . with each major boundary separated with a line with “mantle”, “outer-core” or “inner-core”. “moho”, “cmb” and “icocb” are allowed as synonyms respectively.

This feature makes phase interpretation much easier to code. Also, as they are not needed for travel time calculations, the density, Qp and Qs may be omitted.

The velocities are assumed to be linear between sample points. Because this type of model file doesn’t give complete information we make the following assumptions:

modelname - from the filename, with ”.nd” dropped, if present

radius_of_planet - the largest depth in the model

Comments are allowed. # signifies that the rest of the line is a comment. If # is the first character in a line, the line is ignored

Parameters:filename (str) The name of the file to read.
Raises ValueError:
 If model file is in error.