Skip to content

Commit

Permalink
Add guard for frequency scale
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-petersen committed Jun 19, 2024
1 parent 13fca59 commit d70b7a9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Utils/ParameterStructure.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ TODO:
"""

struct LinearParameters
mutable struct LinearParameters

# Orbital Elements parameters
Orbitalparams::OrbitalElements.OrbitalParameters
Expand Down
11 changes: 11 additions & 0 deletions src/Xi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,17 @@ function RunLinearResponse(model::OrbitalElements.Potential,
FHT::FiniteHilbertTransform.AbstractFHT,
basis::AstroBasis.AbstractAstroBasis,
params::LinearParameters)

# Check model against provided parameters
#OrbitalElements.frequency_scale(model)

# Check if frequency scale is set by the model already
Ω₀tmp = frequency_scale(model)

if Ω₀tmp != params.Ω₀
params.Ω₀ = Ω₀tmp
println("Overriding Ω₀ with model-set value.")
end

# call the function to construct W matrices
RunWmat(model,FHT,basis,params)
Expand Down
3 changes: 2 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ OEparams = OrbitalElements.OrbitalParameters(EDGE=OrbitalElements.DEFAULT_EDGE,T
ITERMAX=OrbitalElements.DEFAULT_ITERMAX,invε=OrbitalElements.DEFAULT_TOL)


Parameters = LinearResponse.LinearParameters(basis,Orbitalparams=OEparams,Ω₀=OrbitalElements.frequency_scale(model),Ku=Ku,Kv=Kv,Kw=Kw,
#Parameters = LinearResponse.LinearParameters(basis,Orbitalparams=OEparams,Ω₀=OrbitalElements.frequency_scale(model),Ku=Ku,Kv=Kv,Kw=Kw,
Parameters = LinearResponse.LinearParameters(basis,Orbitalparams=OEparams,Ω₀=15.,Ku=Ku,Kv=Kv,Kw=Kw,
modelname=modelname,dfname=dfname,
wmatdir=wmatdir,gfuncdir=gfuncdir,modedir=modedir,axidir=modedir,
lharmonic=lharmonic,n1max=n1max,
Expand Down

0 comments on commit d70b7a9

Please sign in to comment.