Skip to content
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

Gradient calculation and test #62

Merged
merged 1 commit into from
Apr 26, 2016
Merged

Gradient calculation and test #62

merged 1 commit into from
Apr 26, 2016

Conversation

Jacketless
Copy link
Contributor

Functionality for field-level gradient calculation, including variable sample distances longitudinally by latitude, was required. This PR now allows users to call a Field object function returning new gradient fields in X and Y for the whole field, or a defined subset in space and/or time.

Added .gradient function to Field objects, using central
differencing and forward/backward differencing at edges.

Created test that creates small grid and compares internal Field
object gradient calculation to Numpy’s gradient function that cannot
use unequal sample distances.

Added `.gradient` function to `Field` objects, using central
differencing and forward/backward differencing at edges.

Created test that creates small grid and compares internal `Field`
object gradient calculation to Numpy’s gradient function that cannot
use unequal sample distances.
@mlange05
Copy link

Ok, as a first step towards advanced field numerics this is really great. In the future we might want to extend this further to do on-the-fly gradient calculations within kernels, and we might also want to start thinking about how to generalise this for "all grid types", but this provides a really neat first-level test for further development. Thanks a lot @Jacketless ! IMHO this can go in as is.

@erikvansebille erikvansebille merged commit b853c52 into master Apr 26, 2016
@erikvansebille erikvansebille deleted the field-gradient branch April 26, 2016 12:20
@Jacketless Jacketless mentioned this pull request May 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants