/***************************************************************************\ * This subroutine increases the sizes of the objects in the convolution * * box by the amount that the PSF is oversampled. * \***************************************************************************/ #include #include #include #include "structs.h" int istrunc (char *objtype); void oversampsize (struct fitpars *fpar, int os) { int i; if (fpar->high != NULL) oversampsize (fpar->high, os); if (fpar->next != NULL) oversampsize (fpar->next, os); /*------------------\ | Object sizes. | \------------------*/ if (!istrunc (fpar->objtype) && strncmp(fpar->objtype, "four", 4) != 0 && strncmp(fpar->objtype, "bend", 4) != 0 && strncmp(fpar->objtype, "power", 5) != 0 && strncmp(fpar->objtype, "log", 3) != 0 && strncmp(fpar->objtype, "C0", 2) != 0) fpar->a[4] = fpar->a[4] * os; if (strncmp(fpar->objtype, "king", 4) == 0 || strncmp(fpar->objtype, "edgedisk", 8) == 0) fpar->a[5] = fpar->a[5] * os; /*-------------------------------------------------------------\ | Special treatment for profiles that use surface brightness | | as the free parameter instead of magnitude. | \-------------------------------------------------------------*/ if (fpar->normtype > 0 && !istrunc (fpar->objtype) && strncmp(fpar->objtype, "four", 4) != 0 && strncmp(fpar->objtype, "bend", 4) != 0 && strncmp(fpar->objtype, "power", 5) != 0 && strncmp(fpar->objtype, "log", 3) != 0 && strncmp(fpar->objtype, "C0", 2) != 0) fpar->a[3] = fpar->a[3] + 5 * log10(os); /*-----------------------------------------\ | Deal with truncation length parameters | \-----------------------------------------*/ if (istrunc (fpar->objtype)) { fpar->a[4] = fpar->a[4] * os; fpar->a[5] = fpar->a[5] * os; }; /*-----------------------------------------\ | Deal with spiral structure scale sizes | \-----------------------------------------*/ if (strncmp (fpar->objtype, "power", 5) == 0) { fpar->a[1] = fpar->a[1] * os; fpar->a[2] = fpar->a[2] * os; } else if (strncmp (fpar->objtype, "log", 3) == 0) { fpar->a[1] = fpar->a[1] * os; fpar->a[2] = fpar->a[2] * os; fpar->a[4] = fpar->a[4] * os; }; if (strncmp (fpar->objtype, "bend", 4) == 0) { for (i=1; i<= fpar->npars; i++) fpar->a[i] = fpar->a[i] * os; } }