-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Point to profile data #30
Comments
Potential hack solution to create a dictionary using groupby on the dives. Might be slow though. Also, does not provide one with any functions that can be applied to each dive import glidertools as gt
vars = ['temperature']
name = 'Git/GliderTools/tests/data/p54203*.nc'
dim = 'sg_data_point'
xds = gt.load.seaglider_basestation_netCDFs(name, vars)[dim]
grp = xds.groupby('dives')
out = {}
for k, i in grp.groups.items():
out[k] = xds.isel(**{dim: i}).sortby('ctd_depth') |
Hi, I am aware that this is an old issue - but I fought with it to an came up with some good solutions :). An easy and fast way to convert the point-data to profile-data is the groupby function as @lukegre mentioned. Once the data is grouped into profiles, any function can be applied with the pandas/xarray
I also have a considerable speed increase if my ds-object is a edit: I just created a pull request for the computation of mixed layer depth (#169). It should be easy to adapt for e.g. profile means, BVF or other per-profile computations. :) |
This was addressed in PR #175, have a look at the new version. |
Is your feature request related to a problem? Please describe.
It would be great to able to convert the data from point to profile type. Currently, the data is saved as a long series of variables. It is quite natural instead to sometimes refer to data in terms of dive numbers.
This can also help resolve the issue that we currently always look at the down casts in order of increasing Z and upcasts in decreasing Z, which can create visual artifacts in scatter plots.
Describe the solution you'd like
The simplest solution would be to adopt the points-profiles style that argopy is using in https://argopy.readthedocs.io/en/latest/_modules/argopy/xarray.html#ArgoAccessor.point2profile
Maybe we don't need to have data types, but a simpler (maybe more hacky) solution would be great for an initial solution.
The text was updated successfully, but these errors were encountered: