void RpalParser::D() { pushProc("D()"); Da(); if (_nt == "within") { read_token(_nt); D(); build("within", 2); } popProc("D()"); }
// Angular diameter distance static PyObject* PyCosmoObject_Da(struct PyCosmoObject* self, PyObject* args) { double zmin, zmax; double d; if (!PyArg_ParseTuple(args, (char*)"dd", &zmin, &zmax)) { return NULL; } d = Da(self->cosmo, zmin, zmax); return PyFloat_FromDouble(d); }
static PyObject* PyCosmoObject_Da_vec2(struct PyCosmoObject* self, PyObject* args) { PyObject* zmaxObj=NULL, *resObj=NULL;; double zmin, *zmax, *res; npy_intp n, i; if (!PyArg_ParseTuple(args, (char*)"dO", &zmin, &zmaxObj)) { return NULL; } n = PyArray_SIZE(zmaxObj); zmax = (double* )PyArray_DATA(zmaxObj); resObj = PyArray_ZEROS(1, &n, NPY_FLOAT64, 0); res = (double* )PyArray_DATA(resObj); for (i=0; i<n; i++) { res[i] = Da(self->cosmo, zmin, zmax[i]); } return resObj; }
//---------------------------------------------------------------------------- double sigma_crit(double z1,double z2){ double res = 0.0; res = vc*vc*Da(z2)/(4.0*M_PI*M_G*Da(z1)*Da2(z1,z2)); return res; }
//---------------------------------------------------------------------------- REAL sigma_crit(REAL z1,REAL z2){ REAL res = 0.0; res = vc*vc*Da(z2)/(4.0*M_PI*M_G*Da(z1)*Da2(z1,z2)); return res; }
double re_m(double m,double z1,double z2) { double res = 0; res = sqrt(M_G*m/(vc*vc)*Da2(z1,z2)/(Da(z1)*Da(z2))); return res; }