Esempio n. 1
0
    def make(self, environ):
        cm = environ.get_plot_collection_manager()
        history = environ.get_history()
        optimiser = environ.get_optimiser()
        mpl_init(fontsize=self.font_size)
        cm.create_group_mpl(self,
                            self.draw_figures(history, optimiser),
                            title=u'Bootstrap Misfit',
                            section='optimiser',
                            feather_icon='trending-down',
                            description=u'''
Sorted misfit (descending) of single bootstrap chains.

For each bootstrap configuration, all models are sorted according to their
misfit value (red lines) and their global misfit value (black line). (They are
sorted individually for each line). The best model of every bootstrap
configuration (right end model of red lines) is marked as a cross in the global
misfit configuration. The horizontal black lines indicate mean and +- standard
deviation of the y-axis values of these crosses.

If the bootstrap configurations converge to the same region in model-space, all
crosses should be close to the right end of the plot. If this is not the case,
some bootstrap configurations have converged to very different places in
model-space. This would indicate that there might be inconsistencies in the
observations (maybe due to faulty or noisy or misoriented data). Also the shape
of the curve in general can give information. A well-behaved optimisation run
has approximately linear functions in this plot. Only at the end they should
have a higher downward gradient. This would be the place where the objective
functions of the bootstrap start to disagree.
''')
Esempio n. 2
0
    def make(self, environ):
        cm = environ.get_plot_collection_manager()
        mpl_init(fontsize=self.font_size)

        environ.setup_modelling()
        ds = environ.get_dataset()
        history = environ.get_history(subset='harvest')

        scolor = {
            'misfit':
            S('''
                The synthetic markers are colored according to their
                respective global (non-bootstrapped) misfit value. Red
                indicates better fit, blue worse.'''),
            'dist':
            S('''
                The synthetic markers are colored according to their
                Mahalanobis distance from the mean solution.''')
        }.get(
            self.color_parameter,
            S('''
            The synthetic markers are colored according to source
            parameter "%s".''' % self.color_parameter))

        cm.create_group_mpl(self,
                            self.draw_figures(ds, history),
                            title=u'Fits of phase ratios',
                            section='fits',
                            feather_icon='activity',
                            description=S(u'''
                Observed (black markers) and synthetic waveform amplitude phase
                ratio estimates (colored markers) at different stations for
                every Nth model in the bootstrap solution ensemble (N=%i).
                %s
                ''' % (self.istride_ensemble, scolor)))
Esempio n. 3
0
 def make(self, environ):
     cm = environ.get_plot_collection_manager()
     mpl_init(fontsize=self.font_size)
     environ.setup_modelling()
     ds = environ.get_dataset()
     history = environ.get_history(subset='harvest')
     cm.create_group_mpl(
         self,
         self.draw_figures(ds, history),
         title=u'Waveform fits for best model',
         section='fits',
         feather_icon='activity',
         description=u' Best model\'s fits for all waveform targets. '
         u' Each waveform plot gives a number of details:'
         u' 1) Target information (left side, from top to bottom) gives '
         u' station name with component, distance to source, azimuth of '
         u' station with respect to source, manual target weight, target '
         u' misfit and starting time of the waveform relative to the origin '
         u' time. 2) The background gray area shows the applied taper '
         u' function. 3) The waveforms shown are: the observed, restituted'
         u' trace (light grey) and the tapered and filtered target trace '
         u' (dark gray), the synthetic trace (light red) and the filtered, '
         u' tapered and (if enabled) shifted synthetic target trace (red). '
         u' The amplitude of the traces is scaled by the target weight (small '
         u' weight, small amplitude) and normed relative to the maximum '
         u' amplitude of the targets of the corresponding normalisation '
         u' family. 4) Colored boxes on the upper right show the relative '
         u' weight of the target within the entire dataset of the '
         u' optimisation (top box, orange) and the relative misfit '
         u' contribution to the global misfit of the optimisation (bottom '
         u' box, red). 5) Bottom trace (red, filled) shows sample-wise the '
         u' weighted misfit between observed (dark grey line) and synthetic '
         u' (red) target waveforms. ')
Esempio n. 4
0
    def make(self, environ):
        cm = environ.get_plot_collection_manager()
        history = environ.get_history(subset='harvest')
        optimiser = environ.get_optimiser()
        ds = environ.get_dataset()

        environ.setup_modelling()

        cm.create_group_mpl(self,
                            self.draw_static_fits(ds, history, optimiser),
                            title=u'InSAR Displacements',
                            section='fits',
                            feather_icon='navigation',
                            description=u'''
Maps showing subsampled surface displacements as observed, modelled and the
residual (observed minus modelled).

The displacement values predicted by the orbit-ambiguity ramps are added to the
modelled displacements (middle panels). The color shows the LOS displacement
values associated with, and the extent of, every quadtree box. The light grey
dots show the focal point of pixels combined in the quadtree box. This point
corresponds to the position of the modelled data point.

The large dark grey dot shows the reference source position. The grey filled
box shows the surface projection of the modelled source, with the thick-lined
edge marking the upper fault edge. Complete data extent is shown.
''')
Esempio n. 5
0
    def make(self, environ):
        cm = environ.get_plot_collection_manager()
        history = environ.get_history()
        optimiser = environ.get_optimiser()
        ds = environ.get_dataset()

        environ.setup_modelling()

        cm.create_group_mpl(
            self,
            self.draw_static_fits(ds, history, optimiser, closeup=True),
            title=u'Satellite Displacements (Closeup)',
            section='fits',
            feather_icon='zoom-in',
            description=u' Maps showing subsampled surface displacements as '
                        u' observed, modelled and the residual (observed minus'
                        u' modelled).\n The displacement values predicted by'
                        u' the orbit-ambiguity ramps are added to the modelled'
                        u' displacements (middle panels). The color shows the'
                        u' LOS displacement values associated with, and the'
                        u' extent of, every quadtree box. The light grey dots'
                        u' show the focal point of pixels combined in the'
                        u' quadtree box. This point corresponds to the'
                        u' position of the modelled data point.'
                        u' \n The large dark'
                        u' grey dot shows the reference source position. The'
                        u' grey filled box shows the surface projection of the'
                        u' modelled source, with the thick-lined edge marking'
                        u' the upper fault edge. '
                        u' Map is focused around the fault\'s'
                        u' extent.')
Esempio n. 6
0
    def make(self, environ):
        cm = environ.get_plot_collection_manager()
        history = environ.get_history(subset='harvest')
        optimiser = environ.get_optimiser()

        mpl_init(fontsize=self.font_size)
        cm.create_group_mpl(
            self,
            self.draw_figures(history, optimiser),
            title=u'Jointpar Plot',
            section='solution',
            feather_icon='crosshair',
            description=u'Source problem parameter\'s tradeoff plots.\n'
            u' The JointparPlot reveals relationships between'
            u' model parameters, like strong correlations or'
            u' non-linear trade-offs. A subset of model solutions'
            u' (from harvest) is shown in two dimensions for all'
            u' possible parameter pairs as points. The point color'
            u' indicates the misfit for the model solution with'
            u' cold colors (blue) for high misfit models and warm'
            u' colors (red) for low misfit models. The plot extend'
            u' is defined by the given parameter bounds and'
            u' shows the model space of the optimsation. Dark '
            u' gray boxes show the reference parameters as given'
            u' in the event.txt.')
Esempio n. 7
0
    def make(self, environ):
        from grond.problems.base import ProblemDataNotAvailable
        from grond.environment import NoRundirAvailable

        cm = environ.get_plot_collection_manager()
        mpl_init(fontsize=self.font_size)

        problem = environ.get_problem()
        dataset = environ.get_dataset()
        try:
            history = environ.get_history(subset='harvest')
        except (NoRundirAvailable, ProblemDataNotAvailable):
            history = None

        cm.create_group_mpl(
            self,
            self.draw_figures(problem, dataset, history),
            title=u'Seismic station locations',
            section='checks',
            feather_icon='target',
            description=u'''
Plot showing seismic station locations and attributes.

Station locations in dependence of distance and azimuth are shown. The center
of the plot corresponds to the origin of the search space, not to the optimised
location of the source.
''')
Esempio n. 8
0
    def make(self, environ):
        cm = environ.get_plot_collection_manager()
        history = environ.get_history(subset='harvest')

        mpl_init(fontsize=self.font_size)
        cm.create_group_mpl(
            self,
            self.draw_figures(history),
            title=u'Histogram',
            section='solution',
            feather_icon='bar-chart-2',
            description=u'''
Distribution of the problem's parameters.

The histograms are shown either as Gaussian kernel densities (red curved solid
line) or as bar plots the distributions of the parameters (marginals) along
with some characteristics:

The red solid vertical line gives the median of the distribution and the dashed
red vertical line the mean value. Dark gray vertical lines show reference
parameter values if given in the event.txt file. The overlapping red-shaded
areas show the 68% confidence intervals (innermost area), the 90% confidence
intervals (middle area) and the minimum and maximum values (widest area). The
plot ranges are defined by the given parameter bounds and show the model
space.
''')
Esempio n. 9
0
    def make(self, environ):
        cm = environ.get_plot_collection_manager()
        history = environ.get_history()
        optimiser = environ.get_optimiser()
        dataset = environ.get_dataset()

        environ.setup_modelling()

        mpl_init(fontsize=self.font_size)
        cm.create_group_mpl(self,
                            self.draw_figures(dataset, history, optimiser),
                            title=u'Target Contributions',
                            section='solution',
                            feather_icon='thermometer',
                            description=u'''
Contributions of the targets to the total misfit.

The relative contribution that each single target has in the global misfit
result is plotted relative and unscales as a function of global misfit
(descending).

The target contribution is shown in color-filled curves with the bottom curve
on the bottom and the best-fit target on top. This plot can be used to analyse
the balance of targets in the optimisations. For ideal configurations, the
target contributions are of similar size. If the contribution of a single
target is much larger than those of all others, the weighting should be
modified.
''')
Esempio n. 10
0
 def make(self, environ):
     cm = environ.get_plot_collection_manager()
     history = environ.get_history(subset='harvest')
     mpl_init(fontsize=self.font_size)
     cm.create_group_mpl(
         self,
         self.draw_figures(history),
         title=u'Hudson Plot',
         section='solution',
         feather_icon='box',
         description=u'Hudson plot of the best fitting moment tensor.')
Esempio n. 11
0
 def make(self, environ):
     cm = environ.get_plot_collection_manager()
     history = environ.get_history(subset='harvest')
     mpl_init(fontsize=self.font_size)
     cm.create_group_mpl(
         self,
         self.draw_figures(history),
         title=u'Moment Tensor Location',
         section='solution',
         feather_icon='target',
         description=u'Location plots of the best ensemble of solutions.')
Esempio n. 12
0
    def make(self, environ):
        cm = environ.get_plot_collection_manager()
        mpl_init(fontsize=self.font_size)
        cm.create_group_mpl(self,
                            self.draw_figures(history),
                            title=u'shakemap',
                            section='shakemap',
                            feather_icon='box',
                            description=u'''
Shakemap
''')
Esempio n. 13
0
 def make(self, environ):
     cm = environ.get_plot_collection_manager()
     history = environ.get_history(subset='harvest')
     mpl_init(fontsize=self.font_size)
     cm.create_group_mpl(
         self,
         self.draw_figures(history),
         title='Fuzzy Moment Tensor',
         section='solution',
         feather_icon='wind',
         description='A fuzzy moment tensor, illustrating the solution\'s'
         ' uncertainty.')
Esempio n. 14
0
 def make(self, environ):
     cm = environ.get_plot_collection_manager()
     history = environ.get_history(subset='harvest')
     mpl_init(fontsize=self.font_size)
     cm.create_group_mpl(
         self,
         self.draw_figures(history),
         title=u'Moment Tensor Decomopostion',
         section='solution',
         feather_icon='sun',
         description=u'Moment tensor decomposition of the best-fitting'
         u' solution.')
Esempio n. 15
0
    def make(self, environ):
        cm = environ.get_plot_collection_manager()
        mpl_init(fontsize=self.font_size)
        environ.setup_modelling()
        ds = environ.get_dataset()
        optimiser = environ.get_optimiser()

        environ.setup_modelling()

        history = environ.get_history(subset='harvest')
        cm.create_group_mpl(
            self,
            self.draw_figures(ds, history, optimiser),
            title=u'Waveform fits for best model',
            section='fits',
            feather_icon='activity',
            description=u'''
Plot showing observed and synthetic waveform (attributes) for the best fitting
model.

Best model's waveform fits for all targets. Depending on the target
configurations different types of comparisons are possible: (i) time domain
waveform differences, (ii) amplitude spectra, (iii) envelopes, (iv) cross
correlation functions. Each waveform plot gives a number of details:

1) Target information (left side, from top to bottom) gives station name with
component, distance to source, azimuth of station with respect to source,
target weight, target misfit and starting time of the waveform relative to the
origin time.

2) The background gray area shows the applied taper function.

3) The waveforms shown are: the restituted and filtered observed trace without
tapering (light grey) and the same trace with tapering and processing (dark
gray), the synthetic trace (light red) and the filtered, tapered and (if
enabled) shifted and processed synthetic target trace (red). The traces are
scaled according to the target weight (small weight, small amplitude) and
normed relative to the maximum amplitude of the targets of the corresponding
normalisation family.

4) The bottom panel shows, depending on the type of comparison, sample-wise
residuals for time domain comparisons (red filled), spectra of observed and
synthetic traces for amplitude spectrum comparisons, or cross correlation
traces.

5) Colored boxes on the upper right show the relative weight of the target
within the entire dataset of the optimisation (top box, orange) and the
relative misfit contribution to the global misfit of the optimisation (bottom
box, red).
''')
Esempio n. 16
0
    def make(self, environ):
        cm = environ.get_plot_collection_manager()
        history = environ.get_history(subset='harvest')
        mpl_init(fontsize=self.font_size)
        cm.create_group_mpl(self,
                            self.draw_figures(history),
                            title=u'Hudson Plot',
                            section='solution',
                            feather_icon='box',
                            description=u'''
Hudson's source type plot with the ensemble of bootstrap solutions.

For about 10% of the solutions (randomly chosen), the focal mechanism is
depicted, others are represented as dots. The square marks the global best
fitting solution.
''')
Esempio n. 17
0
    def make(self, environ):
        cm = environ.get_plot_collection_manager()
        mpl_init(fontsize=self.font_size)

        environ.setup_modelling()

        problem = environ.get_problem()
        results_list = []
        sources = []
        if self.n_random_synthetics == 0:
            x = problem.get_reference_model()
            sources.append(problem.base_source)
            results = problem.evaluate(x)
            results_list.append(results)

        else:
            for _ in range(self.n_random_synthetics):
                x = problem.get_random_model()
                sources.append(problem.get_source(x))
                results = problem.evaluate(x)
                results_list.append(results)

        cm.create_group_mpl(
            self,
            self.draw_figures(sources, problem.targets, results_list),
            title=u'Waveform Check',
            section='checks',
            feather_icon='activity',
            description=u'Plot for checking the waveforms fit with a'
            u' number of synthetics.'
            u' Plot for checking the waveform fits for all'
            u' targets with a number of synthetics from models'
            u' randomly drawn from given model parameter ranges. '
            u' The top waveform plot shows the observed and'
            u' filtered target trace. The cosine-shaped forms'
            u'  around the observed trace shows the taper'
            u' positions for the drawn models in different'
            u' colors. '
            u' the middle trace plot shows the filtered '
            u' synthetic '
            u' waveforms of the drawn models and the bottom plot '
            u' shows the corresponding filtered and tapered'
            u' synthetic waveforms. The colors of taper and'
            u' synthetic traces are individual for each random'
            u' model. The given time is relative to the'
            u' reference event origin time.')
Esempio n. 18
0
    def make(self, environ):
        cm = environ.get_plot_collection_manager()
        history = environ.get_history(subset='harvest')
        mpl_init(fontsize=self.font_size)
        cm.create_group_mpl(self,
                            self.draw_figures(history),
                            title=u'MT Decomposition',
                            section='solution',
                            feather_icon='sun',
                            description=u'''
Moment tensor decomposition of the best-fitting solution into isotropic,
deviatoric and best double couple components.

Shown are the ensemble best, the ensemble mean%s and, if available, a reference
mechanism. The symbol size indicates the relative strength of the components.
The inversion result is consistent and stable if ensemble mean and ensemble
best have similar symbol size and patterns.
''' % (', cluster results' if self.cluster_attribute else ''))
Esempio n. 19
0
    def make(self, environ):
        cm = environ.get_plot_collection_manager()
        history = environ.get_history(subset='harvest')
        mpl_init(fontsize=self.font_size)
        cm.create_group_mpl(self,
                            self.draw_figures(history),
                            title=u'Fuzzy MT',
                            section='solution',
                            feather_icon='wind',
                            description=u'''
A fuzzy moment tensor, illustrating the solution's uncertainty.

The P wave radiation pattern strength of every ensemble solution is stacked for
all ray spokes. The projection shows the stacked radiation pattern. If the
variability of the ensemble solutions is small, the fuzzy plot has clearly
separated black and white fields, consistent with the nodal lines of the %s
best solution (indicated in red).
''' % ('cluster' if self.cluster_attribute is not None else 'global'))
Esempio n. 20
0
    def make(self, environ):
        cm = environ.get_plot_collection_manager()
        mpl_init(fontsize=self.font_size)

        environ.setup_modelling()

        problem = environ.get_problem()
        results_list = []
        sources = []
        if self.n_random_synthetics == 0:
            x = problem.get_reference_model()
            sources.append(problem.base_source)
            results = problem.evaluate(x)
            results_list.append(results)

        else:
            for _ in range(self.n_random_synthetics):
                x = problem.get_random_model()
                sources.append(problem.get_source(x))
                results = problem.evaluate(x)
                results_list.append(results)

        cm.create_group_mpl(self,
                            self.draw_figures(sources, problem.targets,
                                              results_list),
                            title=u'Waveform Check',
                            section='checks',
                            feather_icon='activity',
                            description=u'''
Plot to judge waveform time window settings and source model parameter ranges.

For each waveform target, observed and synthetic waveforms are shown. For the
latter, models are randomly drawn from the configured parameter search space.

The top panel shows the observed waveform; filtered (faint gray), and filtered
and tapered (black). The colored outline around the observed trace shows the
taper position for each drawn model in a different color. The middle panel
shows the filtered synthetic waveforms of the drawn models and the bottom plot
shows the corresponding filtered and tapered synthetic waveforms. The colors of
taper and synthetic traces are consistent for each random model. The given time
is relative to the reference event origin time.
''')
Esempio n. 21
0
 def make(self, environ):
     cm = environ.get_plot_collection_manager()
     history = environ.get_history()
     mpl_init(fontsize=self.font_size)
     cm.create_group_mpl(
         self,
         self.draw_figures(history),
         title=u'Target Contributions',
         section='solution',
         feather_icon='thermometer',
         description=u' Contributions of the targets to the total misfit.\n'
         u' The relative contribution that each single target'
         u' has in the global misfit result is plotted relative'
         u' and unscales as a function of global misfit'
         u' (descending). \nThe target contribution is shown in'
         u' color-filled curves with the bottom curve on the'
         u' bottom and the best-fit target on top. This plot'
         u' can be used to analyse the balance of targets in'
         u' the optimisations and it indicates poorly fitting'
         u' targets easily.')
Esempio n. 22
0
    def make(self, environ):
        environ.setup_modelling()
        cm = environ.get_plot_collection_manager()
        history = environ.get_history(subset='harvest')
        mpl_init(fontsize=self.font_size)
        self._to_be_closed = []
        cm.create_group_mpl(self,
                            self.draw_figures(history),
                            title=u'MT Location',
                            section='solution',
                            feather_icon='target',
                            description=u'''
Location plot of the ensemble of best solutions in three cross-sections.

The coordinate range is defined by the search space given in the config file.
Symbols show best double-couple mechanisms, and colors indicate low (red) and
high (blue) misfit.
''')
        for obj in self._to_be_closed:
            obj.close()
Esempio n. 23
0
 def make(self, environ):
     cm = environ.get_plot_collection_manager()
     history = environ.get_history()
     mpl_init(fontsize=self.font_size)
     cm.create_group_mpl(self,
                         self.draw_figures(history),
                         title=u'Sequence Plots',
                         section='optimiser',
                         description=u'Sequence plots for all parameters of'
                         u' the optimisation.\n '
                         u' The sequence of all the parameter values'
                         u' is either a function of the optimisation'
                         u' in progress or of the misfit from high to'
                         u' low. This plot can be used to check on'
                         u' convergence or see if model parameters push'
                         u' the given bounds. \nThe color always shows the'
                         u' relative misfit. Relatively high misfits'
                         u' are in cold blue colors and relatively low'
                         u' misfits in red. The last panel gives the '
                         u' corresponding misfit values.',
                         feather_icon='fast-forward')
Esempio n. 24
0
    def make(self, environ):
        cm = environ.get_plot_collection_manager()
        history = environ.get_history(subset='harvest')
        optimiser = environ.get_optimiser()
        sref = 'Dark gray boxes mark reference solution.' \
            if self.show_reference else ''

        mpl_init(fontsize=self.font_size)
        cm.create_group_mpl(self,
                            self.draw_figures(history, optimiser),
                            title=u'Jointpar Plot',
                            section='solution',
                            feather_icon='crosshair',
                            description=u'''
Source problem parameter's scatter plots, to evaluate the resolution of source
parameters and possible trade-offs between pairs of model parameters.

A subset of model solutions (from harvest) is shown in two dimensions for all
possible parameter pairs as points. The point color indicates the misfit for
the model solution with cold colors (blue) for high misfit models and warm
colors (red) for low misfit models. The plot ranges are defined by the given
parameter bounds and shows the model space of the optimsation. %s''' % sref)