Commit 7c98c5bd authored by Danny Boxhoorn's avatar Danny Boxhoorn
Browse files

Version from 2006/11/16

parent 6384c370
......@@ -19,8 +19,8 @@
# testprog targets. See also changes and comments in configure.in
#
CFITSIO_LIB = /master0/local.home/alfvol/alfredo/DIA/package/WCS2PIX-1.0/include/cfitsio/lib
CFITSIO_INCLUDE = /master0/local.home/alfvol/alfredo/DIA/package/WCS2PIX-1.0/include/cfitsio/include
CFITSIO_LIB = /home/tig/VODIA/package/getvar.wcs/cfitsio/lib
CFITSIO_INCLUDE = /home/tig/VODIA/package/getvar.wcs/cfitsio/include
SHELL = /bin/sh
RANLIB = ranlib
......
......@@ -122,6 +122,9 @@
$Id$
$Log$
Revision 1.1 2006/11/07 19:52:04 tig
add cfitsio source
Revision 1.56 2000/01/04 11:58:31 oneel
Updates so that compressed network files are dealt with regardless of
their file names and/or mime types.
......
......@@ -21,9 +21,9 @@ FUNC = bkg.o center_stars.o get_repeaters.o main.o make_psf.o make_vectors.o
UTIL = rfits_f.o wfits_f.o main.o
.c.o:
${CC} ${COPT} -c $<
${CC} ${COPT} ${INCL} -c $<
getvar: ${OBJS}
getvar: ${OBJS} ${PWD}/cfitsio/lib/*.a ${PWD}/wcs/*.a
${CC} -o $@ ${OBJS} ${LIBS} ${LIBD} ${INCL} ${COPT}
${OBJS} : makefile
......
......@@ -20,7 +20,7 @@ extern void make_kernel(KER_STRUCT *, double *, double *, int);
extern void im_convolve(double *, double *, int, int, double *, int);
extern float *rfits_f(char *, char *, int *, int *,
float *, float *, long int *);
float *, float *, double *, double *, long int *);
extern void wfits_f(char *, char *, long int, float *);
......
......@@ -28,6 +28,8 @@ int main(int argc, char **argv)
PAR_STRUCT par;
float *im, *difim, *refim, bscale, bzero, mag;
double *mjds, *exptimes;
double mjd_r, exptime_r;
int nx0, ny0, k, idx_buf, *sector, nim, iim, npsf, ipsf, isec_x, isec_y;
int *cx, *cy, psfn, kern, irad, ofs;
......@@ -79,6 +81,8 @@ int main(int argc, char **argv)
diffiles = (NAME *)malloc(idx_buf*sizeof(NAME));
imfiles = (NAME *)malloc(idx_buf*sizeof(NAME));
kerfiles = (NAME *)malloc(idx_buf*sizeof(NAME));
mjds = (double *)malloc(idx_buf*sizeof(double));
exptimes = (double *)malloc(idx_buf*sizeof(double));
inpf = fopen(imffname,"r");
......@@ -94,6 +98,10 @@ int main(int argc, char **argv)
fprintf(stderr,"%s: Realloc error 2!\n",argv[0]);
if( !( kerfiles = (NAME *)realloc(kerfiles,idx_buf*sizeof(NAME))) )
fprintf(stderr,"%s: Realloc error 3!\n",argv[0]);
if( !( mjds = (double *)realloc(mjds,idx_buf*sizeof(double))) )
fprintf(stderr,"%s: Realloc error 4!\n",argv[0]);
if( !( exptimes = (double *)realloc(exptimes,idx_buf*sizeof(double))) )
fprintf(stderr,"%s: Realloc error 5!\n",argv[0]);
}
}
......@@ -223,7 +231,7 @@ int main(int argc, char **argv)
}
refim = rfits_f(reffname,header,&nx0,&ny0,&bscale,&bzero,&headlen);
refim = rfits_f(reffname,header,&nx0,&ny0,&bscale,&bzero,&mjd_r,&exptime_r,&headlen);
make_vectors(&ker);
......@@ -244,13 +252,13 @@ int main(int argc, char **argv)
for(iim=0;iim<nim;iim++) {
difim = rfits_f(diffiles[iim],header,&nx0,&ny0,&bscale,&bzero,&headlen);
difim = rfits_f(diffiles[iim],header,&nx0,&ny0,&bscale,&bzero,&mjds[iim],&exptimes[iim],&headlen);
if( nx0 != par.nx0 || ny0 != par.ny0 ) {
fprintf(stderr,"phot:error: image %s has wrong size\n",diffiles[iim]);
exit(-1);
}
im = rfits_f( imfiles[iim],header,&nx0,&ny0,&bscale,&bzero,&headlen);
im = rfits_f( imfiles[iim],header,&nx0,&ny0,&bscale,&bzero,&mjds[iim],&exptimes[iim],&headlen);
if( nx0 != par.nx0 || ny0 != par.ny0 ) {
fprintf(stderr,"phot:error: image %s has wrong size\n",imfiles[iim]);
exit(-1);
......@@ -342,8 +350,9 @@ int main(int argc, char **argv)
mag = -2.5*log(objp->a2_flux);
fprintf(outf,"%s %9.2f %9.2f %9.4f %9.4f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %d\n",
imfiles[iim],x[ipsf],y[ipsf],x_tmp[ipsf],y_tmp[ipsf],
fprintf(outf,"%s %.8f %9.2f %9.2f %9.4f %9.4f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %d\n",
imfiles[iim], mjds[iim]+exptimes[iim]/2,
x[ipsf],y[ipsf],x_tmp[ipsf],y_tmp[ipsf],
psf_flux[ipsf]+objp->p_flux,psf_err[ipsf]+objp->p_err,
a_flux[ipsf]+objp->a_flux,a_err[ipsf]+objp->a_err,
objp->p_flux,objp->p_err,objp->a_flux,objp->a_err,
......
......@@ -10,8 +10,9 @@
is buflen. Upon return b_zero and b_scale contain scaling parameters.
*/
float *rfits_f(char *infn, char *head, int *ncols, int *nrows,
float *b_scale, float *b_zero, long int *buflen)
float *rfits_f(char *infn, char *head, int *ncols, int *nrows,
float *b_scale, float *b_zero, double *mjd, double *exptime,
long int *buflen)
{
FILE *inf;
int nx, ny, bitpix, i, npix;
......@@ -19,6 +20,7 @@ float *rfits_f(char *infn, char *head, int *ncols, int *nrows,
long ofs=0L;
char *hp;
float *pixbuf;
char line[24];
......@@ -59,6 +61,16 @@ float *rfits_f(char *infn, char *head, int *ncols, int *nrows,
if ( strncmp(hp,"BZERO ",8) == 0 ) {
sscanf(hp+9," %f", b_zero);
}
if ( strncmp(hp,"MJD-OBS ",8) == 0 ) {
strncpy(line,hp+9,24);
line[24]=0;
*mjd=atof(line);
}
if ( strncmp(hp,"EXPTIME ",8) == 0 ) {
strncpy(line,hp+9,24);
line[24]=0;
*exptime=atof(line);
}
if ( strncmp(hp,"END ",8) == 0 ) {
eoh=1;
}
......
......@@ -19,8 +19,8 @@
# testprog targets. See also changes and comments in configure.in
#
CFITSIO_LIB = /master0/local.home/alfvol/alfredo/DIA/package/WCS2PIX-1.0/include/cfitsio/lib
CFITSIO_INCLUDE = /master0/local.home/alfvol/alfredo/DIA/package/WCS2PIX-1.0/include/cfitsio/include
CFITSIO_LIB = /home/tig/VODIA/package/wcs2pix/cfitsio/lib
CFITSIO_INCLUDE = /home/tig/VODIA/package/wcs2pix/cfitsio/include
SHELL = /bin/sh
RANLIB = ranlib
......
......@@ -122,6 +122,9 @@
$Id$
$Log$
Revision 1.1 2006/11/07 19:55:07 tig
add cfitsio source
Revision 1.56 2000/01/04 11:58:31 oneel
Updates so that compressed network files are dealt with regardless of
their file names and/or mime types.
......
......@@ -2,12 +2,13 @@ CC = gcc # the C compiler
COPT = -O3 -Wall # options for the C compiler
LIBS = -lm -lcfitsio -lwcs # libraries
INCL = -I${PWD}/wcs -I${PWD}/cfitsio/include
LIBD = -L${PWD}/wcs -I${PWD}/cfitsio/lib
LIBD = -L${PWD}/wcs -L${PWD}/cfitsio/lib
OBJS = wcs2pix.o \
.c.o:
${CC} ${COPT} -c ${LIBS} ${LIBD} ${INCL} ${COPT} $<
${CC} ${COPT} -c ${INCL} $<
# ${CC} ${COPT} -c ${LIBS} ${LIBD} ${INCL} ${COPT} $<
wcs2pix:${OBJS}
${CC} -o $@ ${OBJS} ${LIBS} ${LIBD} ${INCL} ${COPT}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment