Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
kcarloni committed Dec 26, 2023
1 parent 60fb63a commit 2040e3a
Showing 1 changed file with 35 additions and 9 deletions.
44 changes: 35 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,48 @@ julia> using PhotosplineReader.FITSIO

julia> fpath = "PhotosplineReader.jl/test/examples/IceCube_data_release_202209013_kdes/E_dec_photospline_v006_3D.fits";

julia> spt = FITS(fpath) do f
SplineTable(f)
end
julia> spt = SplineTable( fpath )
3-dimensional SplineTable of b-spline orders [1, 1, 3],
with extents:
(0.83, 10.21)
(-0.17, 1.00)
(0.57, 4.42)

with extents:
(0.83, 10.21)
(-0.17, 1.00)
(0.57, 4.42)

julia> x = [ 2.8, 0.2, 3.0 ]
3-element Vector{Float64}:
2.8
0.2
3.0

julia> evaluate_simple( x, spt )
julia> spt(x)
0.7973871961087491

julia> spt(x...)
0.7973871961087491
```

## Interfacing with Interpolations.jl
```julia
julia> using Interpolations

julia> spt = SplineTable( fpath )
3-dimensional SplineTable of b-spline orders [1, 1, 3],
with extents:
(0.83, 10.21)
(-0.17, 1.00)
(0.57, 4.42)

julia> itp = spline_interpolation( spt );

julia> typeof( itp )
Interpolations.FilledExtrapolation{Float64, 3, ScaledInterpolation{Float32, 3, Interpolations.BSplineInterpolation{Float32, 3, Array{Float32, 3}, Tuple{BSpline{Linear{Throw{OnGrid}}}, BSpline{Linear{Throw{OnGrid}}}, BSpline{Cubic{Line{OnGrid}}}}, Tuple{Base.Slice{UnitRange{Int64}}, Base.Slice{UnitRange{Int64}}, Base.Slice{UnitRange{Int64}}}}, Tuple{BSpline{Linear{Throw{OnGrid}}}, BSpline{Linear{Throw{OnGrid}}}, BSpline{Cubic{Line{OnGrid}}}}, Tuple{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}}}, Tuple{BSpline{Linear{Throw{OnGrid}}}, BSpline{Linear{Throw{OnGrid}}}, BSpline{Cubic{Line{OnGrid}}}}, Float64}

julia> itp( x... )
0.7973871961087493

julia> Interpolations.gradient( itp, x... )
3-element StaticArraysCore.SVector{3, Float64} with indices SOneTo(3):
-1.0382749146578347
-0.4631499529505209
0.08274258979323065
```

0 comments on commit 2040e3a

Please sign in to comment.