TriangularShapedCloudInterpolation.jl

Author LudwigBoess
Popularity
0 Stars
Updated Last
1 Year Ago
Started In
July 2020
Documentation Build Status Licence
Build Status codecov.io The MIT License

TriangularShapedCloudInterpolation.jl

This packages is a port of the IDL script TSC.pro by Joop Schaye from Feb 1999.

Interpolation positions

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.

TSC interpolation

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)

Used By Packages

No packages found.