headas_utils.cContains utility routines:
int headas_parstamp(fitsfile *, int)Writes a block of HISTORY keywords into a FITS file header listing all the runtime parameter values. Arguments are a FITS file pointer and extension number. Callable from Fortran as hdparstamp(). *** DEPRECATED *** PLEASE USE HDpar_stamp (see below) INSTEAD ***
int HDpar_stamp(fitsfile *, int, int *)Writes a block of HISTORY keywords into a FITS file header listing all the runtime parameter values. Arguments are a FITS file pointer, extension number, and status pointer. Callable from Fortran as hdpar_stamp().
char *hdbasename(char *)Equivalent to the basename() function (returns the filename portion of an input pathname).
int headas_clobberfile(char *)Deletes the specified file if it already exists and if the clobber parameter for the current task is set to "yes". Callable from Fortran as hdclobber().
float hd_ran2(long *)Random number generator based on ran2() from Numerical Recipes in C, 2nd ed., p282. Returns a uniform random deviate between 0.0 and 1.0 (exclusive of the endpoint values). Call with a negative integer argument to initialize. Callable from Fortran as hd_ran2().
headas_toolname.cContains routines to get/set the name/version of the current task:
void set_toolname(const char *)Use this to register the task's name. The Fortran version is hdnameset().
void get_toolname(char *)Use this to retrieve the task's name. If it hasn't been set (via set_toolname()) a default name is determined from the name of the executable file. The Fortran version is hdnameget().
void set_toolversion(const char *)Use this to register a version number string for a task. The Fortran version is hdverset().
void get_toolversion(char *)Use this to retrieve a string containing the task's version number. If it hasn't been set (via set_toolversion()) a default version number string of "0.0" is returned. The Fortran version is hdverget().
void get_toolnamev(char *)Use this to retrieve a single string containing both the task's name and version number (joined by a "_"). The Fortran version is hdnamevget().
headas_history.cContains routines to get/set the value of the history parameter. Designed primarily for internal use and under normal circumstances should not be called by tasks explicitly.
void get_history(int *)This routine returns the value of the history parameter (if present) or "-1" if unspecified. Called by headas_parstamp(). Fortran version is hdghis().
void set_history(int)This registers the value of the history parameter. If it is called explicitly from a task it will override the user-specified value. Fortran version is hdphis().
headas_copykeys.cContains routine to copy non-critical keywords from one HDU to another..
int HDcopy_keys(fitsfile *inptr, fitsfile *outptr, int docomments, int dohistory, int *status)Both the input and output FITS files should be positioned at the correct HDU. If docomments is true then COMMENT records will be copied and if dohistory is true then HISTORY records will be copied.
headas_polyfit.cContains routine to do a least-square polynomial fit.
void HDpoly_fit(double * x, double * y, double * c, int n, int degree)where x is the input n-element array of independent variables, y is the input n-element array of dependent variables, degree is the degree of the polynomial, and c is the output degree+1-element array of coefficients.
headas_sort.cContains routine to do a quick sort on the input array, returning sorted index (instead of data as with C qsort).
void HDsort(float * base, int * index, int n)where base is the input n-element unsorted data array and index is the input/output n-element array index.
headas_smooth.cContains routine to do a boxcar average on input data:
void HDsmooth(float * input, float * output, int num, int width)where input is the num-element unsmoothed array, output is the num-element smoothed array, and width is the width of the boxcar.
headas_svdfit.cContains routines used by HDpoly_fit (slightly modified versions of routines from Press, William H., Brian P. Flannery, Saul A Teukolsky and William T. Vetterling, 1986, "Numerical Recipes: The Art of Scientific Computing" (Fortran), Cambridge University Press.
headas_rand.cContains routines to generate (0,1) uniformly distributed pseudo-random numbers.
void HDmtInit(unsigned long int seed)Initialize the algorithm. Must be called first.
void HDmtFree()Clear the algorithm.
double HDmtRand()Return a pseudo-random number.