virtualargofleet.utilities.simu2index#

simu2index(ds: Dataset, N: int = 1)[source]#

Convert a trajectory simulation xarray.Dataset to an Argo index of profiles

Profiles are identified using the cycle_number dataset variable. A profile is identified if the last observation of a cycle_number sequence is in cycle_phase 3 or 4.

This function remains compatible with older versions of trajectory netcdf files without the cycle_number variable. In this case, a profile is identified if the last observation of a cycle_phase==3 sequence is separated by N days from the next sequence.

Parameters:
  • ds (xarray.Dataset) – The simulation trajectories dataset

  • N (int, optional) – The minimal time lag between cycle_phase sequences to be identified as a new profile. This will be removed in the future when we’ll drop support for old netcdf outputs.

Returns:

df – The profiles index

Return type:

pandas.DataFrame