gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master 3e05560 003/125: Corrected bad use of type in


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 3e05560 003/125: Corrected bad use of type in MakeProfiles
Date: Sun, 23 Apr 2017 22:36:24 -0400 (EDT)

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

    Corrected bad use of type in MakeProfiles
    
    In MakeProfiles, the `type' name was used in two contexts: one for the
    datatype (which is expected), but another case was in the radial function
    type! This could cause confusion and was a bad practice. So with this
    commit, all occurances of the latter case have been changed to `func'.
---
 bin/mkprof/main.h       |  2 +-
 bin/mkprof/mkprof.h     |  2 +-
 bin/mkprof/oneprofile.c | 12 ++++++------
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/bin/mkprof/main.h b/bin/mkprof/main.h
index 73d9ab7..0fe466c 100644
--- a/bin/mkprof/main.h
+++ b/bin/mkprof/main.h
@@ -71,7 +71,7 @@ struct builtqueue
   long        fpixel_i[2];    /* First pixel in output image.        */
   long        lpixel_i[2];    /* Last pixel in output image.         */
   long        fpixel_o[2];    /* First pixel in this array.          */
-  int                type;    /* The type of the profile.            */
+  int                func;    /* Profile's radial function.          */
 
   int        indivcreated;    /* ==1: an individual file is created. */
   size_t          numaccu;    /* Number of accurate pixels.          */
diff --git a/bin/mkprof/mkprof.h b/bin/mkprof/mkprof.h
index 5092e40..7ab17a2 100644
--- a/bin/mkprof/mkprof.h
+++ b/bin/mkprof/mkprof.h
@@ -48,7 +48,7 @@ struct mkonthread
   long           width[2];   /* The width of the enclosing box.       */
   float          peakflux;   /* Flux at profile peak.                 */
   float        brightness;   /* The brightness of the profile.        */
-  int                type;   /* The type of the profile.              */
+  int                func;   /* Radial function of the profile.       */
   long            *onaxes;   /* Sides of the unover-sampled image.    */
   long        fpixel_i[2];   /* fpixel_i before running overlap.      */
   int          correction;   /* ==1: correct the pixels afterwards.   */
diff --git a/bin/mkprof/oneprofile.c b/bin/mkprof/oneprofile.c
index ef42c83..32481bf 100644
--- a/bin/mkprof/oneprofile.c
+++ b/bin/mkprof/oneprofile.c
@@ -250,7 +250,7 @@ makepixbypix(struct mkonthread *mkp)
   p=x*mkp->width[0]+y;
 
   /* If this is a point source, just fill that one pixel and go. */
-  if(mkp->type==POINTCODE)
+  if(mkp->func==POINTCODE)
     { img[p]=1; return; }
 
   /* Allocate the byt array to not repeat completed pixels. */
@@ -266,8 +266,8 @@ makepixbypix(struct mkonthread *mkp)
   gal_linkedlist_add_to_tosll_end( &lQ, &sQ, p, r_circle(p, mkp) );
 
   /* If random points are necessary, then do it: */
-  if(mkp->type==SERSICCODE || mkp->type==MOFFATCODE
-     || mkp->type==GAUSSIANCODE)
+  if(mkp->func==SERSICCODE || mkp->func==MOFFATCODE
+     || mkp->func==GAUSSIANCODE)
     {
       while(sQ)
         {
@@ -353,7 +353,7 @@ makepixbypix(struct mkonthread *mkp)
           /* For the circumference, if the profile is too elongated
              and circumwidth is too small, then some parts of the
              circumference will not be shown without this condition. */
-          if(mkp->type==CIRCUMFERENCECODE) img[p]=profile(mkp);
+          if(mkp->func==CIRCUMFERENCECODE) img[p]=profile(mkp);
           continue;
         }
 
@@ -435,11 +435,11 @@ setprofparams(struct mkonthread *mkp)
   mkp->q          = cat[p->qcol];
   mkp->brightness = pow( 10, (p->zeropoint - cat[p->mcol]) / 2.5f );
   mkp->ibq->ispsf = ispsf(cat[p->fcol]);
-  mkp->type       = mkp->ibq->type=cat[p->fcol];
+  mkp->func       = mkp->ibq->func=cat[p->fcol];
 
 
   /* Fill the profile dependent parameters. */
-  switch (mkp->type)
+  switch (mkp->func)
     {
     case SERSICCODE:
       mkp->correction       = 1;



reply via email to

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