#include <nemo.h> real rotcur_NAME(real r, int n, real *p, real *d); DescriptionA rotcurshape file is a small C function that should return the value of the rotation curve at a given radius. This function will be loaded (from the corresponding .so file) by NEMO’s dynamic object loader (see also loadobj(3NEMO)). The rotation curve is parameterized by n parameters p[0]...p[n-1]. The function should also return the ’n’ partial derivatives d[i] = dV/dp[i], for i=0...n-1 The name of the function should be rotcur_NAME() where NAME is the rotcurshape name . ExamplesThe following example is a rotation curve of a simple linear core: #include <nemo.h> real rotcur_core1(real r, int n, real *p, real *d) { real x = r / p[1]; d[0] = x/(1+x); d[1] = -p[0]*d[0]/(p[1]*(1+x)); return p[0] * d[0]; }Assuming this is in a file core1.c, the command
bake core1.sowill create a shared object file, which can then be used by rotcurshape:
% rotcurshape in=... radii=... rotcur1=core1,100,2,1,0would fit a linear core with fixed core radius of 2, and initial guess of V=100 and will fit the velocity scaling V.
Although there are examples in $NEMO/src/image/rotcur/shape, most shapes are builtin to the program rotcurshape(1NEMO) .
~/src/image/rotcur/shape examples
25-jan-08 documented PJT