Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
DurhamDecLab committed Feb 13, 2019
1 parent 28cbe8e commit 04076d7
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
#ARBTools
Tricubic spline interpolation for vector and scalar fields

ARBInterp
ARBTools
=======

Introduction
------------

Python tools for tricubic interpolation of 3D gridded data, based on the scheme by Lekien and Marsden: https://onlinelibrary.wiley.com/doi/epdf/10.1002/nme.1296

Takes either a scalar field U as an N x 4 (x,y,z,U) array or a vector field B as an N x 6 (x, y, z, Bx, By, Bz) array.

Scalar: returns magnitude and gradient.
Vector: returns components, OR magnitude and gradient of vector norm, OR both.
Takes in gridded data from comma-separated input file, either a scalar field U as an N x 4 (x,y,z,U) array or a vector field B as an N x 6 (x, y, z, Bx, By, Bz) array.

Package Dependencies
--------------------
Expand All @@ -23,33 +17,31 @@ Usage

Instantiate the 'tricubic' class by passing a loaded field to it. It is not necessary to order the x, y, z coordinates - the code will do that itself.

The interpolant field does not have to be cubic, only cuboid. If an N x 4 array is passed it will operate in scalar mode and return both the interpolated field magnitude and partial derivatives.
NOTE: as of version 1.0, a regular field (i.e. with equal grid spacing in all dimensions) must be supplied. A future release will handle irregular grids, but performance will still be best with regular grids. The interpolant field does not have to be cubic, only cuboid.

If an N x 4 array is passed it will operate in scalar mode and return both the interpolated field magnitude and partial derivatives.

If an N x 6 array is passed it will accept an optional kword argument 'mode' with one of the following switches:

'norm' - this takes the norm of the vector field as the interpolant. Magnitude and gradient returned.

'vector' - interpolates the x, y and z field components separately and returns them together.

'both' - returns the interpolated magnitude and gradients of the norm of the field, AND the vector components.

If no argument is passed it will default to 'vector'. If a 'mode' kword is passed but an N x 4 array is detected, the kword will be ignored.

There are two methods for querying the interpolant field:

sInterp - takes a single Cartesian coordinate.

rInterp - takes a range of Cartesian coordinates as an array. The first 3 columns are assumed to be the x,y,z coordinates. Further columns can be present e.g. velocity components - these are ignored.

Included Files
--------------

ARBInterp.py - contains tricubic class and methods for querying interpolant field.

ARBExample.py - loads an example field and queries it with sample coordinates.

ARBInterpExample.py - loads an example field and queries it with sample coordinates.
ExampleVectorField.csv - part of a magnetic field, as vector components.

ExampleScalarField.csv - the same field as ExampleVectorField, but the norm / magnitude.

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.2548609.svg)](https://doi.org/10.5281/zenodo.2548609)
ARBTrajec.py - contains function for creating random atom samples, and tracking their motion through a magnetic field with the interpolator
ARBTrajecExample.py - creates test sample, saves it, iterates it through test field, saves output
ExampleTrapField.csv - an example of a magnetic trap field

0 comments on commit 04076d7

Please sign in to comment.