combine

Dataset.combine(my_data, other_obj, other_data=None, other_args=None, trans=None, timetol=numpy.timedelta64(1, 's'), time_name='time')[source]

Combine with data from other dataset.

Combine a set of measurements from this dataset with another dataset, where each individual measurement correspond to exactly one from the other one, as identified by time/lat/lon, orbitid, or measurument id, or other characteristics. The object attribute unique_fields determines how those are found.

The other dataset may contain flags, DMPs, or different information altogether.

Parameters:
  • my_data (ndarray) – Data for self. A (masked) array with a dtype such as returned from self.read <Dataset.read>.

  • other_obj (Dataset) – Dataset to match Object from a Dataset subclass from which to find matching data.

  • other_data (ndarray) – Data for other. Optional. Optionally, pass data for other object. If not provided or None, this will be read using other_obj.

  • other_args (dict) – Keyword arguments passed to other_obj.read_period. May need to contain things like {“locator_args”: {“satname”: “noaa18”}}

  • trans (collections.OrderedDict) – Dictionary of what field in my_data corresponds to what field in other_data. Optional; by default, merges self.unique_fields and other_obj.unique_fields, and assumes names between the two are identical. Order is relevant for optimal recursive bisection search for matches, which is to be implemented.

  • timetol (timedelta64) – For datetime types, isclose does not work (https://github.com/numpy/numpy/issues/5610). User must pass an explicit tolerance, defaulting to 1 second.

  • time_name (str) – Name for my time field. Defaults to “time”. Used to determine the period to read from the other dataset.

Returns:

Masked ndarray of same size as my_data and same dtype as returned by other_obj.read.

TODO: Allow user to pass already-read data from other dataset.