[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master fb2a4a7: MakeCatalog first pass coordinate inc
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master fb2a4a7: MakeCatalog first pass coordinate increment in shift loop |
Date: |
Tue, 30 May 2017 17:08:20 -0400 (EDT) |
branch: master
commit fb2a4a7758fcb65f9a98b5c014c0ae62c2bbddfe
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>
MakeCatalog first pass coordinate increment in shift loop
The loop that calculates the shift of coordinates for estimating
second-order parameters was suppose to also increment the coordinate by one
because in the FITS standard counting starts from one not zero. This was
correctly done in the second pass but it was forgotten in the first and we
were manually incrementing it every time we needed it!
The problem was found because in flux weighted first order positions, the
increment wasn't in a parenthesis. So the final coordinate found would be
wrong.
---
bin/mkcatalog/mkcatalog.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/bin/mkcatalog/mkcatalog.c b/bin/mkcatalog/mkcatalog.c
index 2295600..e8464fe 100644
--- a/bin/mkcatalog/mkcatalog.c
+++ b/bin/mkcatalog/mkcatalog.c
@@ -165,21 +165,21 @@ mkcatalog_first_pass(struct mkcatalog_passparams *pp)
expression (difference) is evaluated, the coordinate is
going to change. This is necessary because `shift' is also
starting from zero. */
- for(d=0;d<ndim;++d) sc[d] = c[d] - pp->shift[d];
+ for(d=0;d<ndim;++d) sc[d] = c[d]++ - pp->shift[d];
/* Do the general geometric (independent of pixel value)
calculations. */
oi[ OCOL_NUMALL ]++;
- oi[ OCOL_GX ] += c[1]+1;
- oi[ OCOL_GY ] += c[0]+1;
+ oi[ OCOL_GX ] += c[1];
+ oi[ OCOL_GY ] += c[0];
oi[ OCOL_GXX ] += sc[1] * sc[1];
oi[ OCOL_GYY ] += sc[0] * sc[0];
oi[ OCOL_GXY ] += sc[1] * sc[0];
if(p->clumps && *C>0)
{
- oi[ OCOL_C_GX ] += c[1]+1;
- oi[ OCOL_C_GY ] += c[0]+1;
+ oi[ OCOL_C_GX ] += c[1];
+ oi[ OCOL_C_GY ] += c[0];
}
@@ -217,8 +217,8 @@ mkcatalog_first_pass(struct mkcatalog_passparams *pp)
{
oi[ OCOL_NUMPOS ]++;
oi[ OCOL_SUMPOS ] += ss;
- oi[ OCOL_VX ] += ss * c[1]+1;
- oi[ OCOL_VY ] += ss * c[0]+1;
+ oi[ OCOL_VX ] += ss * c[1];
+ oi[ OCOL_VY ] += ss * c[0];
oi[ OCOL_VXX ] += ss * sc[1] * sc[1];
oi[ OCOL_VYY ] += ss * sc[0] * sc[0];
oi[ OCOL_VXY ] += ss * sc[1] * sc[0];
@@ -226,8 +226,8 @@ mkcatalog_first_pass(struct mkcatalog_passparams *pp)
{
oi[ OCOL_C_NUMPOS ]++;
oi[ OCOL_C_SUMPOS ] += ss;
- oi[ OCOL_C_VX ] += ss * (c[1]+1);
- oi[ OCOL_C_VY ] += ss * (c[0]+1);
+ oi[ OCOL_C_VX ] += ss * c[1];
+ oi[ OCOL_C_VY ] += ss * c[0];
}
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnuastro-commits] master fb2a4a7: MakeCatalog first pass coordinate increment in shift loop,
Mohammad Akhlaghi <=