Skip to content

Sixs

source module isofit.data.cli.sixs

Downloads 6S from https://github.com/isofit/6S

Functions

  • get_exe Retrieves the 6S executable from a given path

  • precheck Checks if gfortran is installed before downloading SixS

  • patch_makefile Patch the 6S Makefile to: - Add -std=legacy to the EXTRAS (isofit)

  • make Builds a 6S directory via make

  • download_mingw Downloads MinGW64 for Windows

  • download Downloads 6S from https://github.com/isofit/6S.

  • validate Validates a 6S installation

  • update Checks for an update and executes a new download if it is needed Note: Not implemented for this module at this time

  • download_cli Downloads 6S from https://github.com/isofit/6S. Only HDF5 versions are supported at this time.

  • validate_cli Validates the installation of 6S

source get_exe(path: str = None, version: bool = False)str

Retrieves the 6S executable from a given path

Parameters

  • path : str, default=None 6S directory path. If None, defaults to the ini sixs path

  • version : bool, default=False Returns the 6S version instead

Returns

  • pathlib.Path | str Either the 6S executable as a pathlib object or the string 6S version

Raises

  • FileNotFoundError

source precheck()

Checks if gfortran is installed before downloading SixS

Returns

  • True or None True if gfortran --version returns a valid response, None otherwise

source patch_makefile(file)

Patch the 6S Makefile to: - Add -std=legacy to the EXTRAS (isofit)

Parameters

  • file : pathlib.Path Makefile to patch inplace

source make(directory, stdout=subprocess.PIPE, stderr=subprocess.PIPE, debug=False)

Builds a 6S directory via make

Parameters

  • directory : str 6S directory to build

Notes

If on MacOS, executing the make command may fail if the user hasn't agreed to the Xcode and Apple SDKs license yet. In these cases, it may be required to run the following command in order to compile the program: $ sudo xcodebuild -license

source download_mingw(path=None, tag='latest', overwrite=False, **_)

Downloads MinGW64 for Windows

Parameters

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

  • 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

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

Downloads 6S from https://github.com/isofit/6S.

Parameters

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

  • 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

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

Validates a 6S 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

  • bool True if valid, False otherwise

source update(check=False, **kwargs)

Checks for an update and executes a new download if it is needed Note: Not implemented for this module at this time

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()

source download_cli(debug_make, mingw, **kwargs)

Downloads 6S from https://github.com/isofit/6S. 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 --path sixs /path/sixs download sixs: Override the ini file. This will save the provided path for future reference. - isofit download sixs --path /path/sixs: 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.

source validate_cli(**kwargs)

Validates the installation of 6S