classmethod VelocityModel.read_tvel_file(filename)[source]

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

The name of the model file for model “modelname” should be “modelname.tvel”. The format of the file is:

comment line - generally info about the P velocity model
comment line - generally info about the S velocity model
depth pVel sVel Density
depth pVel sVel Density

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 ”.tvel” dropped if present
  • radius_of_planet - the largest depth in the model
  • meanDensity - 5517.0
  • G - 6.67e-11

Comments using # are also allowed.

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