Browse Source

ContributionsPlot: cummulating SatelliteTarget misfits

priors
miili 2 years ago
parent
commit
016cc6b983
3 changed files with 32 additions and 13 deletions
  1. +6
    -1
      CHANGELOG.md
  2. +10
    -1
      src/apps/grond.py
  3. +16
    -11
      src/optimisers/plot.py

+ 6
- 1
CHANGELOG.md View File

@ -8,7 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- The optimiser's acceptance and choice history is now dumped and plotted.
- Plots appearing in report can now be customized in a configuration file.
- Cluster analysis on result ensemble with `grond cluster`.
- Plotting of cluster analysis results in `jointpar`, `mt_decompostion`, and
- Plotting of cluster analysis results in `jointpar`, `mt_decompostion`, and
`mt_fuzzy` plots.
- Whether reference solutions are shown in plots can be configured in the
report's plot config.
@ -17,3 +17,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Grond reports can now be viewed in IE.
- User can now add self-defined labels to a run dir (`grond tag`). The labels
are shown in the report list.
- Parallelized 'grond report'
- Improved `location_mt` plot
- Improved Plot short descriptions `grond plot list`
- Contributions Plot: cummulating nmisfits for `ScatteredTargets` (e.g. `SatelliteMisfitTarget`)
- `ProblemConfig` added `nthreads` argument

+ 10
- 1
src/apps/grond.py View File

@ -748,6 +748,14 @@ def command_plot(args):
from grond import plot
if args[0] == 'list':
def get_doc_title(doc):
for ln in doc.split('\n'):
ln = ln.strip()
if ln != '':
return ln
return 'Undocumented.'
if env:
plot_classes = env.get_plot_classes()
else:
@ -755,7 +763,8 @@ def command_plot(args):
plot_names, plot_doc = zip(*[(pc.name, pc.__doc__)
for pc in plot_classes])
plot_descs = [doc.split('\n')[0].strip() for doc in plot_doc]
plot_descs = [get_doc_title(doc) for doc in plot_doc]
left_spaces = max([len(pn) for pn in plot_names])
for name, desc in zip(plot_names, plot_descs):


+ 16
- 11
src/optimisers/plot.py View File

@ -241,8 +241,7 @@ corresponding misfit values.
class ContributionsPlot(PlotConfig):
'''
Relative contribution of single targets to the global misfit
''' Relative contribution of single targets to the global misfit
'''
name = 'contributions'
@ -306,8 +305,20 @@ modified.
history.misfits, get_contributions=True)
gcms = gcms[isort, :]
nmisfits = gcms.shape[1]
target_idx = num.empty(nmisfits, dtype=num.int)
cum_gcms = num.empty((history.nmodels, problem.ntargets))
plot_targets = []
idx = 0
for itarget, target in enumerate(problem.targets):
cum_gcms[:, itarget] = gcms[:, idx:idx+target.nmisfits].sum(axis=1)
target_idx[idx:idx+target.nmisfits] = itarget
idx += target.nmisfits
plot_targets.append(target)
jsort = num.argsort(gcms[-1, :])[::-1]
jsort = num.argsort(cum_gcms[-1, :])[::-1]
# ncols = 4
# nrows = ((problem.ntargets + 1) - 1) / ncols + 1
@ -344,15 +355,9 @@ modified.
a = [1]
ii = 0
target_idx = num.zeros(jsort.size, dtype=num.int)
idx = 0
for itarget, target in enumerate(problem.targets):
target_idx[idx:idx+target.nmisfits] = itarget
idx += target.nmisfits
for idx in jsort:
target = problem.targets[target_idx[idx]]
ms = gcms[:, idx]
target = plot_targets[idx]
ms = cum_gcms[:, idx]
ms = num.where(num.isfinite(ms), ms, 0.0)
if num.all(ms == 0.0):


Loading…
Cancel
Save