Error creating custom TauPyModel from nd file

Hi Everyone,
I am trying to create a velocity model to use in TauPy (which I am new to although I do have some experience with ObsPy). As I only have my velocity model as a .csv I went and created a .nd file where I took the depth, Vp, Vs and Vp/Vs ratio. I only have an optimized velocity model down to 15km (all of my events are actually within the upper 5km!) but I extended it to the inner core using values from IASP91 as you need the Moho/CMB in the velocity file.
When I run:

taup_create.build_taup_model(‘1D.nd’, output_folder=‘VelModel_TauP’)

I get:

SlownessModelError: No layer contains this depth

I was wondering if someone could explain this error to me, as my understanding was that the code was simply taking the .nd file and creating a .npz file of the same thing?

Any help would be great so I can use my own velocity model to calculate travel times!

Thanks,
Becky

Hi Becky,

I never used .nd files, but with .tvel files structured like this (depth, Vp, Vs, Density):

ak135 - P
ak135 - S
0.0000 5.8000 3.4600 2.7200
10.0000 5.8000 3.4600 2.7201
10.0000 5.8001 3.4602 2.7202
20.0000 5.8000 3.4601 2.7201
20.0000 5.8001 3.4602 2.7202
30.0000 6.5000 3.8501 2.9201
30.0000 6.5001 3.8502 2.9202
35.000 6.5000 3.8500 2.9200
35.000 8.0400 4.4800 3.3198
40.0000 8.0406 4.4812 3.3228

it works fine, I hope this could help,
tom

Perfect!! Thank you :slight_smile:
Adapted my file to look like this and appears to work!

for the record, if others find this thread: it is easy to add a local 1D model above the ak135 model and generate your own taup phases. Note, to have (underside) reflections, you need to have the depth of that layer in the tvel file, otherwise the taup_ procedures will return the reflections to the nearest depth.