Skip to content
Discussion options

You must be logged in to vote

Oh I see,

You could almost do what you describe with Numpy with Xdas BUT if you try it you will have some trouble with the space coordinates as da[:, gauge_samples:] and data[:, :-gauge_samples] will not have the same space coordinate anymore. For now Xdas raises an Error when you try to do arithmetic with data arrays with different coordinates because it is not clear how to handle coordinates in that case.

Bellow a function that does what you want for any dimension you want :

import xdas

def differentiate(da, span=1, method="forward", dim="last"):
    d = xdas.get_sampling_interval(da, dim)
    before = da.isel({dim:slice(None, -span)})
    after = da.isel({dim:slice(span, None)})
    data

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@ianis-g
Comment options

Comment options

You must be logged in to vote
4 replies
@atrabattoni
Comment options

@ianis-g
Comment options

@atrabattoni
Comment options

@ianis-g
Comment options

Answer selected by atrabattoni
Comment options

You must be logged in to vote
1 reply
@ianis-g
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants