Test function mos_montecarlo_polyfit()
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.
DO category: Type: Explanation: Required:
TABLE Raw Table to evaluate Y
DO category: Data type: Explanation:
MODEL_ERROR FITS image Model error at different x
Create an object for the recipe montecarlo.
import cpl
montecarlo = cpl.Recipe("montecarlo")
Name of independent variable column (str; default: ‘x’) [default=”x”].
Name of dependent variable column (str; default: ‘y’) [default=”y”].
Name of error column on dependent variable (str; default: ‘’) [default=”“].
Order of fitting polynomial (long; default: 1) [default=1].
Origin of x for fit (float; default: 0.0) [default=0.0].
Start x for evaluation (float; default: 0.0) [default=0.0].
End x for evaluation (float; default: 0.0) [default=0.0].
x sampling interval (float; default: 0.0) [default=0.0].
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.
Please report any problems to Carlo Izzo. Alternatively, you may send a report to the ESO User Support Department.
This file is currently part of the FORS Instrument Pipeline Copyright (C) 2002-2010 European Southern Observatory
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Code author: Carlo Izzo <usd-help@eso.org>