Skip to content

Add an implementation of time method = "nearest" that finds the files that are closest in time. #43

@eeholmes

Description

@eeholmes

Task: Implement finding nearest time if a xarray Dataset has time dim and multiple time points. If there is time dim in xarray dataset but only 1 time, then matching to nearest time is not necessary (skip).

Here is a sample netcdf with 366 days for testing
https://github.com/fish-pace/point-collocation/tree/main/examples/fixtures/multi_time.nc

Here is a notebook that shows some sample points and finding nearest lat/lon/time
https://github.com/fish-pace/point-collocation/blob/main/examples/multi_time.ipynb

Background: In some cases, a granule will have multiple times. For example, a yearly granule with 12 months or 365 days. A lat/lon/time will match to that granule, but the time needs to be matched to nearest time.

Notes:

  • time should always be 1D. but might not be uniform.
  • although unusual, it is possible that 2D lat/lon would have multiple times.
  • if there is only 1 time, then matching to nearest time is not necessary
  • cf_xarray should be used to find the time dim, and a reasonable fallback used.
  • report time dim with geolocation in open_dataset() and anywhere else that geolocation is reported. Do not report time dim if the granules do not have a time dim

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions