/* FILE: /mxtools/src/strawman/inc.h * PURPOSE: STRAWMAN routines *must* include this file! * AUTHOR: K. J. Mighell (mighell@noao.edu) * LANGUAGE: ANSI C * DATE: 2001NOV09 * COPYRIGHT: (C) 2001 Assoc. of Universities for Research in Astronomy Inc. */ #ifndef STRAWMAN_H # define STRAWMAN_H "STRAWMAN" # define STRAWMAN_AUTHOR "Kenneth J. Mighell" # define STRAWMAN_EMAIL "mighell@noao.edu" # define STRAWMAN_URL "http://www.noao.edu/staff/mighell" # define STRAWMAN_COPYRIGHT "Copyright (C) 2001 Association of Universities for Research in Astronomy Inc." # define STRAWMAN_VERSION "2001NOV09" # define STRAWMAN_DATE "20011109" # define MXBPARFLAGS (3L) # define MXSPARFLAGS (4L) # define MXPARFLAGS (MXBPARFLAGS+MXSPARFLAGS) # define MXNPARL (MXPARFLAGS) # define MXNORDER (MXNPARL) # define SIGMA_PER_FWHM (2.35) typedef struct { struct mxiraf_image_s *mxIrafImage; char ifn[MX_IRAF_SZ_FNAME+1]; double **matrixd; double *vectord; int llx0i; int lly0i; int nxi; int nyi; int xdimi; int ydimi; } inc_ImageS; typedef struct { struct mxiraf_image_s *mxIrafImage; char ifn[MX_IRAF_SZ_FNAME+1]; struct mxip_image_s *psf0; struct mxip_image_s *psf; struct mxip_image_s *PSF; int llx0i; int lly0i; int nxi; int nyi; int xdimi; int ydimi; int PSF_CPXJ; int PSF_CPYJ; double PSF_CPXF; double PSF_CPYF; double PSF_CPXP; double PSF_CPYP; double PSF_CPXI; double PSF_CPYI; double PSF_CWXI; double PSF_CWYI; int PSF_NX; int PSF_NY; int PSF_MX; int PSF_MY; int mpxi; } inc_PsfS; typedef struct { char image[MX_IRAF_SZ_FNAME+1]; int image_is_INDEF; char psf[MX_IRAF_SZ_FNAME+1]; double gain; int gain_is_INDEF; double ron; int ron_is_INDEF; double gbe; int gbe_is_INDEF; double gbx; int gbx_is_INDEF; double gby; int gby_is_INDEF; double gse; int gse_is_INDEF; double gsx; int gsx_is_INDEF; double gsy; int gsy_is_INDEF; double gsf; int gsf_is_INDEF; double gss; char parflags[MXNPARL+1]; int parflags_is_INDEF; double tbe; int tbe_is_INDEF; double tbx; int tbx_is_INDEF; double tby; int tby_is_INDEF; double tse; int tse_is_INDEF; double tsx; int tsx_is_INDEF; double tsy; int tsy_is_INDEF; double tsf; int tsf_is_INDEF; double tss; double obe; double obx; double oby; double ose; double osx; double osy; double osf; double oebe; double oebx; double oeby; double oese; double oesx; double oesy; double oesf; double ochisq; double orchsq; double oerchsq; double osmag; double oesmag; long ondf; int omfit; int onpar; int oniter; char method[32+1]; /* "digital" or "analytical" */ int method_is_INDEF; int method_is_digital; char STRAWMAN[8+1]; char PROGFILE[MX_IRAF_SZ_FNAME+1]; char PROGDATE[11+1]; char PROGTIME[8+1]; } inc_ParS; extern int inc_ParS_Get_i1 ( inc_ParS *ParS ) ; extern void inc_ParS_Print_v2 ( inc_ParS *ParS, FILE *ofp ) ; extern int inc_ParS_ImagS_File_i2 ( inc_ParS *ParS, int index ) ; extern void inc_Banner_v2 ( FILE *ofp, char *tag ) ; extern int inc_IrafParDoubleGet_v4 ( char text[], double defaultd, double *valued_p, int *is_INDEF_p ) ; extern int inc_IrafParStringGet_v5 ( char text[], char default_value[], char value[], int maxch, int *is_INDEF_p ) ; extern int inc_IrafParIntegerGet_v4 ( char text[], int defaulti, int *valuei_p, int *is_INDEF_p ) ; extern int inc_ParS_Get_i1 ( inc_ParS *ParS ) ; extern int inc_ImageS_Open_i2 ( inc_ParS *ParS, inc_ImageS *ImageS ) ; extern int inc_ImageS_Close_i1 ( inc_ImageS *ImageS ) ; extern void inc_peaker( double **image, int nx, int ny, double peakmin, double peakmax, int idx0, int idy0 ) ; extern void inc_SetXY_v4( double xd[], double yd[], long xdiml, long ydiml ) ; extern void fdel_v6( double xd, /* X coordinate */ double yd, /* Y coordinate */ double *md_p, /* Z model */ double ad[], /* parameter vector */ double delad[], /* partial derivative vector */ long nparl /* number of parameters */ ) ; extern void Gaussian2d_v12( double ig, /* volume of 2-d Gaussian */ double xgp, /* X physical coordinate of 2-d Gaussian */ double ygp, /* Y physical coordinate of 2-d Gaussian */ double sg, /* sigma of 2-d Gaussian */ int res_p, /* resolution = sqrt(total number of subpixels) */ double xp, /* X physical coordinate of pixel */ double yp, /* Y physical coordinate of pixel */ double *z_p, /* value of 2-d Gaussian at Z = Gaussian2d(X,Y) */ double *dzdi_p, /* del(z)/del(i) derivative of Z with respect to intensity */ double *dzdx_p, /* del(z)/del(x) derivative of Z with respect to x */ double *dzdy_p, /* del(z)/del(y) derivative of Z with respect to y */ double *dzds_p /* del(z)/del(s) derivative of Z with respect to sigma */ ) ; extern void InvertSymmetricMatrix_v3( double *matrix, int norder, double *det_p ) ; extern int fdelb0_i3( double **matrix, int nx, int ny ) ; extern int fdelbx_i4( double **matrix, double **xmatrix, int nx, int ny ) ; extern int fdelby_i4( double **matrix, double **ymatrix, int nx, int ny ) ; extern int fmodel_i7( double **matrix, double **psfmatrix, double **xmatrix, double **ymatrix, int nx, int ny, double ad[] ) ; extern int fdelsxa_i6( double **matrix, double **xmatrix, double **ymatrix, int nx, int ny, double ad[] ) ; extern int fdelsya_i6( double **matrix, double **xmatrix, double **ymatrix, int nx, int ny, double ad[] ) ; extern int fdelss_i6( double **matrix, double **xmatrix, double **ymatrix, int nx, int ny, double ad[] ) ; extern int fdelsxd_i5( double **delsx, double **z, double s0, int nx, int ny ) ; extern int fdelsyd_i5( double **delsy, double **z, double s0, int nx, int ny ) ; extern int inc_PsfS_Open_i2 ( inc_ParS *ParS, inc_PsfS *PsfS ) ; extern int inc_PsfS_Close_i1 ( inc_PsfS *PsfS ) ; extern int ip_image_s_copy_i2( struct mxip_image_s *in, struct mxip_image_s **out ) ; extern int inc_ImageS_Add_Star_i7( struct mxip_image_s *image, double se_p, double sx_p, double sy_p, struct mxip_image_s *psf, int PSF_CPXJ_p, int PSF_CPYJ_p ) ; extern int ip_Shift2d_i4( struct mxip_image_s *old, double deltax, double deltay, struct mxip_image_s *new ) ; extern void sshift_ansi( float x[], /* Input data array. */ int n, /* Number of points to shift. */ float shift, /* Amount of the shift. */ float hole, /* value to assign to out of range data. */ float xp[] /* Destination array for the shifted data. */ ) ; extern int LevenbergMarquardt_i19( inc_PsfS *PsfS, /* PsfS */ long nptsl, /* number of data points */ struct mxip_image_s *xd, /* X coordinate image */ struct mxip_image_s *yd, /* Y coordinate image */ struct mxip_image_s *zd, /* Z measurement image */ struct mxip_image_s *zerrd, /* Z measurement error image */ struct mxip_image_s *md, /* Z data image */ struct mxip_image_s *wd, /* Work image */ struct mxip_image_s **del, /* Partial derivates of dimension MXNPARL */ long nparl, /* number of parameters */ double ad_p[], /* parameter vector */ double aerrd[], /* parameter error vector */ char ausec[], /* a string of nparl characters either "f" or "c" */ double diffmnd, /* stop fitting when (old_chisqd-chisqd)<=diffmnd */ double *chisqd_p, /* chi-square */ long *ndfl_p, /* number of degrees of freedom */ int *mfiti_p, /* number of free parameters */ double *lambdad_p, /* Levenberg-Marquart method lambda */ int method_is_digital /* 1 <- digital, 0 <- analytical */ ) ; extern int fdels0a_i6( double **matrix, double **xmatrix, double **ymatrix, int nx, int ny, double ad[] ) ; extern int fdels0d_i7( inc_PsfS *PsfS, struct mxip_image_s *image, #ifdef nogo double **matrix, #endif double **xmatrix, double **ymatrix, int nx, int ny, double ad[] ) ; #endif /* end-of-file */