uwsift.control package

Submodules

uwsift.control.auto_update module

class uwsift.control.auto_update.AutoUpdateManager(window, minimum_interval, search_path=None)[source]

Bases: object

on_loading_done(uuids: List[UUID])[source]
update()[source]

Called by self.timer’s tick

class uwsift.control.auto_update.StartTimeGranuleUpdatePolicy(query_catalogue_for_satpy_importer_args: Callable)[source]

Bases: object

update(current_constraints: Dict) Tuple | None[source]
Parameters:

current_constraints – dictionary as provided by catalogue_settings.yaml.

Returns:

None if no new satpy scenes are available from the configured search dir or a tuple consisting of the reader: List and importer_kwargs: Dict needed to load data into SIFT.

uwsift.control.qml_utils module

class uwsift.control.qml_utils.LayerModel(*args, layer_strings=None, **kwargs)[source]

Bases: QAbstractListModel

clear()[source]
data(self, index: QModelIndex, role: int = Qt.ItemDataRole.DisplayRole) Any[source]
property layer_strings
model
pyqtProperty(type, fget=None, fset=None, freset=None, fdel=None, doc=None,

designable=True, scriptable=True, stored=True, user=False, constant=False, final=False, notify=None, revision=0) -> property attribute

type is the type of the property. It is either a type object or a string that is the name of a C++ type. freset is a function for resetting an attribute to its default value. designable sets the DESIGNABLE flag (the default is True for writable properties and False otherwise). scriptable sets the SCRIPTABLE flag. stored sets the STORED flag. user sets the USER flag. constant sets the CONSTANT flag. final sets the FINAL flag. notify is the NOTIFY signal. revision is the REVISION. The other parameters are the same as those required by the standard Python property type. Properties defined using pyqtProperty behave as both Python and Qt properties. Decorators can be used to define new properties or to modify existing ones.

pop(row)[source]
push(data)[source]
rowCount(self, parent: QModelIndex = QModelIndex()) int[source]
class uwsift.control.qml_utils.QmlBackend[source]

Bases: QObject

clear_timeline()[source]
clickComboBoxAtIndex(idx)[source]

Slot triggered by the user clicking an entry in the timebase selection Combo Box. A timebase change is then triggered by emitting the didChangeTimebase signal with the corresponding index. :param idx: Timebase index of the clicked combo box item

clickConvFuncMenu(conv_func_name)[source]

Slot triggered by the user clicking an entry in the convenience function popup menu. A convenience function is then selected by its index in the popup menu and executed. The resulting data_layer_index is then emitted via the didChangeTimebase signal. :param conv_func_name: Name of the clicked convenience function as a string

clickTimelineAtIndex(idx)[source]

Slot that gets triggered if the user clicks the timeline at a position. The index corresponding to that position is passed to this slot which then forwards it via emittance of the didJumpInTimeline signal. :param idx: Timebase index of the clicked location on the UI timeline

load_timeline()[source]
refresh_timeline()[source]
class uwsift.control.qml_utils.QmlLayerManager[source]

Bases: QObject

convFuncModel
pyqtProperty(type, fget=None, fset=None, freset=None, fdel=None, doc=None,

designable=True, scriptable=True, stored=True, user=False, constant=False, final=False, notify=None, revision=0) -> property attribute

type is the type of the property. It is either a type object or a string that is the name of a C++ type. freset is a function for resetting an attribute to its default value. designable sets the DESIGNABLE flag (the default is True for writable properties and False otherwise). scriptable sets the SCRIPTABLE flag. stored sets the STORED flag. user sets the USER flag. constant sets the CONSTANT flag. final sets the FINAL flag. notify is the NOTIFY signal. revision is the REVISION. The other parameters are the same as those required by the standard Python property type. Properties defined using pyqtProperty behave as both Python and Qt properties. Decorators can be used to define new properties or to modify existing ones.

dateToDisplay
pyqtProperty(type, fget=None, fset=None, freset=None, fdel=None, doc=None,

designable=True, scriptable=True, stored=True, user=False, constant=False, final=False, notify=None, revision=0) -> property attribute

type is the type of the property. It is either a type object or a string that is the name of a C++ type. freset is a function for resetting an attribute to its default value. designable sets the DESIGNABLE flag (the default is True for writable properties and False otherwise). scriptable sets the SCRIPTABLE flag. stored sets the STORED flag. user sets the USER flag. constant sets the CONSTANT flag. final sets the FINAL flag. notify is the NOTIFY signal. revision is the REVISION. The other parameters are the same as those required by the standard Python property type. Properties defined using pyqtProperty behave as both Python and Qt properties. Decorators can be used to define new properties or to modify existing ones.

static format_product_family_key(product_family_key)[source]
get_convenience_function(function_name: str) Callable | None[source]
get_most_frequent_data_layer_index() int[source]

Get index of the data layer with the least mean difference between timestamps. :return: -1 if no data layers exist, index of most frequent data layer otherwise.

layerModel
pyqtProperty(type, fget=None, fset=None, freset=None, fdel=None, doc=None,

designable=True, scriptable=True, stored=True, user=False, constant=False, final=False, notify=None, revision=0) -> property attribute

type is the type of the property. It is either a type object or a string that is the name of a C++ type. freset is a function for resetting an attribute to its default value. designable sets the DESIGNABLE flag (the default is True for writable properties and False otherwise). scriptable sets the SCRIPTABLE flag. stored sets the STORED flag. user sets the USER flag. constant sets the CONSTANT flag. final sets the FINAL flag. notify is the NOTIFY signal. revision is the REVISION. The other parameters are the same as those required by the standard Python property type. Properties defined using pyqtProperty behave as both Python and Qt properties. Decorators can be used to define new properties or to modify existing ones.

layerToDisplay
pyqtProperty(type, fget=None, fset=None, freset=None, fdel=None, doc=None,

designable=True, scriptable=True, stored=True, user=False, constant=False, final=False, notify=None, revision=0) -> property attribute

type is the type of the property. It is either a type object or a string that is the name of a C++ type. freset is a function for resetting an attribute to its default value. designable sets the DESIGNABLE flag (the default is True for writable properties and False otherwise). scriptable sets the SCRIPTABLE flag. stored sets the STORED flag. user sets the USER flag. constant sets the CONSTANT flag. final sets the FINAL flag. notify is the NOTIFY signal. revision is the REVISION. The other parameters are the same as those required by the standard Python property type. Properties defined using pyqtProperty behave as both Python and Qt properties. Decorators can be used to define new properties or to modify existing ones.

class uwsift.control.qml_utils.TimebaseModel(*args, timestamps: None | List[QDateTime], **kwargs)[source]

Bases: QAbstractListModel

at(i)[source]
clear()[source]

Set the two corresponding properties which has to do something with the timestamps to None.

The purpose of this is to give a possibility to return to a similar state like when TimeBaseModel was initialized.

currentTimestamp
pyqtProperty(type, fget=None, fset=None, freset=None, fdel=None, doc=None,

designable=True, scriptable=True, stored=True, user=False, constant=False, final=False, notify=None, revision=0) -> property attribute

type is the type of the property. It is either a type object or a string that is the name of a C++ type. freset is a function for resetting an attribute to its default value. designable sets the DESIGNABLE flag (the default is True for writable properties and False otherwise). scriptable sets the SCRIPTABLE flag. stored sets the STORED flag. user sets the USER flag. constant sets the CONSTANT flag. final sets the FINAL flag. notify is the NOTIFY signal. revision is the REVISION. The other parameters are the same as those required by the standard Python property type. Properties defined using pyqtProperty behave as both Python and Qt properties. Decorators can be used to define new properties or to modify existing ones.

data(self, index: QModelIndex, role: int = Qt.ItemDataRole.DisplayRole) Any[source]
model
pyqtProperty(type, fget=None, fset=None, freset=None, fdel=None, doc=None,

designable=True, scriptable=True, stored=True, user=False, constant=False, final=False, notify=None, revision=0) -> property attribute

type is the type of the property. It is either a type object or a string that is the name of a C++ type. freset is a function for resetting an attribute to its default value. designable sets the DESIGNABLE flag (the default is True for writable properties and False otherwise). scriptable sets the SCRIPTABLE flag. stored sets the STORED flag. user sets the USER flag. constant sets the CONSTANT flag. final sets the FINAL flag. notify is the NOTIFY signal. revision is the REVISION. The other parameters are the same as those required by the standard Python property type. Properties defined using pyqtProperty behave as both Python and Qt properties. Decorators can be used to define new properties or to modify existing ones.

rowCount(self, parent: QModelIndex = QModelIndex()) int[source]
property timestamps

uwsift.control.time_matcher module

class uwsift.control.time_matcher.TimeMatcher(policy: Callable)[source]

Bases: object

match(timeline: List[datetime], t_sim: datetime, policy: Callable | None = None)[source]

uwsift.control.time_matcher_policies module

uwsift.control.time_matcher_policies.find_nearest(ref: List[datetime], query: datetime) datetime | None[source]
uwsift.control.time_matcher_policies.find_nearest_past(ref: List[datetime], query: datetime) datetime | None[source]

uwsift.control.time_transformer module

class uwsift.control.time_transformer.TimeTransformer(translation_policy: WrappingDrivingPolicy)[source]

Bases: object

Tick-to-Timestep Translator in concept.
  • get simulated time t_sim from driving layer/timeline
    at each tick: - check for curr. driving layer
    • get t_sim from driving layer

  • sends t_sim to DisplayManager

change_timebase(layer)[source]
create_formatted_time_stamp(fmt='%Y-%m-%d %H:%M:%S')[source]
jump(index)[source]
step(backwards=False)[source]
update_current_timebase()[source]

Update timebase parameters to pick up according changes from the time translation policy.

Implementation details: This method is only public to be callable from TimeManager, no other use intended.

uwsift.control.time_transformer_policies module

class uwsift.control.time_transformer_policies.WrappingDrivingPolicy(layers: List[LayerItem])[source]

Bases: QObject

Time translation policy that when called returns a simulated data time by taking a timestamp from a designated data layer (the driving layer). Each successive call will return the driving layer’s next timestamp. If there are no more timestamps in the driving layer it starts over from the first timestamp.

change_timebase(layer)[source]
compute_t_sim(tick_time: int, backwards: bool = False) datetime | None[source]

Returns timestamp t_sim by:

  1. backwards set to False and index is None: incrementing the index of the current driving layer and returning the timestamp of the driving layer timeline at the index location

  2. backwards set to True and index is None: decrementing the index of the current driving layer…(see 1)

  3. backwards set to False but providing setting the index kwarg to a valid integer: looking up the driving layer’s timestamp at the provided index location

In case the timeline is empty (None or empty list) return the current time (in UTC).

curr_t_sim()[source]
curr_timeline_index()[source]
property driving_layer
jump_to_t_sim(index: int) datetime[source]

Returns t_sim by looking up the driving layer’s timestamp at the provided index location.

Raises an exception if being called with an invalid index.

Parameters:

index – integer location in the timeline to jump to.

Returns:

datetime object located at the provided index.

on_layers_update()[source]

Slot connected to LayerModel’s ‘didUpdateLayers’ signal. Takes the first loaded layer, of a suitable kind, if the old driving layer is not in LayerModel’s layers anymore.

property timeline
property timeline_length

Module contents