measure.c
/* Build the source descriptor with specification string spec. */
Build the source descriptor with specification string spec.
Build the source descriptor with specification string spec .
int buildsrc (measdesc *desc, char *spec) {
	real tmin = 0, tmax = 0, pmin = 0, pmax = 0, srcpt[3];
	char *srcloc[3];
	int ntheta = 0, nphi = 0, plane = 1;
	splitstr (srcloc, spec, ",", 3);
	if (srcloc[2]) {
		plane = 0;
		srcpt[0] = strtod (srcloc[0], NULL);
		srcpt[1] = strtod (srcloc[1], NULL);
		srcpt[2] = strtod (srcloc[2], NULL);
		ntheta = nphi = 1;
	} else {
		ntheta = measrange (srcloc[0], &tmin, &tmax, 180);
		nphi = measrange (srcloc[1], &pmin, &pmax, 360);
	}
	buildlocs (desc, plane, ntheta, tmin, tmax, nphi, pmin, pmax);
	if (!plane) memcpy (desc->locations, srcpt, 3 * sizeof(real));
	return desc->count;
}
int buildsrc ( measdesc * desc , char * spec ) { real tmin = 0 , tmax = 0 , pmin = 0 , pmax = 0 , srcpt [ 3 ] ; char * srcloc [ 3 ] ; int ntheta = 0 , nphi = 0 , plane = 1 ; splitstr ( srcloc , spec , " " , 3 ) ; if ( srcloc [ 2 ] ) { plane = 0 ; srcpt [ 0 ] = strtod ( srcloc [ 0 ] , NULL ) ; srcpt [ 1 ] = strtod ( srcloc [ 1 ] , NULL ) ; srcpt [ 2 ] = strtod ( srcloc [ 2 ] , NULL ) ; ntheta = nphi = 1 ; } else { ntheta = measrange ( srcloc [ 0 ] , & tmin , & tmax , 180 ) ; nphi = measrange ( srcloc [ 1 ] , & pmin , & pmax , 360 ) ; } buildlocs ( desc , plane , ntheta , tmin , tmax , nphi , pmin , pmax ) ; if ( ! plane ) memcpy ( desc -> locations , srcpt , 3 * sizeof ( real ) ) ; return desc -> count ; }
Build the source descriptor with specification string spec.
Build the source descriptor with specification string spec .
/* Split the source locations into a theta and phi range, or coordinates. */ /* If a third argument is present, use a point source. */ /* Otherwise, use a range of plane waves. */ /* Build the observer locations. */ /* Override the location for a point source. */