I have been trying to predict the network coverage based on antennae characteristics (such as height, lat and long etc). Came across this package which seems to be dormant now (https://github.com/NZRS/wavetrace)

This is the error message that i get-

FileNotFoundError                         Traceback (most recent call last)
/var/folders/70/qd0s3l2d6fnf4jk2n2w0fryw0000gp/T/ipykernel_96803/1928621339.py in <module>
     22 out_path = TMP_DIR+'/splat_files'
     23 wt.process_topography(topography_path, out_path, 
---> 24   high_definition=high_definition)
     26 #%ll -h {out_path}

~/PycharmProjects/Netowrth/wavetrace/wavetrace/main.py in process_topography(in_path, out_path, high_definition)
    418         # Convert to SDF
    419         cp = subprocess.run([splat, f.name], cwd=str(f.parent),
--> 420           stdout=subprocess.PIPE, universal_newlines=True, check=True)
    422         # Get name of output file, which SPLAT! created and which differs

~/opt/anaconda3/envs/Netowrth/lib/python3.7/subprocess.py in run(input, capture_output, timeout, check, *popenargs, **kwargs)
    486         kwargs['stderr'] = PIPE
--> 488     with Popen(*popenargs, **kwargs) as process:
    489         try:
    490             stdout, stderr = process.communicate(input, timeout=timeout)

~/opt/anaconda3/envs/Netowrth/lib/python3.7/subprocess.py in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors, text)
    798                                 c2pread, c2pwrite,
    799                                 errread, errwrite,
--> 800                                 restore_signals, start_new_session)
    801         except:
    802             # Cleanup if the child failed starting.

~/opt/anaconda3/envs/Netowrth/lib/python3.7/subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, start_new_session)
   1549                         if errno_num == errno.ENOENT:
   1550                             err_msg += ': ' + repr(err_filename)
-> 1551                     raise child_exception_type(errno_num, err_msg, err_filename)
   1552                 raise child_exception_type(err_msg)

FileNotFoundError: [Errno 2] No such file or directory: 'srtm2sdf': 'srtm2sdf'

This is the code that i am using here-

out_path = TMP_DIR+'/splat_files'
wt.process_topography(topography_path, out_path, 

Please note that this python notebook can also be found here if you want to look at the entire workflow

According to the module, this is the definition of process_topography

import sys
from pathlib import Path
import shutil
import json
import csv
import re
import math

from shapely.geometry import Point
import requests

def process_topography(in_path, out_path, high_definition=False):
    Convert each SRTM HGT topography file in the directory ``in_path`` to a SPLAT! Data File (SDF) file in the directory ``out_path``,     creating the directory if it does not exist.
    If ``high_definition``, then assume the input data is high definition.

        - ``in_path``: string or Path object specifying a directory
        - ``out_path``: string or Path object specifying a directory
        - ``high_definition``: boolean


        - Calls SPLAT!'s ``srtm2sdf`` or ``srtm2sdf-hd`` 
          (if ``high_definition``) command to do the work
        - Raises a ``subprocess.CalledProcessError`` if SPLAT! fails to 
          convert a file
        - Each SRTM1 or SRTM3 file must have a name of the form <SRTM tile ID>[.something].hgt.zip or <SRTM tile ID>[.something].hgt, e.g. S36E173.SRTMGL3.hgt.zip 
    in_path = Path(in_path)
    out_path = Path(out_path)
    if not out_path.exists():

    splat = 'srtm2sdf'
    if high_definition:
        splat += '-hd'

    sdf_pattern = re.compile(r"[\d\w\-\:]+\.sdf")

    for f in in_path.iterdir():
        if not (f.name.endswith('.hgt') or f.name.endswith('.hgt.zip')):

        # Unzip if necessary
        is_zip = False
        if f.name.endswith('.zip'):
            is_zip = True
            shutil.unpack_archive(str(f), str(f.parent))
            tile_id = f.name.split('.')[0]
            f = f.parent/'{!s}.hgt'.format(tile_id)

        # Convert to SDF
        cp = subprocess.run([splat, f.name], cwd=str(f.parent),
          stdout=subprocess.PIPE, universal_newlines=True, check=True)

        # Get name of output file, which SPLAT! created and which differs
        # from the original name, and move the output to the out path
        m = sdf_pattern.search(cp.stdout)
        name = m.group(0)        
        src = in_path/name
        tgt = out_path/name
        shutil.move(str(src), str(tgt))

        # Clean up
        if is_zip:

Any help is appreciated. From the error, it seemed like srtmsdf must be a folder but according to the python subprocess, it has to be a function


It seems that the function tries to call the SPLAT! command line using srtm2sdf on all files in in_path. Trying to run a command line program using subprocess.run when the command line program doesn't exist (i.e. returns a 'command not found' error when trying to run a command on the command line) gives a FileNotFoundError instead of the actual error you get from the command line. Based on this it seems you haven't installed SPLAT!, which is part of the requirements of this package. Therefore make sure you have installed all prerequisites needed for this package to work (SPLAT!, GDAL, and ImageMagick).

  • $\begingroup$ Great insight! Let me install and get back to you $\endgroup$
    – ricardo
    Jan 6 at 21:17
  • $\begingroup$ I still get the same error even after installing splat, from the error it seems that python has assumed that 'srtm2sdf' is a folder. (hence, file/folder not found). I even tried creating a folder by that name but that gave me a 'permission denied error' $\endgroup$
    – ricardo
    Jan 6 at 22:10
  • $\begingroup$ What do you get when you try to run srtm2sdf from you command line? $\endgroup$
    – Oxbowerce
    Jan 7 at 9:10
  • $\begingroup$ says " command not found: srtm2sdf" . which could mean problems with splat since i installed splat 0.32 $\endgroup$
    – ricardo
    Jan 7 at 16:07
  • $\begingroup$ So SPLAT! is not yet installed correctly, the repository says you have to use version 1.4.0 or above, so make sure that the version you install is high enough. $\endgroup$
    – Oxbowerce
    Jan 7 at 16:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.