cosima-cookbook icon indicating copy to clipboard operation
cosima-cookbook copied to clipboard

Add get_ranges query function

Open angus-g opened this issue 10 months ago • 0 comments

This function returns a DataFrame containing the distinct ranges of contiguous data. For example,

>>> cc.querying.get_ranges(session, "01deg_jra55v13_ryf9091", "u", "1 daily")
                 start                  end
0  1950-01-01 00:00:00  1950-02-01 00:00:00
1  1950-02-01 00:00:00  1971-01-01 00:00:00
2  2086-01-01 00:00:00  2100-10-01 00:00:00
3  2100-10-01 00:00:00  2101-01-01 00:00:00
4  2170-01-01 00:00:00  2180-01-01 00:00:00

Curiously, this example does highlight an inconsistency in the data for this experiment, but it does show the gaps where no daily velocity data is available.

Probably not quite ready (and definitely needs some tests!), but I thought I'd get this out there while it's fresh on my mind.

angus-g avatar Apr 22 '24 03:04 angus-g