/************************************************************************/ /* focas1.h valdes 8/27/82 */ /* */ /* Definitions for FOCAS III */ /************************************************************************/ #include "image.h" /* MEMORY ALLOCATION REQUIREMENTS */ #define MXLN 800 /* Maximum x or y extent of object */ #define MXRLC 3200 /* Maximum number of rlcs in object */ #define ARMAX 20 /* Maximum number of objects split */ #define BSZE 1024 /* Blocking size for scan line buffers */ #define COLNS 200 /* Maximum number of comment lines */ #define COLEN 132 /* Maximum characters in a comment line */ #define NXMAX 15 /* Maximum x dimension of p.s.f. */ #define NYMAX 15 /* Maximum y dimension of p.s.f. */ #define NRULES 50 /* Maximum number of class rules */ #define CLCHAR 5 /* Characters in class name */ #define MXDEN 4096 /* Maximum number of density values */ #define NXFLT 25 /* Maximum dimension of detection filter*/ #define NYFLT 25 #define LFWRD NYFLT /* Incore scan lines forward of current */ #define LBACK NYFLT /* Incore scan lines back of current */ /* OBJECT RECORD FLAG BYTE DEFINITIONS */ #define EDGE 01 /* Object intersects image edge */ #define SIZE 02 /* Object too big: x width >MAXLN or */ /* or y width > MAXLN or dx*dy>MXSZ or */ /* rlcs > MXRLC */ #define SNGL 04 /* Object not split at any isophote */ #define PEAK 010 /* Saturated pixels in object */ #define ATTN 020 /* Special attention */ #define BCOR 040 /* Bright star mag. correction applied */ #define ADDO 0100 /* Artificial object added to field */ #define FRCD 0200 /* Forced classification */ #define CLSF 0400 /* Resolution classifier problem */ #define DARK 01000 /* Object below sky */ #define EVAL 02000 /* Object evaluated */ #define REFP 04000 /* Reference point */ /* INTENSITY RELATION FLAGS */ #define LNR 01 /* Linear */ #define DLUT 02 /* Direct look up table */ #define INTP 04 /* Interpolation look up table */ #define FLTR 010 /* Builtin filter */ #define FUNC 020 /* Function intensity relation */ struct sgparm { /* CATALOG HEADER DATA STRUCTURE */ /* FIELD INFORMATION */ char pltnm[32]; /* Field name or descriptor */ char pltepoch[32]; /* Field epoch */ char band[2]; /* Field passband */ float pltra,pltdec; /* Field coordinates */ short pltexp; /* Field exposure or integration */ char observer[24]; /* Observer */ char origin[24]; /* Instrument */ double xfrm[3][3]; /* Coordinate transform matrix */ int comment; /* Number of comment lines */ /* SCAN INFORMATION */ int xs,ys; /* Starting point of scan */ int kpts; /* Number of points in scan line */ int kscan; /* Number of scan lines in image */ /* FOCAS PROCESSING INFORMATION */ char dtestr[32]; /* Date processing commenced */ int pflags; /* Processing flags */ char ptfl[SZ_FNAME]; /* Field image file */ char arfl[SZ_FNAME]; /* Area descriptions file */ /* DETECTION PARAMETERS */ int minudt; /* Sky update threshold */ int nupdte; /* Pixels per new sky update */ float sa,sb; /* Coefficients for sky update */ float thrln0; /* Sigma above sky mean for detection */ float thrln1; /* Sigma below sky mean for detection */ int minarea; /* Minimum area to accept in catalog */ /* OBJECT EVALUATION PARAMETERS */ float magfst; /* Magnitude zero point */ float maglim; /* Maximum mag to accept in catalog */ int skwdth; /* Width of sky evaluation border */ int satr; /* Density level for saturation flag */ int buf; /* Buffer width between object and sky */ float grow; /* Area expansion for total magnitudes */ float skyhw; /* Sky sigma */ float skybw; /* Width of sky hstgrm bin in sky sigma */ float sptbw; /* Width of splitting steps in sky sigma*/ float rfca; /* Radius of fixed circular aperture */ float sig; /* Significance test */ /* TEMPLATE FITTING AND CLASSIFICATION */ int fx,fy; /* Size of detection filter */ int nden; /* Number of points in intensity curve */ int nx,ny; /* Size of template */ int nrules; /* Number of classification rules */ }; struct objrec { /* OBJECT PARAMETERS DATA STRUCTURE */ short entnum; /* Object entry number */ long subent; /* Object subentry number */ char class[CLCHAR]; /* Object classification */ short eflgs; /* Flags */ float sbr; /* Sky intensity */ short nsbr; /* Number of pixels used to evaluate sky*/ float ssbr; /* Sigma of sky brightness */ long area; /* Isophotal area */ long tarea; /* Total light area */ float ispht; /* Average intensity of isophote pixels */ float xavg, yavg; /* Average x and y width */ float xc,yc; /* Scan coordinates of object */ float ra,dec; /* Reference system coordinates */ float Li; /* Isophotal luminosity */ float sLi; /* Sigma of isophotal intensities */ float Lc; /* Core luminosity */ float Lfca; /* Fixed circular aperature luminosity */ float Ltotal; /* Total luminosity */ float mag; /* Isophotal magnitude */ float icx,icy,ixx,iyy,ixy, /* Intensity weighted moments */ ir1,ir3,ir4; float cx,cy,xx,yy,xy,r1; /* Unweighted moments */ float fitxc,fityc; /* Resolution classifier fitting center */ float scale; /* Resolution classifier scale */ float frac; /* Resolution classifier fraction */ float prob; /* Resolution classifier probability */ long arpos; /* Position in area description file */ }; struct shortrec { /* SHORT OBJECT DATA STRUCTURE */ short entnum; /* Object entry number */ short subent; /* Object subentry number */ char class[CLCHAR]; /* Object classification */ short eflgs; /* Flags */ short xc,yc; /* Scan coordinates of object */ short magi; /* Isophotal mag * 100 */ short magc; /* Core mag * 100 */ short magfca; /* Fixed circular aperature mag * 100 */ short magtotal; /* Total mag * 100 */ float icx,icy,ixx,iyy,ixy,ir1;/* Intensity weighted moments */ float cx,cy,xx,yy,xy,r1; /* Unweighted moments */ short scale; /* Resolution classifier scale * 100 */ short frac; /* Resolution classifier fraction * 100 */ long area; /* Isophotal Area (JFJarvis 3/1/85) */ }; struct smblk { /* AREA ASSEMBLY BLOCKS */ union { struct smblk *a; struct smblk *b;} smb1; union { struct smblk *lnp; int xmin; int xl; } smb2; union { int empty; int xmax; int xr; } smb3; union { int empty; int ytop; int y; } smb4; }; struct crule { /* CLASSIFICATION RULES */ float mag1,mag2; /* Magnitude interval */ float scl1,scl2; /* Scale interval */ float frc1,frc2; /* Fraction interval */ char class[CLCHAR]; /* Classification */ }; struct arblk { /* AREA DESCRIPTION DATA BLOCK */ short ychst; /* y value of last rlc (largest y) */ short nlines; /* Number of scan lines */ short nx[MXLN]; /* Number of rlcs up to and including */ /* current line */ short xla[MXRLC]; /* Left x value of rlc */ short xra[MXRLC]; /* Right x value of rlc */ }; struct areas { /* AREA DESCRIPTION DATA STRUCTURE */ short aflgs; /* Flags */ short rct[4]; /* Bounding rectangle */ short xmin,xmax; /* Bounds of x values in detection area */ struct arblk d; /* Detection area data block */ struct arblk i; /* Isophote of detection area */ struct arblk t; /* Total light area */ }; struct imiso { /* IMAGE ISOPHOTE STRUCTURE */ short x0, y0; short nx, ny; struct liso *liso; }; struct liso { /* IMAGE LINE ISOPHOTE STRUCTURE */ int nalloc; int nused; short *xla; short *xra; short *color; }; struct flmcv { /* INTENSITY-DENSITY DEFINITION */ PIXEL d; /* Pixel density */ float i; /* Pixel intensity */ float slope; /* Slope of relation */ }; /* Routine name changes for portability conflicts. */ #define catopen f_catopen /* COMMON VARIABLES */ int pfd; /* Field file descriptor */ int sfd; /* Sky file descriptor */ FILE *cfd, *catopen(), *mcatopen(); /* Catalog file descriptor */ FILE *afd, *fndar(); /* Areas file descriptor */ char cattype; /* Catalog type (this is the first byte */ /* of a catalog */ struct sgparm sp; /* Catalog header */ struct imgdef pthdr; /* Field image header */ struct flmcv flmcv[MXDEN]; /* Instrumental intensity curve */ short ncmmnts; /* Number of comment lines in catalog */ char comments[COLNS][COLEN]; /* Comment lines */ float dfltr[NYFLT][NXFLT]; /* Detection filter */ float template[NYMAX][NXMAX]; /* Instrumental point spread function */ struct crule crules[NRULES]; /* Classification rules */ float film(); /* Instrumental intensity function */ float lpcoords(); /* Logical/physical coordinates */