earth2studio.data.fetch_data#

earth2studio.data.fetch_data(source, time, variable, lead_time=array([0], dtype='timedelta64[h]'), device='cpu')[source]#

Utility function to fetch data for models and load data on the target device.

Parameters:
  • source (DataSource) – The data source to fetch from

  • time (TimeArray) – Timestamps to return data for (UTC).

  • variable (VariableArray) – Strings or list of strings that refer to variables to return

  • lead_time (LeadTimeArray, optional) – Lead times to fetch for each provided time, by default np.array(np.timedelta64(0, “h”))

  • device (torch.device, optional) – Torch devive to load data tensor to, by default “cpu”

Returns:

Tuple containing output tensor and coordinate OrderedDict

Return type:

tuple[torch.Tensor, CoordSystem]

Examples using earth2studio.data.fetch_data#

Statistical Inference

Statistical Inference