Perturb mineral

I wrote a little perturb mineral thing and modified step_3 from the tutorial to example_uncertainties.py to use it. What do you guys think? And what do you think about removing 'err_' from all the uncertainty dictionaries?
Thanks, I will get to this after the 17th... in Japan [?]

On Tue, Aug 5, 2014 at 5:39 AM, Timo Heister <notifications@github.com>
wrote:

>  In burnman/mineral.py:
>
> > @@ -123,6 +123,18 @@ def set_state(self, pressure, temperature):
> >              self.G = float('nan') #nan if there is no G, this should propagate through calculations to the end
> >              warnings.warn(('Warning: G_0 and or Gprime_0 are undefined for ' + self.to_string()))
> >
> > +    def perturb(self,loc=0.0, scale=1.0):
> > +        """
> > +        Computes random perturbations to the mineral paramaters given published uncertain
> > +        """
> > +        if not hasattr(self,'original_params'):
> > +            self.original_params=self.params.copy()
> > +        for pert  in self.uncertainties:
> > +            try:
> > +                self.params[pert]=self.original_params[pert]+np.random.normal(loc=loc,scale=scale)*self.uncertainties[pert]
> > +            except:
> > +                print 'Tried to perturb ', pert, ', but failed. Possibly the uncertainty is not following the convention of \'err_?\' or the error bar is zero.'
>
> But please change "print" to "warn".
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/burnman-project/burnman/pull/29/files#r15779527>.
>