isofit.data.cli.srtmnet ======================= .. py:module:: isofit.data.cli.srtmnet .. autoapi-nested-parse:: Downloads sRTMnet from https://avng.jpl.nasa.gov/pub/PBrodrick/isofit/ Attributes ---------- .. autoapisummary:: isofit.data.cli.srtmnet.CMD isofit.data.cli.srtmnet.URL Functions --------- .. autoapisummary:: isofit.data.cli.srtmnet.getVersion isofit.data.cli.srtmnet.download isofit.data.cli.srtmnet.validate isofit.data.cli.srtmnet.detectInstalled isofit.data.cli.srtmnet.compare isofit.data.cli.srtmnet.isUpToDate isofit.data.cli.srtmnet.update isofit.data.cli.srtmnet.download_cli isofit.data.cli.srtmnet.validate_cli Module Contents --------------- .. py:data:: CMD :value: 'srtmnet' .. py:data:: URL :value: 'https://avng.jpl.nasa.gov/pub/PBrodrick/isofit/' .. py:function:: getVersion(version='latest') Retrieves the available versions and verifies the requested version is valid. Times out after 10 seconds if the server is unavailable. :param version: Version of sRTMnet to pull :type version: str, default="latest" :returns: Requested version :rtype: str .. py:function:: download(path=None, tag='latest', overwrite=False, **_) Downloads sRTMnet from https://avng.jpl.nasa.gov/pub/PBrodrick/isofit/. :param output: Path to output as. If None, defaults to the ini path :type output: str | None :param tag: sRTMnet version to pull :type tag: str :param overwrite: Overwrite an existing installation :type overwrite: bool, default=False :param \*\*_: Ignores unused params that may be used by other validate functions. This is to maintain compatibility with other functions :type \*\*_: dict .. py:function:: validate(path=None, checkForUpdate=True, debug=print, error=print, **_) Validates an sRTMnet installation :param path: Path to verify. If None, defaults to the ini path :type path: str, default=None :param checkForUpdate: Checks for updates if the path is valid :type checkForUpdate: bool, default=True :param debug: Print function to use for debug messages, eg. logging.debug :type debug: function, default=print :param error: Print function to use for error messages, eg. logging.error :type error: function, default=print :param \*\*_: Ignores unused params that may be used by other validate functions. This is to maintain compatibility with env.validate :type \*\*_: dict :returns: True if valid, False otherwise :rtype: bool .. py:function:: detectInstalled(path: str = None) Attempt to detect a currently installed sRTMnet model and, if present, save that information back to the ini for future reference :param path: Path to check. If None, defaults to the ini path :type path: str, default=None .. py:function:: compare(file, name, version, error=print) Compares an existing sRTMnet file against some other provided version :param file: sRTMnet model or aux file name :type file: str :param name: File type name for reporting with :type name: str :param version: Version to compare against. If not given, retrieves the latest version from the server :type version: packaging.version.Version, default=None :param error: Print function to use for error messages, eg. logging.error :type error: function, default=print :returns: True if the current version is not the latest, False otherwise :rtype: bool .. py:function:: isUpToDate(path=None, tag='latest', debug=print, error=print, **_) Checks the installed version against the latest release :param path: Path to update. If None, defaults to the ini path :type path: str, default=None :param debug: Print function to use for debug messages, eg. logging.debug :type debug: function, default=print :param error: Print function to use for error messages, eg. logging.error :type error: function, default=print :param \*\*_: Ignores unused params that may be used by other validate functions. This is to maintain compatibility with other functions :type \*\*_: dict :returns: True if the path is up to date, False otherwise :rtype: bool .. rubric:: 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. .. py:function:: update(check=False, **kwargs) Checks for an update and executes a new download if it is needed :param check: Just check if an update is available, do not download :type check: bool, default=False :param \*\*kwargs: Additional key-word arguments to pass to download() :type \*\*kwargs: dict .. py:function:: download_cli(**kwargs) 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. .. py:function:: validate_cli(**kwargs) Validates the installation of sRTMnet as well as checks for updates