Changeset f71287f4 in sasview for pr_inversion/c_extensions


Ignore:
Timestamp:
May 9, 2008 6:09:10 PM (16 years ago)
Author:
Mathieu Doucet <doucetm@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
634f1cf
Parents:
32dffae4
Message:

Allow user to set q_min/q_max

Location:
pr_inversion/c_extensions
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pr_inversion/c_extensions/Cinvertor.c

    r4f63160 rf71287f4  
    266266        return Py_BuildValue("d", self->params.d_max);   
    267267} 
     268 
     269/** 
     270 * Sets the minimum q 
     271 */ 
     272static PyObject * set_qmin(Cinvertor *self, PyObject *args) { 
     273        double q_min; 
     274   
     275        if (!PyArg_ParseTuple(args, "d", &q_min)) return NULL; 
     276        self->params.q_min = q_min; 
     277        return Py_BuildValue("d", self->params.q_min);   
     278} 
     279 
     280/** 
     281 * Gets the minimum q 
     282 */ 
     283static PyObject * get_qmin(Cinvertor *self, PyObject *args) { 
     284        return Py_BuildValue("d", self->params.q_min);   
     285} 
     286 
     287 
     288/** 
     289 * Sets the maximum q 
     290 */ 
     291static PyObject * set_qmax(Cinvertor *self, PyObject *args) { 
     292        double q_max; 
     293   
     294        if (!PyArg_ParseTuple(args, "d", &q_max)) return NULL; 
     295        self->params.q_max = q_max; 
     296        return Py_BuildValue("d", self->params.q_max);   
     297} 
     298 
     299/** 
     300 * Gets the maximum q 
     301 */ 
     302static PyObject * get_qmax(Cinvertor *self, PyObject *args) { 
     303        return Py_BuildValue("d", self->params.q_max);   
     304} 
     305 
    268306 
    269307static PyObject * set_alpha(Cinvertor *self, PyObject *args) { 
     
    513551                   {"set_dmax", (PyCFunction)set_dmax, METH_VARARGS, ""}, 
    514552                   {"get_dmax", (PyCFunction)get_dmax, METH_VARARGS, ""}, 
     553                   {"set_qmin", (PyCFunction)set_qmin, METH_VARARGS, ""}, 
     554                   {"get_qmin", (PyCFunction)get_qmin, METH_VARARGS, ""}, 
     555                   {"set_qmax", (PyCFunction)set_qmax, METH_VARARGS, ""}, 
     556                   {"get_qmax", (PyCFunction)get_qmax, METH_VARARGS, ""}, 
    515557                   {"set_alpha", (PyCFunction)set_alpha, METH_VARARGS, ""}, 
    516558                   {"get_alpha", (PyCFunction)get_alpha, METH_VARARGS, ""}, 
  • pr_inversion/c_extensions/invertor.c

    r4f63160 rf71287f4  
    1818void invertor_init(Invertor_params *pars) { 
    1919        pars->d_max = 180; 
     20        pars->q_min = -1.0; 
     21        pars->q_max = -1.0; 
    2022} 
    2123 
  • pr_inversion/c_extensions/invertor.h

    r4f63160 rf71287f4  
    1212    int nerr;   
    1313    double alpha; 
     14    double q_min; 
     15    double q_max; 
    1416} Invertor_params;  
    1517 
Note: See TracChangeset for help on using the changeset viewer.