Skip to content

Commit 4a9bf5d

Browse files
get models of interest dynamically
1 parent e1dfc91 commit 4a9bf5d

2 files changed

Lines changed: 16 additions & 99 deletions

File tree

generate_database.jl

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ using LRUCache
1010

1111

1212
include("utils.jl")
13-
include("tables.jl")
13+
const FMODEL_MAX_L = Dict(:Sr87 => 3, :Sr88 => 3, :Yb171 => 4, :Yb173 => 1, :Yb174 => 4)
14+
1415
version = "v1.1"
1516

1617
function parse_commandline()
@@ -82,10 +83,18 @@ function main()
8283
else
8384
CGcoefficient.wigner_init_float(n_max - 1, "Jmax", 9)
8485
end
85-
parameters = PARA_TABLE[species]
86+
87+
species_module = getfield(MQDT, species)
88+
parameters = getfield(species_module, :PARA)
89+
models = Vector{MQDT.fModel}()
90+
for obj_name in names(species_module, all = true)
91+
obj = getfield(species_module, obj_name)
92+
if isa(obj, MQDT.fModel)
93+
push!(models, obj)
94+
end
95+
end
8696

8797
@info "Calculating low ℓ MQDT states..."
88-
models = MODELS_TABLE[species]
8998
states = Vector{EigenStates}(undef, length(models))
9099
for (i, M) in enumerate(models)
91100
nu_min, nu_max = MQDT.get_nu_limits_from_model(M)
@@ -95,7 +104,7 @@ function main()
95104
nu_max = min(nu_max, n_max)
96105
end
97106
@info "$(M.name): nu_min=$nu_min nu_max=$nu_max"
98-
states[i] = eigenstates(nu_min, nu_max, M, parameters)
107+
states[i] = MQDT.eigenstates(nu_min, nu_max, M, parameters)
99108
end
100109

101110
if args["skip-high-l"]
@@ -104,14 +113,14 @@ function main()
104113
@info "Calculating high ℓ SQDT states..."
105114
l_max = n_max - 1
106115
l_start = FMODEL_MAX_L[species] + 1
107-
high_l_models = single_channel_models(species, l_start:l_max)
116+
high_l_models = MQDT.single_channel_models(species, l_start:l_max)
108117
@timelog high_l_states =
109-
[eigenstates(n_min_high_l, n_max, M, parameters) for M in high_l_models]
118+
[MQDT.eigenstates(n_min_high_l, n_max, M, parameters) for M in high_l_models]
110119
states = vcat(states, high_l_states)
111120
models = vcat(models, high_l_models)
112121
end
113122

114-
basis = basisarray(states, models)
123+
basis = MQDT.basisarray(states, models)
115124
@info "Generated state table with $(length(basis.states)) states"
116125

117126
@info "Converting states to database table..."

tables.jl

Lines changed: 0 additions & 92 deletions
This file was deleted.

0 commit comments

Comments
 (0)