diff --git a/scenes/dates.py b/scenes/dates.py index 22cdf07e93ba5957638ab740f0d45fff765ea18b..7c63b28c77791d17b839d90198906b69d2602ab7 100644 --- a/scenes/dates.py +++ b/scenes/dates.py @@ -1,6 +1,34 @@ # -*- coding: utf-8 -*- """ -This module aims to deal with dates +This module aims to deal with dates. + +--- + +The `datetime.datetime` class is used as internal date type. +``` +#!python +dt = datetime.datetime(year=2020, month=12, day=2) +``` +Is equivalent to: +``` +dt = str2datetime("02-12-2020") +dt = str2datetime("2020-12-02") +dt = str2datetime("02/12/2020") +``` + +The `any2datetime` method returns a `datetime.datetime` instance, whatever the input is (`str` or +`datetime.datetime`). +``` +dt1 = datetime.datetime(year=2020, month=12, day=2) +dt2 = str2datetime("02-12-2020") +dt1_2 = any2datetime(dt1) # same +dt2_2 = any2datetime("02-12-2020") # same +``` + +The `get_timestamp` method converts a `datetime.datetime` instance into a number of seconds (int). +``` +ts = get_timestamp(dt) # 1606780800.0 +``` """ import datetime diff --git a/scenes/spot.py b/scenes/spot.py index a44c40337736088e46c2c233abd1031debb51865..9765172a89ef00087df0380948e235c4042e5676 100644 --- a/scenes/spot.py +++ b/scenes/spot.py @@ -185,6 +185,7 @@ class Spot67Imagery(Imagery): Spot 6/7 imagery class. A `Spot67Imagery` instance carries the following `Spot67Source` instances: + - xs: the multispectral channels (Red, Gree, Blue, Near infrared @ 6.0 meters spacing) - pan: the panchromatic channel (Visible domain @ 1.5 meters spacing) - pxs: the pansharpened channels (Red, Gree, Blue, Near infrared @ 1.5 meters spacing)