Skip to content

Module pytools4dart.sequencer

Define and run dart sequences Contains Class Sequence and Class Sequence_runners

Classes

Sequence_runners

class Sequence_runners(
    sequence
)

Methods

dart
def dart(
    self,
    option='-start',
    timeout=None
)
Run a sequence of simulations.

Parameters
----------

sequence_name: str
    sequence name, e.g. sequence.name
option: str
    Either:

        * '-start' to start from the begining,
        * '-continue' to continue an interupted run.

Returns
-------
bool
    True if good
stack_bands
def stack_bands(
    self,
    driver='ENVI',
    rotate=True,
    zenith=0,
    azimuth=0,
    band_sub_dir=Path('BRF/ITERX/IMAGES_DART')
)
Stack bands into an ENVI .bil file.

Parameters
----------
driver: str
    GDAL driver, see https://gdal.org/drivers/raster/index.html.
    If driver='ENVI' it adds the wavelength and bandwidth of bands to the .hdr file.
rotate: bool
    rotate bands from DART orientation convention to a standard GIS orientation convention.
    See pytools4dart.hstools.rotate_raster for details.
zenith: float
    Zenith viewing angle (°)
azimuth: float
    Azimuth viewing angle (°)
band_sub_dir: str
    Subdirectory where to get the simulated image. Default is 'BRF/ITERX/IMAGES_DART'.

Returns
-------
str
    output files path

Sequencer

class Sequencer(
    simu,
    name=None,
    empty=False,
    ncpu=None
)

Sequence builder

Instance variables

name
ncpu

Methods

add_item
def add_item(
    self,
    group,
    key,
    values,
    type='enumerate',
    corenode=None,
    replace=False
)
Add an item (Entry in Dart) to sequence group. Group is created if not existing.
Parameters
----------
group: str
    Sequence group name

key: str
    Sequence parameter. Parameter name, part of its path or full path depending on corenode argument.

values: list
    Sequence values

type: str
    Type of sequence, either 'enumerate' or 'linear'

corenode: simulation core object

    Core node where to find the key. The full path corresponding to key is searched in that node with method findpaths.
    Thus, the key must be unique in node.

    If corenode=None, the full path of core parameter is expected in key argument.
    e.g. key="Coeff_diff.UnderstoryMultiFunctions.UnderstoryMulti[0].UnderstoryMultiModel.ProspectExternalModule.ProspectExternParameters.Cab"

replace: bool
    If True, replace existing item by new one.

Returns
-------
    create_DartSequencerDescriptorEntry
get_db_path
def get_db_path(
    self
)
Path of sequence database
Parameters
----------
sequence_name

Returns
-------
    str: Path of sequence database
grid
def grid(
    self
)
Grid of simulation parameters

Returns
-------
DataFrame
summary
def summary(
    self
)
Print a summary of the parameters
to_dataframe
def to_dataframe(
    self
)
DataFrame summarizing groups and items

Returns
-------
DataFrame
write
def write(
    self,
    file=None,
    overwrite=False,
    verbose=True
)
Parameters
----------
file: str
    path to sequence xml file.

overwrite: bool
    if True, overwrite existing sequence file.

verbose:
    if True, prints information when done.

Returns
-------
str
    file path