|
Dispense
Navigation
Tips - Dritte
PmWiki
pmwiki.org
edit SideBar
|
Index
Back to Mujpy
Debug
12/05/26 trying to run python scripts and jupyter-lab in parallel (use gedit or gvim, not text editor!)
- PARTIALLY SOLVED clarify syntax for json input file names: model. group, version (done with tools version_flag, CHECK THROUGH MODES)
- DONE cvs in each fitting mode (A1, etc.) should have its distinct csv
- DONE added offset to log terminal and cache
- DONE simplified write_csv using init_csv_row and prepare_csv_row in summary
- still chi three digits B1 skips one field before chi_r
- DONE test.py script including all DONE cases below
- DONE A1, A20, A1_calib, A20_calib, A21,A21_calib, B1
- C2 in progress,
- "=" in model now restricted to userpars
- to point to a '#' parameter
int2_multirun_multigroup_method_key must translate internal index n in function "p[n]" into new minuit index for each run
- B2
- C1
Schedule
- alpha can be a global parameter, e.g. in C1_calib (C2_calib) and that is not accounted for yet!
- first use test python scripts to refine strategy for A21, B2, C1, C1_calib, C2 fits, only after that develop mudash
Global logs
- A21 is single run, global over groups. It is a test for B2. Produces a log, no, adds onto a csv , may be plotted vs run, T, B.
- B21 (could be called B2) is global over groups, sequential over runs. Plot sequential parameters vs. run, T or B
- C1 is global over run, single group
- C2 is global over run and group. Both plot local parameters vs. run, T or B
- C2_calib almgml fit in TF at GPS
- flag ~,!,=,g,G,& for local, fixed, function, global group, global run, global all
- do first the B1_calib multirun sequential singlegroup fit for the two groups, 3-4 and 2-1
- then do the B21_calib multirun sequential multigroup global fit, with global {$B_0, B_1, \sigma, \lambda$}
- plot the G and & parameters from the almgml.1_B21.csv run ({$\alpha_i,A_{0i}, A_{1i}$}) or run-group global ({$\phi,(\phi+90)$})
- initialize C2_calib g values ({$B_{0x}, B_{1x} \sigma_x, \lambda_x$}) that have run-local values, from the B21 csv
- dash
set_key
def sk(string):
code = """
from numpy import pi
def foo():
string = " key = eval('"+'lambda p: '+string+"')"
code = code + string + """
return key
"""
exec(code,globals(),globals())
return (eval('foo()')
Execution
p = [10,11,12,13]
key = sk('p[2]')
# to obtain the result, 12
key(p)
C2_calib Eventually all fits could be dealt like this. For instance A1 data would become [asymm, asyme?], userpars would be present, but empty, group would contain only one, etc.
- e.g. groups 34, 12, TF mgml fit on runs 822, 834:823:-1 (13 runs). The fit has 13*3+6 = 45 parameters
- 6 userpars [0:5]: 0-{$\alpha$}34, 1-{$\alpha$}21, 2-f, 3-A34, 4-A21, 5-{$\phi$}
- guess almgml: the dash presents parameter (internal) indices: 6-α, 7-A0, 8-B0, 9-φ0, 10-σ0, 11-A1, 12-B1, 13-φ1, 14-λ1
- "=" "function multi": 6-α ['p[0]','p[1]'], 7-A0 ['p[2]*p[3]','p[2]*p[4]'], 9-φ0 ['p[5]','p[5]-90'], 11-A1 ['(1-p[2])*p[3]','(1-p[2])*p[4]'],13-φ1 ['p[5]','p[5]-90']
- "#" (local): 8-B0, 10-σ0, 14-λ1, run replicas see below, , all get renumbered with 834, 833 etc
- "=" "function": 12-B1 ["p[7]"] (which is redirected to run replicas)
- "=": "error-propagate-multi": 7-A0 ["sqrt((e[2]*p[3])**2+(p[2]*e[3])**2)","sqrt2(e[2]*p[4])**2+(p[2]*e[4])**2)"] simil for 11-A1
- "=": "error-propagate-multi": 9-φ0 ["e[5]","e[5]"] same for 13-φ1
- int2_multirun_multigroup_global replicates local parameters, B0, σ0, λ1 over runs, the same for all groups, attaching a label eg _822 to distinguish them (musrfit style).
- not a great fit across paramagnetic through ordered ranges, but it should converge
- helps to run fit type B1 (multirun sequential) first and extract local parameter values, B, {$\sigma$}, {$\lambda$} as guess. Could be automatized.
- e.g. ZF spin rotated mgmgbl on 34,21
- 5 userpars [0:4]: {$\alpha$}34, {$\alpha$}21, f, A34, A21. The fit has 13*3+5 = 41 parameters
- guess almgmgbl: the dash presents parameter indices: 5-A0, 6-B0, 7-φ0, 8-σ0, 9-A1, 10-B1, 11-φ1, 12-σ1, 13-Al, 14-λ
- "=" "function multi": α ['p[0]','p[1]'], A0 ['2/3*p[2]*p[3]','2/3*p[2]*p[4]'], A1 ['2/3*(1-p[2])*p[3]','2/3*(1-p[2])*p[4]'], Al ['p[3]/3','p[4]/3']
- "!": φ0 "value": 0. "flag": "!", φ1 "value": 0. "flag": "!"
- "#" (local): B0_822 (run replicas, same on both group)
- σ0_822 (run replicas, same on both group)
- B1_822 (run replicas, same on both group)
- σ1_822 (run replicas, same on both group)
- λ_822, (run replicas, same on both group), all get renumbered with 834, 833 etc
- val,err, fix, lim, name, pospar = int2min_xxx(pardicts) # or (dashboard,runs)
- must produce a single list of min indices-parameters, in the almgml example above 0-44:
- 0-α34, 1-α21, 2-f, 3-A34, 4-A21, 5-φ, 6-B0_822, 7-σ_822, 8-λ_822, 9-B0_834, 10-σ_834, 11-λ_834, ... 41-B0_823, 43-σ_823, 44-λ_823
- with values 0-5 from userpardicts, values 6-44 from a B2 prefit.
- construct the B2 prefit, chain, with all "#" parameters transformed in "~", in the example 6-B, 7-σ, 8-λ become userpars, the model internal index are renumbered 9-α, 10-A0, 11-B0 "flag" "=" "function" ["p[6]"], 12-φ0 13-σ0 "flag" "=" "function" ["p[7]"], 14-A1, 15-B1, 16-φ1 17-λ1 "flag" "=" "function" ["p[8]"]
- run it and distribute the last three userpar best values in the sequential fit to guess values of corresponding "#" parameters
Back to Mujpy
Index
|