icenet package

Subpackages

Submodules

icenet.utils module

class icenet.utils.Hemisphere(value)[source]

Bases: Flag

Representation of hemispheres & both with bitwise operations.

An enum.Flag derived class representing the different hemispheres

(north, south, or both), providing methods to check which hemisphere is selected via bitwise operations:

& (AND), | (OR), ^ (XOR), and ~ (INVERT)

BOTH = 3
NONE = 0
NORTH = 1
SOUTH = 2
class icenet.utils.HemisphereMixin[source]

Bases: object

A mixin relating to Hemisphere checking.

_hemisphere

Represents the bitmask value of the hemisphere. Defaults to Hemisphere.NONE (i.e., 0).

Type:

int

property both: int

The bitmask value representing both hemispheres.

property hemisphere: int

The bitmask value representing the hemisphere.

property hemisphere_loc: list

Get a list of latitude and longitude extent representing the hemisphere’s location.

property hemisphere_str: list

A list of strings representing the selected hemispheres.

property north: bool

A flag indicating if _hemisphere is north. True if the hemisphere is north, False otherwise.

property south: bool

A flag indicating if _hemisphere is south. True if the hemisphere is south, False otherwise.

icenet.utils.run_command(command: str, dry: bool = False) object[source]

Run a shell command

A wrapper in case we want some additional handling to go in here

Parameters:
  • command – Command to run in shell.

  • dry (optional) – Whether to do a dry run or to run actual command. Default is False.

Returns:

subprocess.CompletedProcess return of the executed command.

icenet.utils.setup_logging(func, log_format='[%(asctime)-17s :%(levelname)-8s] - %(message)s')[source]

Module contents

Top-level package for IceNet.