Skip to content

Commit

Permalink
update stepping for numdifftools
Browse files Browse the repository at this point in the history
rvs_warn if logg is on the edge
  • Loading branch information
segasai committed Nov 16, 2024
1 parent 69c827a commit da39b7d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
6 changes: 5 additions & 1 deletion py/rvspecfit/desi/desi_fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,9 @@ def get_rvs_warn(fit_res, outdict, config):
teff_thresh = 10
teff_edges = [2300, 15000]

logg_thresh = 0.01
logg_edges = [-.5, 6.5]

# if we are within this threshold of the RV boundary we set another
# warning
rvedge_thresh = 5
Expand Down Expand Up @@ -393,7 +396,8 @@ def get_rvs_warn(fit_res, outdict, config):
# Here we check if the parameter is within the threshold of the edge or
# beyond the edge.
parameter_limits = [['teff', teff_edges, teff_thresh],
['feh', feh_edges, feh_thresh]]
['feh', feh_edges, feh_thresh],
['logg', logg_edges, logg_thresh]]
for cur_param, cur_edges, cur_thresh in parameter_limits:
if _bad_edge_check(fit_res['param'][cur_param], cur_edges, cur_thresh):
rvs_warn |= bitmasks['PARAM_WARN']
Expand Down
14 changes: 7 additions & 7 deletions py/rvspecfit/vel_fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,14 +626,14 @@ def hess_func_wrap(p):
return hess_func(p, best_param_TMP, args)

hess_step = [{
'vsini': 1,
'logg': 0.1,
'feh': 0.1,
'alpha': .01,
'teff': 10,
'vrad': 1,
'vsini': 1 / 100,
'logg': 0.1 / 100,
'feh': 0.1 / 100,
'alpha': .01 / 100,
'teff': 1 / 100,
'vrad': 1 / 100,
}[_] for _ in specParamNames]
hess_step = ndf.MaxStepGenerator(base_step=hess_step)
hess_step = ndf.MinStepGenerator(base_step=hess_step)
hessian = ndf.Hessian(hess_func_wrap, step=hess_step)(
[ret['param'][_] for _ in specParamNames])
diag_err, covar_mat = _uncertainties_from_hessian(hessian)
Expand Down

0 comments on commit da39b7d

Please sign in to comment.