Table Of Contents

Previous topic

The fors_wave_calib_lss recipe

Next topic

The test_hough recipe

This Page

The montecarlo recipe

montecarlo

Synopsis

Test function mos_montecarlo_polyfit()

Description

This recipe is used to test the mos_montecarlo_polyfit() function.

It accepts a table with columns x, y, y_err, derives the best polynomial fit y = p(x), and produces a table with the polynomial 1-sigma accuracy on the given set of x coordinates.

Input files

DO category:               Type:       Explanation:         Required:
TABLE                      Raw         Table to evaluate       Y

Output files

DO category:               Data type:  Explanation:
MODEL_ERROR                FITS image  Model error at different x

Constructor

cpl.Recipe("montecarlo")

Create an object for the recipe montecarlo.

import cpl
montecarlo = cpl.Recipe("montecarlo")

Parameters

montecarlo.param.x

Name of independent variable column (str; default: ‘x’) [default=”x”].

montecarlo.param.y

Name of dependent variable column (str; default: ‘y’) [default=”y”].

montecarlo.param.sigma

Name of error column on dependent variable (str; default: ‘’) [default=”“].

montecarlo.param.order

Order of fitting polynomial (long; default: 1) [default=1].

montecarlo.param.zero

Origin of x for fit (float; default: 0.0) [default=0.0].

montecarlo.param.start

Start x for evaluation (float; default: 0.0) [default=0.0].

montecarlo.param.end

End x for evaluation (float; default: 0.0) [default=0.0].

montecarlo.param.step

x sampling interval (float; default: 0.0) [default=0.0].

montecarlo.param.trials

Size of statistical sample (long; default: 100) [default=100].

The following code snippet shows the default settings for the available parameters.

import cpl
montecarlo = cpl.Recipe("montecarlo")

montecarlo.param.x = "x"
montecarlo.param.y = "y"
montecarlo.param.sigma = ""
montecarlo.param.order = 1
montecarlo.param.zero = 0.0
montecarlo.param.start = 0.0
montecarlo.param.end = 0.0
montecarlo.param.step = 0.0
montecarlo.param.trials = 100

You may also set or overwrite some or all parameters by the recipe parameter param, as shown in the following example:

import cpl
montecarlo = cpl.Recipe("montecarlo")
[...]
res = montecarlo( ..., param = {"x":"x", "y":"y"})

See also

cpl.Recipe for more information about the recipe object.

Bug reports

Please report any problems to Carlo Izzo. Alternatively, you may send a report to the ESO User Support Department.