gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master 042862a: Arithmetic program's operand function


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 042862a: Arithmetic program's operand function named properly
Date: Mon, 22 May 2017 14:55:09 -0400 (EDT)

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

    Arithmetic program's operand function named properly
    
    These functions were not following Gnuastro's standard naming convention
    (function's file name first part of name). So they were corrected.
    
    Also, the start of the "Invoking Warp" section of the book didn't have a
    short description, so one was added.
---
 bin/arithmetic/arithmetic.c | 22 +++++++++++-----------
 bin/arithmetic/operands.c   | 12 ++++++------
 bin/arithmetic/operands.h   |  6 +++---
 doc/gnuastro.texi           |  4 +++-
 4 files changed, 23 insertions(+), 21 deletions(-)

diff --git a/bin/arithmetic/arithmetic.c b/bin/arithmetic/arithmetic.c
index e501c7e..4c8bc6b 100644
--- a/bin/arithmetic/arithmetic.c
+++ b/bin/arithmetic/arithmetic.c
@@ -151,9 +151,9 @@ reversepolish(struct imgarithparams *p)
          list. Otherwise, pull out two members and do the specified
          operation on them. */
       if(gal_fits_name_is_fits(token->v))
-        add_operand(p, token->v, NULL);
+        operands_add(p, token->v, NULL);
       else if( (d1=gal_data_copy_string_to_number(token->v)) )
-        add_operand(p, NULL, d1);
+        operands_add(p, NULL, d1);
       else
         {
 
@@ -287,18 +287,18 @@ reversepolish(struct imgarithparams *p)
           switch(nop)
             {
             case 1:
-              d1=pop_operand(p, token->v);
+              d1=operands_pop(p, token->v);
               break;
 
             case 2:
-              d2=pop_operand(p, token->v);
-              d1=pop_operand(p, token->v);
+              d2=operands_pop(p, token->v);
+              d1=operands_pop(p, token->v);
               break;
 
             case 3:
-              d3=pop_operand(p, token->v);
-              d2=pop_operand(p, token->v);
-              d1=pop_operand(p, token->v);
+              d3=operands_pop(p, token->v);
+              d2=operands_pop(p, token->v);
+              d1=operands_pop(p, token->v);
               break;
 
             case -1:
@@ -307,10 +307,10 @@ reversepolish(struct imgarithparams *p)
                  number, we will use that to construct a linked list of any
                  number of operands within the single `d1' pointer. */
               d1=NULL;
-              numop=set_number_of_operands(p, pop_operand(p, token->v),
+              numop=set_number_of_operands(p, operands_pop(p, token->v),
                                            token->v);
               for(i=0;i<numop;++i)
-                gal_list_data_add(&d1, pop_operand(p, token->v));
+                gal_list_data_add(&d1, operands_pop(p, token->v));
               break;
 
             default:
@@ -323,7 +323,7 @@ reversepolish(struct imgarithparams *p)
              arguments it uses depend on the operator. So when the operator
              doesn't need three operands, the extra arguments will be
              ignored. */
-          add_operand(p, NULL, gal_arithmetic(op, flags, d1, d2, d3));
+          operands_add(p, NULL, gal_arithmetic(op, flags, d1, d2, d3));
         }
     }
 
diff --git a/bin/arithmetic/operands.c b/bin/arithmetic/operands.c
index b4e025e..73e1514 100644
--- a/bin/arithmetic/operands.c
+++ b/bin/arithmetic/operands.c
@@ -42,7 +42,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 size_t
-num_operands(struct imgarithparams *p)
+operands_num(struct imgarithparams *p)
 {
   size_t counter=0;
   struct operand *tmp=NULL;
@@ -56,7 +56,7 @@ num_operands(struct imgarithparams *p)
 
 
 void
-add_operand(struct imgarithparams *p, char *filename, gal_data_t *data)
+operands_add(struct imgarithparams *p, char *filename, gal_data_t *data)
 {
   struct operand *newnode;
 
@@ -96,7 +96,7 @@ add_operand(struct imgarithparams *p, char *filename, 
gal_data_t *data)
 
 
 gal_data_t *
-pop_operand(struct imgarithparams *p, char *operator)
+operands_pop(struct imgarithparams *p, char *operator)
 {
   size_t i;
   gal_data_t *data;
@@ -155,14 +155,14 @@ pop_operand(struct imgarithparams *p, char *operator)
             p->refdata.dsize[i]=data->dsize[i];
         }
 
+      /* Report the read image if desired: */
+      if(!p->cp.quiet) printf(" - %s (hdu %s) is read.\n", filename, hdu);
+
       /* Free the HDU string: */
       free(hdu);
 
       /* Add to the number of popped FITS images: */
       ++p->popcounter;
-
-      /* Report the read image if desired: */
-      if(!p->cp.quiet) printf(" - %s is read.\n", filename);
     }
   else
     data=operands->data;
diff --git a/bin/arithmetic/operands.h b/bin/arithmetic/operands.h
index 6b6f6e0..8ea6e97 100644
--- a/bin/arithmetic/operands.h
+++ b/bin/arithmetic/operands.h
@@ -24,13 +24,13 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #define OPERANDS_H
 
 size_t
-num_operands(struct imgarithparams *p);
+operands_num(struct imgarithparams *p);
 
 void
-add_operand(struct imgarithparams *p, char *filename, gal_data_t *data);
+operands_add(struct imgarithparams *p, char *filename, gal_data_t *data);
 
 gal_data_t *
-pop_operand(struct imgarithparams *p, char *operator);
+operands_pop(struct imgarithparams *p, char *operator);
 
 
 #endif
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index 66c1aec..cff80b2 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -10811,7 +10811,9 @@ applications, see @ref{PSF}.
 @node Invoking astwarp,  , Resampling, Warp
 @subsection Invoking Warp
 
-The general template for invoking Warp is:
+Warp an input dataset into a new grid. Any homographic warp (for example
+scaling, rotation, translation, projection) is acceptable, see @ref{Warping
+basics} for the definitions. The general template for invoking Warp is:
 
 @example
 $ astwarp [OPTIONS...] InputImage



reply via email to

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