gnuastro-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnuastro-commits] master fb7301a: Corrected type of circumwidth in Make


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master fb7301a: Corrected type of circumwidth in MakeProfiles
Date: Fri, 16 Mar 2018 18:34:11 -0400 (EDT)

branch: master
commit fb7301a42059cfd5ac024bad95fb202bade5ee8b
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>

    Corrected type of circumwidth in MakeProfiles
    
    The type of `--circumwidth' in the options of MakeProfiles was defined to
    be `float', but in `main.h', it was `double'. Therefore the value was
    effectively being ignored (always read as zero, since only the first 4
    bytes were written and the endian-ness of my CPU). The type is now
    corrected and also the check is being made better to ignore pixels that are
    farther out than the truncation radius (can happen right on the edge and
    can be important for very small profiles).
---
 bin/mkprof/main.h     | 2 +-
 bin/mkprof/profiles.c | 3 ++-
 doc/gnuastro.texi     | 8 ++++----
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/bin/mkprof/main.h b/bin/mkprof/main.h
index 152162d..29a71f6 100644
--- a/bin/mkprof/main.h
+++ b/bin/mkprof/main.h
@@ -128,7 +128,7 @@ struct mkprofparams
   size_t             *shift;  /* Shift along axeses position of profiles. */
   uint8_t       prepforconv;  /* Shift and expand by size of first psf.   */
   float           zeropoint;  /* Magnitude of zero point flux.            */
-  double        circumwidth;  /* Width of circumference (inward).         */
+  float         circumwidth;  /* Width of circumference (inward).         */
   uint8_t           replace;  /* Replace overlaping profile pixel values. */
   uint8_t         magatpeak;  /* Mag only for peak pixel, not all profile.*/
   uint8_t           envseed;  /* Use GSL_RNG_SEED for random seed.        */
diff --git a/bin/mkprof/profiles.c b/bin/mkprof/profiles.c
index 13369a0..f350ddd 100644
--- a/bin/mkprof/profiles.c
+++ b/bin/mkprof/profiles.c
@@ -168,7 +168,8 @@ profiles_sersic(struct mkonthread *mkp)
 double
 profiles_circumference(struct mkonthread *mkp)
 {
-  return mkp->r > mkp->intruncr ? mkp->fixedvalue : 0.0f;
+  return ( (mkp->r > mkp->intruncr && mkp->r <= mkp->truncr)
+           ? mkp->fixedvalue : 0.0f );
 }
 
 
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index 0f17c04..efdc2ab 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -16801,10 +16801,10 @@ Point source with address@hidden' or address@hidden'.
 Flat profile with address@hidden' or address@hidden'.
 
 @item
-Circumference profile with address@hidden' or address@hidden'. A fixed
-value will be used for all pixels between the truncation radius
-(@mymath{r_t}) and @mymath{r_t-w} (@mymath{w} is the value to the
address@hidden).
+Circumference profile with address@hidden' or address@hidden'. A fixed value
+will be used for all pixels less than or equal to the truncation radius
+(@mymath{r_t}) and greater than @mymath{r_t-w} (@mymath{w} is the value to
+the @option{--circumwidth}).
 
 @item
 Radial distance profile with address@hidden' or address@hidden'. At the lowest



reply via email to

[Prev in Thread] Current Thread [Next in Thread]