Documentation | Build Status | Licence |
---|---|---|
This packages is a port of the IDL script TSC.pro
by Joop Schaye from Feb 1999.
To get an array of positions you can use for TSC interpolation you can use the helper function get_tsc_positions
:
pos_tsc = get_tsc_positions(pos::Array{<:Real}, res_elements::Array{<:Integer})
Here pos
is an Array of positions with pos[N_entries, N_dimensions]
and res_elements[N_dimensions]
is the number of resolution elements you want to interpolate the data with in each dimension.
You can also just provide a single integer if you want the resolution elements in all dimensions to be the same and multiple dipatch takes care of the rest.
To interpolate the data (e.g. density) you need to use TSCInterpolation
like so:
pos = rand(3, 1_000)
density = rand(1_000)
res_elements = [20, 20, 20]
pos_tsc = get_tsc_positions(pos, res_elements)
rho_interp = TSCInterpolation( rho, pos_tsc, res_elements,
average=true)