isofit.data.cli.sixs

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

Attributes

CMD

MINGW

Functions

precheck()

Checks if gfortran is installed before downloading SixS

patch_makefile(file)

Patch the 6S Makefile to:

make(directory[, stdout, stderr, debug])

Builds a 6S directory via make

download_mingw([path, tag, overwrite])

Downloads MinGW64 for Windows

download([path, tag, overwrite, debug_make])

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

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

Validates a 6S installation

update([check])

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

download_cli(debug_make, mingw, **kwargs)

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

validate_cli(**kwargs)

Validates the installation of 6S

Module Contents

CMD = 'sixs'[source]
MINGW = 'https://github.com/brechtsanders/winlibs_mingw/releases/download/15.2.0posix-13.0.0-msvcrt-r2/wi...[source]
precheck()[source]

Checks if gfortran is installed before downloading SixS

Returns:

True if gfortran –version returns a valid response, None otherwise

Return type:

True or None

patch_makefile(file)[source]

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

Parameters:

file (pathlib.Path) – Makefile to patch inplace

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

Builds a 6S directory via make

Parameters:

directory (str) – 6S directory to build

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

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

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

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

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

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:

True if valid, False otherwise

Return type:

bool

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

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

download_cli(debug_make, mingw, **kwargs)[source]

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 –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.

validate_cli(**kwargs)[source]

Validates the installation of 6S