gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master ffee29c3 2/2: Book: Modified the function for


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master ffee29c3 2/2: Book: Modified the function for its new parameters
Date: Wed, 10 Jan 2024 13:12:52 -0500 (EST)

branch: master
commit ffee29c315390b70fbde4fc415bb813da5d79c43
Author: Faezeh Bidjarchian <fbidjarchian@gmail.com>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    Book: Modified the function for its new parameters
    
    Until now, the recent changes in 'gal_fits_img_write' were not yet fully
    implemented in some parts of the book. There were some typos and
    inconsistencies between the comment formats of the top-level function of
    some of the program's source.
    
    With this commit, these have been corrected.
---
 bin/TEMPLATE/TEMPLATE.c       |  7 +++++++
 bin/TEMPLATE/main.c           |  2 +-
 bin/arithmetic/arithmetic.c   |  2 +-
 bin/buildprog/buildprog.c     |  3 +++
 bin/convertt/convertt.c       |  8 ++++----
 bin/convolve/convolve.c       |  2 +-
 bin/cosmiccal/cosmiccal.c     |  7 +++----
 bin/crop/crop.c               |  5 +++--
 bin/fits/fits.c               | 19 +++++++++++--------
 bin/match/match.c             |  2 +-
 bin/mkprof/mkprof.c           |  2 +-
 bin/noisechisel/noisechisel.c |  2 +-
 bin/query/query.c             |  3 +++
 bin/segment/segment.c         |  2 +-
 bin/statistics/statistics.c   |  2 +-
 bin/table/table.c             |  6 +++---
 bin/warp/warp.c               | 10 +++++-----
 doc/gnuastro.texi             | 10 +++++-----
 18 files changed, 55 insertions(+), 39 deletions(-)

diff --git a/bin/TEMPLATE/TEMPLATE.c b/bin/TEMPLATE/TEMPLATE.c
index 66499ea8..2b52b83e 100644
--- a/bin/TEMPLATE/TEMPLATE.c
+++ b/bin/TEMPLATE/TEMPLATE.c
@@ -27,6 +27,13 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #include <main.h>
 
+
+
+
+
+/*******************************************************************/
+/*************            Top-level function           *************/
+/*******************************************************************/
 void
 TEMPLATE(struct TEMPLATEparams *p)
 {
diff --git a/bin/TEMPLATE/main.c b/bin/TEMPLATE/main.c
index 463d895d..9c496bd2 100644
--- a/bin/TEMPLATE/main.c
+++ b/bin/TEMPLATE/main.c
@@ -33,7 +33,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #include "TEMPLATE.h"
 
 
-/* Main function */
+/* Main function. */
 int
 main (int argc, char *argv[])
 {
diff --git a/bin/arithmetic/arithmetic.c b/bin/arithmetic/arithmetic.c
index 08369bb1..7b7c2784 100644
--- a/bin/arithmetic/arithmetic.c
+++ b/bin/arithmetic/arithmetic.c
@@ -2092,7 +2092,7 @@ reversepolish(struct arithmeticparams *p)
 
 
 /***************************************************************/
-/*************             Top function            *************/
+/*************         Top-level function          *************/
 /***************************************************************/
 void
 arithmetic(struct arithmeticparams *p)
diff --git a/bin/buildprog/buildprog.c b/bin/buildprog/buildprog.c
index 3f922cc2..3759cfb9 100644
--- a/bin/buildprog/buildprog.c
+++ b/bin/buildprog/buildprog.c
@@ -68,6 +68,9 @@ buildprog_as_one_string(char *opt, gal_list_str_t *list)
 
 
 
+/*******************************************************************/
+/*************            Top-level function           *************/
+/*******************************************************************/
 /* Create the build command and run it.
 
    Necessity of CONFIG_GNUASTRO_LDADD: By default Libtool will look into
diff --git a/bin/convertt/convertt.c b/bin/convertt/convertt.c
index 71f71ac1..2fef58f2 100644
--- a/bin/convertt/convertt.c
+++ b/bin/convertt/convertt.c
@@ -305,7 +305,7 @@ convertt_scale_to_uchar(struct converttparams *p)
 
 
 /**************************************************************/
-/**************           Main function         ***************/
+/**************       Top-level function        ***************/
 /**************************************************************/
 void
 convertt(struct converttparams *p)
@@ -343,7 +343,7 @@ convertt(struct converttparams *p)
       gal_txt_write(p->chll, NULL, NULL, p->cp.output, 0, 1, 0);
       break;
 
-    /* JPEG: */
+    /* JPEG. */
     case OUT_FORMAT_JPEG:
       if(p->colormap) color_map_prepare(p);
       else convertt_scale_to_uchar(p);
@@ -358,14 +358,14 @@ convertt(struct converttparams *p)
                     0, p->marks);
       break;
 
-    /* PDF */
+    /* PDF. */
     case OUT_FORMAT_PDF:
       if(p->colormap) color_map_prepare(p); else convertt_scale_to_uchar(p);
       gal_pdf_write(p->chll, p->cp.output, p->widthincm, p->borderwidth,
                     p->bordercolor, p->forcemin || p->forcemax, p->marks);
       break;
 
-    /* TIFF */
+    /* TIFF. */
     case OUT_FORMAT_TIFF:
       if(p->colormap) color_map_prepare(p); else convertt_scale_to_uchar(p);
       gal_tiff_write(p->chll, p->cp.output);
diff --git a/bin/convolve/convolve.c b/bin/convolve/convolve.c
index af028a9b..ac99c027 100644
--- a/bin/convolve/convolve.c
+++ b/bin/convolve/convolve.c
@@ -811,7 +811,7 @@ convolve_spatial(struct convolveparams *p)
 
 
 /******************************************************************/
-/*************          Outside function          *****************/
+/*************         Top-level function         *****************/
 /******************************************************************/
 void
 convolve(struct convolveparams *p)
diff --git a/bin/cosmiccal/cosmiccal.c b/bin/cosmiccal/cosmiccal.c
index 1ace8635..a281903d 100644
--- a/bin/cosmiccal/cosmiccal.c
+++ b/bin/cosmiccal/cosmiccal.c
@@ -44,10 +44,6 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 
-
-/**************************************************************/
-/************            Main function            *************/
-/**************************************************************/
 static void
 cosmiccal_print_input(struct cosmiccalparams *p)
 {
@@ -146,6 +142,9 @@ cosmiccal_printall(struct cosmiccalparams *p)
 
 
 
+/***************************************************************/
+/*************         Top-level function          *************/
+/***************************************************************/
 void
 cosmiccal(struct cosmiccalparams *p)
 {
diff --git a/bin/crop/crop.c b/bin/crop/crop.c
index fde78e53..229799da 100644
--- a/bin/crop/crop.c
+++ b/bin/crop/crop.c
@@ -44,6 +44,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 
+
 /* Write the log entry for each crop.
 
    A maximum length of FILENAME_BUFFER_IN_VERB characters is set for the
@@ -392,12 +393,12 @@ crop_mode_wcs(void *inparam)
 
 
 /*******************************************************************/
-/**************           Output function           ****************/
+/**************         Top-level function          ****************/
 /*******************************************************************/
 /* Main function for the Image Mode. It is assumed that if only one
    crop box from each input image is desired, the first and last
    pixels are already set, irrespective of how the user specified that
-   box.  */
+   box. */
 void
 crop(struct cropparams *p)
 {
diff --git a/bin/fits/fits.c b/bin/fits/fits.c
index 2a839b8f..8725d287 100644
--- a/bin/fits/fits.c
+++ b/bin/fits/fits.c
@@ -178,7 +178,7 @@ fits_print_extension_info(struct fitsparams *p)
         }
 
 
-      /* Read the extension name*/
+      /* Read the extension name. */
       fits_read_keyword(fptr, "EXTNAME", extname, NULL, &status);
       switch(status)
         {
@@ -206,7 +206,7 @@ fits_print_extension_info(struct fitsparams *p)
         case 0:
           /* For tables, we don't bother reading 'BUNIT', because it is
              meaningless even if it exists (each colum has its separate
-             units). So 'status' will be zero in this case.*/
+             units). So 'status' will be zero in this case. */
           if(hdutype==IMAGE_HDU)
             gal_fits_key_clean_str_value(bunit);
           else /* Its a table HDU. */
@@ -407,7 +407,7 @@ fits_pixelscale(struct fitsparams *p)
 
   /* If not in quiet-mode, print some extra information. We don't want the
      last number to have a space after it, so we'll write the last one
-     outside the loop.*/
+     outside the loop. */
   if(p->cp.quiet==0)
     {
       printf("Basic information for --pixelscale (remove extra info "
@@ -527,7 +527,7 @@ fits_pixelarea(struct fitsparams *p)
   /* Calculate the pixel-scale in each dimension. */
   pixelscale=gal_wcs_pixel_scale(wcs);
 
-  /* Calcluate the pixel area (currently only in arcsec^N) */
+  /* Calcluate the pixel area (currently only in arcsec^N). */
   area=1;
   for(i=0;i<ndim;++i) area *= pixelscale[i]*3600;
   printf("%g\n", area);
@@ -648,7 +648,7 @@ fits_certain_hdu(struct fitsparams *p, int list1has0,
   int has=0, naxis, hducounter=1, hdutype, status=0;
 
   /* Make sure the given file exists: CFITSIO adds '.gz' silently (see more
-     in the comments within 'gal_fits_hdu_open')*/
+     in the comments within 'gal_fits_hdu_open'). */
   gal_checkset_check_file(p->input->v);
 
   /* Open the FITS file. */
@@ -740,7 +740,7 @@ fits_list_all_hdus(struct fitsparams *p)
   int hducounter=1, hdutype, status=0;
 
   /* Make sure the given file exists: CFITSIO adds '.gz' silently (see more
-     in the comments within 'gal_fits_hdu_open')*/
+     in the comments within 'gal_fits_hdu_open'). */
   gal_checkset_check_file(p->input->v);
 
   /* Open the FITS file. */
@@ -802,7 +802,7 @@ fits_hdu_remove(struct fitsparams *p, int *r)
 
 
 /* This is similar to the library's 'gal_fits_open_to_write', except that
-   it won't create an empty first extension.*/
+   it won't create an empty first extension. */
 fitsfile *
 fits_open_to_write_no_blank(char *filename)
 {
@@ -851,7 +851,7 @@ fits_hdu_copy(struct fitsparams *p, int cut1_copy0, int *r)
       in=gal_fits_hdu_open(p->input->v, hdu,
                            cut1_copy0 ? READWRITE : READONLY, 1, hopt);
 
-      /* If the output isn't opened yet, open it.  */
+      /* If the output isn't opened yet, open it. */
       if(out==NULL)
         out = ( ( gal_fits_hdu_format(p->input->v, hdu, hopt)==IMAGE_HDU
                   && p->primaryimghdu )
@@ -884,6 +884,9 @@ fits_hdu_copy(struct fitsparams *p, int cut1_copy0, int *r)
 
 
 
+/***************************************************************/
+/*************         Top-level function          *************/
+/***************************************************************/
 int
 fits(struct fitsparams *p)
 {
diff --git a/bin/match/match.c b/bin/match/match.c
index fc8d15b5..9bf4c6ff 100644
--- a/bin/match/match.c
+++ b/bin/match/match.c
@@ -861,7 +861,7 @@ match_catalog(struct matchparams *p)
 
 
 /*******************************************************************/
-/*************            Top level function           *************/
+/*************            Top-level function           *************/
 /*******************************************************************/
 void
 match(struct matchparams *p)
diff --git a/bin/mkprof/mkprof.c b/bin/mkprof/mkprof.c
index 7e17e923..6dfcfd18 100644
--- a/bin/mkprof/mkprof.c
+++ b/bin/mkprof/mkprof.c
@@ -759,7 +759,7 @@ mkprof_write(struct mkprofparams *p)
 
 
 /**************************************************************/
-/************           Outside function          *************/
+/************         Top-level function          *************/
 /**************************************************************/
 void
 mkprof(struct mkprofparams *p)
diff --git a/bin/noisechisel/noisechisel.c b/bin/noisechisel/noisechisel.c
index cfa77400..1e0af5f6 100644
--- a/bin/noisechisel/noisechisel.c
+++ b/bin/noisechisel/noisechisel.c
@@ -237,7 +237,7 @@ noisechisel_output(struct noisechiselparams *p)
 
 
 /***********************************************************************/
-/*************             High level function           ***************/
+/*************             Top-level function            ***************/
 /***********************************************************************/
 void
 noisechisel(struct noisechiselparams *p)
diff --git a/bin/query/query.c b/bin/query/query.c
index addfb068..3429c0b2 100644
--- a/bin/query/query.c
+++ b/bin/query/query.c
@@ -366,6 +366,9 @@ query_output_finalize(struct queryparams *p)
 
 
 
+/***************************************************************/
+/*************         Top-level function          *************/
+/***************************************************************/
 void
 query(struct queryparams *p)
 {
diff --git a/bin/segment/segment.c b/bin/segment/segment.c
index c81069d9..cf0ee1df 100644
--- a/bin/segment/segment.c
+++ b/bin/segment/segment.c
@@ -1481,7 +1481,7 @@ segment_output(struct segmentparams *p)
 
 
 /***********************************************************************/
-/*****************         High level function         *****************/
+/*****************         Top-level function          *****************/
 /***********************************************************************/
 void
 segment(struct segmentparams *p)
diff --git a/bin/statistics/statistics.c b/bin/statistics/statistics.c
index b410959e..59843bae 100644
--- a/bin/statistics/statistics.c
+++ b/bin/statistics/statistics.c
@@ -1887,7 +1887,7 @@ statistics_fit(struct statisticsparams *p)
 
 
 /*******************************************************************/
-/**************             Main function            ***************/
+/**************          Top-level function          ***************/
 /*******************************************************************/
 void
 statistics(struct statisticsparams *p)
diff --git a/bin/table/table.c b/bin/table/table.c
index bef27645..eef70215 100644
--- a/bin/table/table.c
+++ b/bin/table/table.c
@@ -1538,9 +1538,6 @@ table_txt_formats(struct tableparams *p)
 
 
 
-/**************************************************************/
-/***************       Top function         *******************/
-/**************************************************************/
 void
 table_column(struct tableparams *p)
 {
@@ -1588,6 +1585,9 @@ table_row(struct tableparams *p)
 
 
 
+/***************************************************************/
+/*************         Top-level function          *************/
+/***************************************************************/
 void
 table(struct tableparams *p)
 {
diff --git a/bin/warp/warp.c b/bin/warp/warp.c
index bed07d1f..e80d6bc2 100644
--- a/bin/warp/warp.c
+++ b/bin/warp/warp.c
@@ -50,7 +50,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 /***************************************************************/
 /* Multiply a 2 element vector with a transformation matrix and put the
    result in the 2 element output array. It is assumed that the input is
-   from a flat coordinate systemy. */
+   from a flat coordinate system. */
 #define WARP_MAPPOINT(V, T, O)                                  \
   {                                                             \
     (O)[0]=( ( (T)[0]*(V)[0] + (T)[1]*(V)[1] + (T)[2] )         \
@@ -526,7 +526,7 @@ warp_write_wcs_linear(struct warpparams *p)
 
 
 /***************************************************************/
-/**************       Outside function        ******************/
+/**************      Top-level function       ******************/
 /***************************************************************/
 void
 warp(struct warpparams *p)
@@ -537,7 +537,7 @@ warp(struct warpparams *p)
   /* Do the preparations and set the pointers to the functions to use. */
   if( p->wcsalign )
     {
-      /* Calculate and allocate the output image size and WCS */
+      /* Calculate and allocate the output image size and WCS. */
       if(!p->cp.quiet)
         {
           gal_timing_report(NULL, "Initializing the output image...", 1);
@@ -545,7 +545,7 @@ warp(struct warpparams *p)
         }
       gal_warp_wcsalign_init(wa);
 
-      /* Fill the output image */
+      /* Fill the output image. */
       if(!p->cp.quiet)
         {
           gal_timing_report(&t0, "Done", 2);
@@ -572,7 +572,7 @@ warp(struct warpparams *p)
                            p->cp.numthreads, p->cp.minmapsize,
                            p->cp.quietmmap);
 
-      /* Fix the linear matrix before saving the output image to disk */
+      /* Fix the linear matrix before saving the output image to disk. */
       warp_write_wcs_linear(p);
     }
 
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index c9c2e6e1..5a94562e 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -38608,7 +38608,7 @@ This ancillary information about the contents of the 
memory location is very use
 However, @code{void *} is just a raw address (pointer), it contains no 
information on the contents it points to.
 
 These properties make the @code{void *} very useful when you want to treat the 
contents of an address in different ways.
-You can use the @code{void *} list defined in this section and its function on 
any kind of data: for example you can use it to keep a list of custom data 
structures that you have built for your own separate program.
+You can use the @code{void *} list defined in this section and its function on 
any kind of data: for example, you can use it to keep a list of custom data 
structures that you have built for your own separate program.
 Each node in the list can keep anything and this gives you great versatility.
 But in using @code{void *}, please beware that ``with great power comes great 
responsibility''.
 
@@ -40550,7 +40550,7 @@ inwcs=gal_wcs_read("image.fits", "1", 0, 0, 0, &nwcs);
 data->wcs=gal_wcs_distortion_convert(inwcs, GAL_WCS_DISTORTION_TPV,
                                      NULL);
 wcsfree(inwcs);
-gal_fits_img_write(data, "tpv.fits", NULL, NULL);
+gal_fits_img_write(data, "tpv.fits", NULL, 0);
 @end example
 
 @end deftypefun
@@ -41091,7 +41091,7 @@ main(void)
   out2=gal_arithmetic(GAL_ARITHMETIC_OP_PLUS, 1, flag, in2, out1);
 
   /* Write the output into a file. */
-  gal_fits_img_write(out2, "out.fits", NULL, NULL);
+  gal_fits_img_write(out2, "out.fits", NULL, 0);
 
   /* Clean up. Due to the in-place flag (in
    * 'GAL_ARITHMETIC_FLAGS_BASIC'), 'out1' and 'out2' point to the
@@ -45005,7 +45005,7 @@ main(void)
 
   /* WARNING: make sure there is no file with same name as 'out.fits'
    * or the result will be appended to its final HDU. */
-  gal_fits_img_write(wa.output, outname, NULL, "warp-demo");
+  gal_fits_img_write(wa.output, outname, NULL, 0);
 
   /* Clean up. */
   gal_data_free(wa.input);
@@ -45138,7 +45138,7 @@ main(void)
 
   /* WARNING: make sure there is no file with same name as 'out.fits'
    * or the result will be appended to its final HDU. */
-  gal_fits_img_write(wa.output, outname, NULL, "warp-demo");
+  gal_fits_img_write(wa.output, outname, NULL, 0);
 
 
   /* Remove the pointers to arrays that we didn't allocate (and thus,



reply via email to

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