aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-03-04 18:14:54 +0100
committerThomas White <taw@physics.org>2012-02-22 15:27:17 +0100
commit9357d8f186760fda060fe3324d88480c877c21f3 (patch)
treeddab7c657522ffa0372f79763099c160568b5c33
parentea2c477e283e8d945064956199151774a4764ad6 (diff)
Transformation matrix shouldn't be integer
-rw-r--r--src/detector.c6
-rw-r--r--src/detector.h8
2 files changed, 7 insertions, 7 deletions
diff --git a/src/detector.c b/src/detector.c
index e53d5331..b9d91118 100644
--- a/src/detector.c
+++ b/src/detector.c
@@ -32,7 +32,7 @@ static int atob(const char *a)
}
-static int dir_conv(const char *a, signed int *sx, signed int *sy)
+static int dir_conv(const char *a, double *sx, double *sy)
{
if ( strcmp(a, "-x") == 0 ) {
*sx = -1; *sy = 0;
@@ -79,8 +79,8 @@ struct rvec get_q(struct image *image, double fs, double ss,
/* Convert xs and ys, which are in fast scan/slow scan coordinates,
* to x and y */
- xs = (fs-p->min_fs)*p->fsx + (ss-p->min_ss)*p->ssx;
- ys = (fs-p->min_fs)*p->fsy + (ss-p->min_ss)*p->ssy;
+ xs = (fs-(double)p->min_fs)*p->fsx + (ss-(double)p->min_ss)*p->ssx;
+ ys = (fs-(double)p->min_fs)*p->fsy + (ss-(double)p->min_ss)*p->ssy;
rx = (xs + p->cnx) / p->res;
ry = (ys + p->cny) / p->res;
diff --git a/src/detector.h b/src/detector.h
index 028bd589..c4e06cef 100644
--- a/src/detector.h
+++ b/src/detector.h
@@ -38,10 +38,10 @@ struct panel
int no_index; /* Don't index peaks in this panel if non-zero */
double peak_sep; /* Characteristic peak separation */
- signed int fsx;
- signed int fsy;
- signed int ssx;
- signed int ssy;
+ double fsx;
+ double fsy;
+ double ssx;
+ double ssy;
double xfs;
double yfs;