Guess/Def/Set Parameters

In DEMETER, every part of a fit is an object. The same is true of the parameters of the fit. A new guess parameter is defined like so:


      my $new_param = Demeter::GDS->new(gds     => 'guess',
                                        name    => 'deltar',
                                        mathexp => 0.0);

Every GDS object requires specifying these three attributes. The type of parameter, denoted by the gds attribute, is explained in detail in the next section. The name is the string that identifies the parameter and is used in the math expressions for path parameters and other kinds of GDS objects. In the case of a guess parameter, the mathexp is the initial value of the parameter to be used at the start of the fit. For other kinds of GDS ojbects, the mathexp attributes might take an actual math expression, i.e. a character string to be interpreted and evaluated by IFEFFIT.

gds, name, and mathexp are normal attributes of the GDS object and can be treated like attributes of any object. So, for instance, if you wish to change the starting valule of the deltar parameter, you can do like so:


      my $new_param = mathexp(0.025);

Here is another example, this time for a def parameter that takes an actual math expression:


      my $new_param = Demeter::GDS->new(gds     => 'def',
                                        name    => 'c',
                                        mathexp => '(a + b) * tan(angle/2) / (a - b)');

 

Simplified interface

Although the syntax for the GDS object is identical to the syntax for all other DEMETER objects, it seems somehow more cumbersome in this case -- particularly for anyone who goes back to the good ol' days of writing feffit.inp files. As a bit of syntactic sugar, the DEMETER base class offers a method that takes a character string as its sole argument. That character string is parsed the same way as a parameter definition in a feffit.inp file.


      my $new_param = $any_object->simpleGDS('guess deltar = 0.0');

The simpleGDS simply parses the string and uses that to create a GDS object, which it then returns. The normal and simple syntax can be used interchangeably and for all GDS types. They are completely equivalent.