isofit.data.cli.srtmnet

Downloads sRTMnet from https://avng.jpl.nasa.gov/pub/PBrodrick/isofit/

Attributes

CMD

URL

Functions

getVersion([version])

Retrieves the available versions and verifies the requested version is valid. Times

download([path, tag, overwrite])

Downloads sRTMnet from https://avng.jpl.nasa.gov/pub/PBrodrick/isofit/.

validate([path, checkForUpdate, debug, error])

Validates an sRTMnet installation

detectInstalled([path])

Attempt to detect a currently installed sRTMnet model and, if present, save that

compare(file, name, version[, error])

Compares an existing sRTMnet file against some other provided version

isUpToDate([path, tag, debug, error])

Checks the installed version against the latest release

update([check])

Checks for an update and executes a new download if it is needed

download_cli(**kwargs)

Downloads sRTMnet from https://avng.jpl.nasa.gov/pub/PBrodrick/isofit/. Only HDF5 versions are supported at this time.

validate_cli(**kwargs)

Validates the installation of sRTMnet as well as checks for updates

Module Contents

CMD = 'srtmnet'[source]
URL = 'https://avng.jpl.nasa.gov/pub/PBrodrick/isofit/'[source]
getVersion(version='latest')[source]

Retrieves the available versions and verifies the requested version is valid. Times out after 10 seconds if the server is unavailable.

Parameters:

version (str, default="latest") – Version of sRTMnet to pull

Returns:

Requested version

Return type:

str

download(path=None, tag='latest', overwrite=False, **_)[source]

Downloads sRTMnet from https://avng.jpl.nasa.gov/pub/PBrodrick/isofit/.

Parameters:
  • output (str | None) – Path to output as. If None, defaults to the ini path

  • tag (str) – sRTMnet version to pull

  • overwrite (bool, default=False) – Overwrite an existing installation

  • **_ (dict) – Ignores unused params that may be used by other validate functions. This is to maintain compatibility with other functions

validate(path=None, checkForUpdate=True, debug=print, error=print, **_)[source]

Validates an sRTMnet installation

Parameters:
  • path (str, default=None) – Path to verify. If None, defaults to the ini path

  • checkForUpdate (bool, default=True) – Checks for updates if the path is valid

  • debug (function, default=print) – Print function to use for debug messages, eg. logging.debug

  • error (function, default=print) – Print function to use for error messages, eg. logging.error

  • **_ (dict) – Ignores unused params that may be used by other validate functions. This is to maintain compatibility with env.validate

Returns:

True if valid, False otherwise

Return type:

bool

detectInstalled(path: str = None)[source]

Attempt to detect a currently installed sRTMnet model and, if present, save that information back to the ini for future reference

Parameters:

path (str, default=None) – Path to check. If None, defaults to the ini path

compare(file, name, version, error=print)[source]

Compares an existing sRTMnet file against some other provided version

Parameters:
  • file (str) – sRTMnet model or aux file name

  • name (str) – File type name for reporting with

  • version (packaging.version.Version, default=None) – Version to compare against. If not given, retrieves the latest version from the server

  • error (function, default=print) – Print function to use for error messages, eg. logging.error

Returns:

True if the current version is not the latest, False otherwise

Return type:

bool

isUpToDate(path=None, tag='latest', debug=print, error=print, **_)[source]

Checks the installed version against the latest release

Parameters:
  • path (str, default=None) – Path to update. If None, defaults to the ini path

  • debug (function, default=print) – Print function to use for debug messages, eg. logging.debug

  • error (function, default=print) – Print function to use for error messages, eg. logging.error

  • **_ (dict) – Ignores unused params that may be used by other validate functions. This is to maintain compatibility with other functions

Returns:

True if the path is up to date, False otherwise

Return type:

bool

Notes

The Github workflows watch for the string “[x]” to determine if the cache needs to update the data of this module. If your module does not include this string, the workflows will never detect updates.

update(check=False, **kwargs)[source]

Checks for an update and executes a new download if it is needed

Parameters:
  • check (bool, default=False) – Just check if an update is available, do not download

  • **kwargs (dict) – Additional key-word arguments to pass to download()

download_cli(**kwargs)[source]

Downloads sRTMnet from https://avng.jpl.nasa.gov/pub/PBrodrick/isofit/. Only HDF5 versions are supported at this time.

 Run isofit download paths to see default path locations. There are two ways to specify output directory:

  • isofit –srtmnet /path/sRTMnet download sRTMnet: Override the ini file. This will save the provided path for future reference.

  • isofit download sRTMnet –path /path/sRTMnet: Temporarily set the output location. This will not be saved in the ini and may need to be manually set.

It is recommended to use the first style so the download path is remembered in the future.

validate_cli(**kwargs)[source]

Validates the installation of sRTMnet as well as checks for updates