gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master c0dd6db 102/125: The noedgecorrection option i


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master c0dd6db 102/125: The noedgecorrection option in spatial domain convolution
Date: Sun, 23 Apr 2017 22:36:48 -0400 (EDT)

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

    The noedgecorrection option in spatial domain convolution
    
    In the old implementation of spatial convolution we had a
    `--noedgecorrection' option to avoid corrections on the edge of a
    region. But it was not implemented in the new re-write. So with this
    commit, it is included. The description of the old `mesh' options were also
    removed from the `Mesh grid section' of the book (in the previous commit we
    the new tile options are discussed as part of the common options).
    
    Within the Convolve program, edge correction is the default in the spatial
    domain and the user can disable it with the `--noedgecorrection'
    option. However, in the library function `gal_convolve_spatial', the user
    must pass a value of `1' to the `edgecorrection' argument to have edge
    correction. This is done because a library user is generally looking for a
    more raw/generic processing, while the program user will usually choose
    spatial domain over frequency domain because of the edge correction
    feature, so this is more convenient for them. Ofcourse the program behavior
    can easily be changed to the library behavior if there is demand.
    
    In the process, I tried compiling without the debugging flag and
    optimization. The compiler made some interesting new warnings about
    non-initialized variables that are also now corrected.
---
 bin/convertt/eps.c          |  30 +++++-----
 bin/convertt/ui.c           |   4 +-
 bin/convolve/args.h         |  13 +++++
 bin/convolve/convolve.c     |   7 ++-
 bin/convolve/main.h         |   1 +
 bin/convolve/ui.h           |   3 +-
 bin/fits/fits.c             |   4 +-
 bin/mkprof/ui.c             |   4 +-
 bin/statistics/statistics.c |   4 +-
 doc/gnuastro.texi           | 132 +++++++++++++-------------------------------
 lib/convolve.c              |  16 ++++--
 lib/gnuastro/convolve.h     |   2 +-
 lib/statistics.c            |   6 +-
 lib/txt.c                   |   2 +-
 tmpfs-config-make           |   5 +-
 15 files changed, 102 insertions(+), 131 deletions(-)

diff --git a/bin/convertt/eps.c b/bin/convertt/eps.c
index e764837..a3155e8 100644
--- a/bin/convertt/eps.c
+++ b/bin/convertt/eps.c
@@ -240,7 +240,7 @@ eps_write_hex(struct converttparams *p, FILE *fp, size_t 
size)
 {
   unsigned char *in;
   gal_data_t *channel;
-  size_t i, elem_for_newline=35;
+  size_t i=0, j, elem_for_newline=35;
 
   for(channel=p->chll; channel!=NULL; channel=channel->next)
     {
@@ -250,13 +250,14 @@ eps_write_hex(struct converttparams *p, FILE *fp, size_t 
size)
         {
           in=channel->array;
           fprintf(fp, "{<");
-          for(i=0;i<size;++i)
+          for(j=0;j<size;++j)
             {
-              fprintf(fp, "%02X", in[i]);
-              if(i%elem_for_newline==0) fprintf(fp, "\n");
+              fprintf(fp, "%02X", in[j]);
+              if(j%elem_for_newline==0) fprintf(fp, "\n");
             }
           fprintf(fp, ">}\n");
         }
+      ++i;
     }
 }
 
@@ -270,7 +271,7 @@ eps_write_ascii85(struct converttparams *p, FILE *fp, 
size_t size)
   unsigned char *in;
   gal_data_t *channel;
   uint32_t anint, base;
-  size_t i, j, elem_for_newline=15;   /* 15*5=75 */
+  size_t i=0, j, k, elem_for_newline=15;   /* 15*5=75 */
 
   for(channel=p->chll; channel!=NULL; channel=channel->next)
     {
@@ -280,18 +281,18 @@ eps_write_ascii85(struct converttparams *p, FILE *fp, 
size_t size)
         {
           in=channel->array;
           fprintf(fp, "{<~");
-          for(i=0;i<size;i+=4)
+          for(j=0;j<size;j+=4)
             {
               /* This is the last four bytes */
-              if(size-i<4)
+              if(size-j<4)
                 {
-                  anint=in[i]*256*256*256;
-                  if(size-i>1)  anint+=in[i+1]*256*256;
-                  if(size-i==3) anint+=in[i+2]*256;
+                  anint=in[j]*256*256*256;
+                  if(size-j>1)  anint+=in[j+1]*256*256;
+                  if(size-j==3) anint+=in[j+2]*256;
                 }
               else
-                anint=( in[i]*256*256*256 + in[i+1]*256*256
-                        + in[i+2]*256     + in[i+3]         );
+                anint=( in[j]*256*256*256 + in[j+1]*256*256
+                        + in[j+2]*256     + in[j+3]         );
 
               /* If all four bytes are zero, then just print `z'. */
               if(anint==0) fprintf(fp, "z");
@@ -304,7 +305,7 @@ eps_write_ascii85(struct converttparams *p, FILE *fp, 
size_t size)
                   */
                   base=85*85*85*85;
                   /* Do the ASCII85 encoding: */
-                  for(j=0;j<5;++j)
+                  for(k=0;k<5;++k)
                     {
                       fprintf(fp, "%c", anint/base+33);
                       anint%=base;
@@ -312,10 +313,11 @@ eps_write_ascii85(struct converttparams *p, FILE *fp, 
size_t size)
                     }
                 }
               /* Go to the next line if on the right place: */
-              if(i%elem_for_newline==0) fprintf(fp, "\n");
+              if(j%elem_for_newline==0) fprintf(fp, "\n");
             }
           fprintf(fp, "~>}\n");
         }
+      ++i;
     }
 }
 
diff --git a/bin/convertt/ui.c b/bin/convertt/ui.c
index 1474a6a..dfff6d0 100644
--- a/bin/convertt/ui.c
+++ b/bin/convertt/ui.c
@@ -315,7 +315,7 @@ ui_make_change_struct(char *arg)
   char *p=arg;
   gal_data_t *data;
   size_t len=0, counter=0;
-  struct change *out, *last=NULL, *ch;
+  struct change *out=NULL, *last=NULL, *ch;
 
   /* First set all the delimiters to `\0' and count the number of
      characters in the full string. */
@@ -506,7 +506,7 @@ static void
 ui_prepare_input_channels(struct converttparams *p)
 {
   struct wcsprm *wcs=NULL;
-  size_t i, ndim, *dsize=NULL;
+  size_t i, ndim=0, *dsize=NULL;
   gal_data_t *tmp, *blank, *prev;
 
   /* Fill in the channels linked list. */
diff --git a/bin/convolve/args.h b/bin/convolve/args.h
index b898321..821eb06 100644
--- a/bin/convolve/args.h
+++ b/bin/convolve/args.h
@@ -116,6 +116,19 @@ struct argp_option program_options[] =
       GAL_OPTIONS_NOT_MANDATORY,
       GAL_OPTIONS_NOT_SET
     },
+    {
+      "noedgecorrection",
+      ARGS_OPTION_KEY_NOEDGECORRECTION,
+      0,
+      0,
+      "Do not correct the edges in the spatial domain",
+      GAL_OPTIONS_GROUP_OUTPUT,
+      &p->noedgecorrection,
+      GAL_OPTIONS_NO_ARG_TYPE,
+      GAL_OPTIONS_RANGE_0_OR_1,
+      GAL_OPTIONS_NOT_MANDATORY,
+      GAL_OPTIONS_NOT_SET
+    },
 
 
 
diff --git a/bin/convolve/convolve.c b/bin/convolve/convolve.c
index 8ab9007..83857de 100644
--- a/bin/convolve/convolve.c
+++ b/bin/convolve/convolve.c
@@ -784,9 +784,12 @@ convolve(struct convolveparams *p)
       if(p->tilesname)
         gal_tile_block_check_tiles(tiles, p->tilesname, PROGRAM_NAME);
 
-      /* Do the spatial convolution. */
+      /* Do the spatial convolution. One of the main reason someone would
+         want to do spatial domain convolution with this Convolve program
+         is edge correction. So by default we assume it and will only
+         ignore it if the user asks.*/
       out=gal_convolve_spatial(tiles, p->kernel, p->cp.numthreads,
-                               p->cp.workoverch);
+                               !p->noedgecorrection, p->cp.workoverch);
 
       /* Clean up */
       gal_data_free(p->input);
diff --git a/bin/convolve/main.h b/bin/convolve/main.h
index e978a4a..bcfd67d 100644
--- a/bin/convolve/main.h
+++ b/bin/convolve/main.h
@@ -81,6 +81,7 @@ struct convolveparams
   uint8_t     checkfreqsteps;  /* View the frequency domain steps.        */
   char            *domainstr;  /* String value specifying domain.         */
   size_t          makekernel;  /* Make a kernel to create input.          */
+  uint8_t   noedgecorrection;  /* Do not correct spatial edge effects.    */
 
   /* Internal */
   int                 domain;  /* Frequency or spatial domain conv.       */
diff --git a/bin/convolve/ui.h b/bin/convolve/ui.h
index 2721706..e557bd1 100644
--- a/bin/convolve/ui.h
+++ b/bin/convolve/ui.h
@@ -49,8 +49,7 @@ enum option_keys_enum
      automatically). */
   ARGS_OPTION_KEY_NOKERNELFLIP = 1000,
   ARGS_OPTION_KEY_NOKERNELNORM,
-  ARGS_OPTION_KEY_CHECKTILES,
-  ARGS_OPTION_KEY_CONVOVERCH,
+  ARGS_OPTION_KEY_NOEDGECORRECTION,
 };
 
 
diff --git a/bin/fits/fits.c b/bin/fits/fits.c
index c319ef7..6690246 100644
--- a/bin/fits/fits.c
+++ b/bin/fits/fits.c
@@ -42,7 +42,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 int
 fits_has_error(struct fitsparams *p, int actioncode, char *string, int status)
 {
-  char *action;
+  char *action=NULL;
   int r=EXIT_SUCCESS;
 
   switch(actioncode)
@@ -87,7 +87,7 @@ fits_print_extension_info(struct fitsparams *p)
   char **tstra, **estra, **sstra;
   size_t i, numext, *dsize, ndim;
   int j, nc, numhdu, hdutype, status=0, type;
-  char *msg, *tstr, *estr, sstr[1000], extname[FLEN_VALUE];
+  char *msg, *tstr=NULL, *estr=NULL, sstr[1000], extname[FLEN_VALUE];
 
 
   /* Open the FITS file and read the first extension type, upon moving to
diff --git a/bin/mkprof/ui.c b/bin/mkprof/ui.c
index bc97109..376bbdb 100644
--- a/bin/mkprof/ui.c
+++ b/bin/mkprof/ui.c
@@ -374,10 +374,10 @@ ui_read_profile_function(struct mkprofparams *p, char 
**strarr)
 static void
 ui_read_cols(struct mkprofparams *p)
 {
-  char *colname;
   int checkblank;
+  char *colname=NULL;
   size_t counter=0, i;
-  gal_data_t *cols, *tmp, *corrtype;
+  gal_data_t *cols, *tmp, *corrtype=NULL;
   char *ax1col=p->racol?p->racol:p->xcol;
   char *ax2col=p->deccol?p->deccol:p->ycol;
   struct gal_linkedlist_stll *colstrs=NULL;
diff --git a/bin/statistics/statistics.c b/bin/statistics/statistics.c
index 8caa2a5..f6deda4 100644
--- a/bin/statistics/statistics.c
+++ b/bin/statistics/statistics.c
@@ -89,7 +89,7 @@ statistics_print_one_row(struct statisticsparams *p)
   double arg, *d;
   float mirrdist=1.5;
   struct gal_linkedlist_ill *tmp;
-  gal_data_t *out, *tmpv, *num=NULL, *min=NULL, *max=NULL;
+  gal_data_t *tmpv, *out=NULL, *num=NULL, *min=NULL, *max=NULL;
   gal_data_t *sum=NULL, *med=NULL, *meanstd=NULL, *modearr=NULL;
 
 
@@ -278,7 +278,7 @@ print_ascii_plot(struct statisticsparams *p, gal_data_t 
*plot,
 static void
 ascii_plots(struct statisticsparams *p)
 {
-  gal_data_t *bins, *hist, *cfp;
+  gal_data_t *bins, *hist, *cfp=NULL;
 
   /* Make the bins and the respective plot. */
   bins=gal_statistics_regular_bins(p->input, NULL, p->numasciibins, NAN);
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index e91e5b9..2622685 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -8894,18 +8894,18 @@ only disperses them.
 @node Edges in the spatial domain,  , Convolution process, Spatial domain 
convolution
 @subsubsection Edges in the spatial domain
 
-In purely `linear' spatial filtering (convolution), there are problems
-on the edges of the input image. Here we will explain the problem in
-the spatial domain, see @ref{Edges in the frequency domain}. The
-problem originates from the fact that on the edges, in
address@hidden we assumed the overlapping pixels outside
-the input image have a value of zero.}, the sum of the weights we use
-on the actual image pixels is not unity. For example, as discussed
-above, a profile in the center of an image will have the same
-brightness before and after convolution. However, for a profile on the
-edge of the image, the brightness (sum of its pixel fluxes within the
-image, see @ref{Flux Brightness and magnitude}) will not be equal,
-some of the flux is going to be `eaten' by the edges.
+In purely `linear' spatial filtering (convolution), there are problems on
+the edges of the input image. Here we will explain the problem in the
+spatial domain. For a discussion of this problem from the frequency domain
+perspective, see @ref{Edges in the frequency domain}. The problem
+originates from the fact that on the edges, in address@hidden we
+assumed the overlapping pixels outside the input image have a value of
+zero.}, the sum of the weights we use on the actual image pixels is not
+unity. For example, as discussed above, a profile in the center of an image
+will have the same brightness before and after convolution. However, for
+partially imaged profile on the edge of the image, the brightness (sum of
+its pixel fluxes within the image, see @ref{Flux Brightness and magnitude})
+will not be equal, some of the flux is going to be `eaten' by the edges.
 
 If you ran @command{$ make check} on the source files of Gnuastro, you can
 see the this effect by comparing the @file{convolve_frequency.fits} with
@@ -8914,22 +8914,24 @@ spatial domain, by default, no assumption will be made 
about pixels outside
 of the image or any blank pixels in the image. The problem explained above
 will also occur on the sides of blank regions (see @ref{Blank pixels}). The
 solution to this edge effect problem is only possible in the spatial
-domain. We have to discard the assumption that the sum of the kernel pixels
-is unity during the convolution address@hidden the sum of the
-kernel pixels still have to be unity.}. So taking @mymath{W} as the sum of
-the kernel pixels that used non-blank and in-image pixels, the equation in
+domain. For pixels near the edge, we have to abandon the assumption that
+the sum of the kernel pixels is unity during the convolution
address@hidden the sum of the kernel pixels still have to be
+unity in general.}. So taking @mymath{W} as the sum of the kernel pixels
+that overlapped with non-blank and in-image pixels, the equation in
 @ref{Convolution process} will become:
 
 @dispmath{C_{x,y}= { \sum_{s=-a}^{a}\sum_{t=-b}^{b}K_{s,t}\times{}I_{x+s,y+t} 
\over W}.}
 
 @noindent
-In this manner, objects which are near the sides of the image or blank
-pixels will also have the same brightness (within the image) before
-and after convolution. This correction is applied by default in
-Convolve when convolving in the spatial domain. To disable it, you can
-use the @option{--noedgecorrection} option. In the frequency domain,
-there is no way to avoid this loss of flux near the edges of the
-image, see @ref{Edges in the frequency domain}.
+In this manner, objects which are near the edges of the image or blank
+pixels will also have the same brightness (within the image) before and
+after convolution. This correction is applied by default in Convolve when
+convolving in the spatial domain. To disable it, you can use the
address@hidden option. In the frequency domain, there is no
+way to avoid this loss of flux near the edges of the image, see @ref{Edges
+in the frequency domain} for an interpretation from the frequency domain
+perspective.
 
 Note that the edge effect discussed here is different from the one in
 @ref{If convolving afterwards}. In making mock images we want to
@@ -9971,23 +9973,14 @@ keep its value in at least one of the configuration 
files (see
 @ref{Configuration files}). By default, the system configuration file has a
 value.
 
address@hidden --fullconvolution
-Ignore the (possible) channels in the mesh grid when doing spatial
-convolution, see @ref{Tiling an image}. When applied over a mesh grid,
-spatial convolution will be done independently on each channel. This
-is necessary when the noise properties of each channel are different
-and so the pixels should not be mixed. With this option, all channel
-information is going to be ignored. Currently this option is not
-deployed for the frequency space convolutions.
-
 @end table
 
 
 @node Invoking astconvolve,  , Convolution kernel, Convolve
 @subsection Invoking Convolve
 
-Convolve an input image with a known kernel. The general template for
-Convolve is:
+Convolve an input image with a known kernel or make the kernel necessary to
+match two PSFs. The general template for Convolve is:
 
 @example
 $ astconvolve [OPTION...] ASTRdata
@@ -9998,20 +9991,18 @@ One line examples:
 
 @example
 $ astconvolve --kernel=psf.fits mockimg.fits
+$ astconvolve observedimg.fits --domain=spatial
 $ astconvolve --kernel=sharperimage.fits --makekernel=10 \
               blurryimage.fits
 @end example
 
-The only argument accepted by Convolve is an input image file. Some of
-the options are the same between Convolve and some other Gnuastro
+The only argument accepted by Convolve is an input image file. Some of the
+options are the same between Convolve and some other Gnuastro
 programs. Therefore, to avoid repetition, they will not be repeated
-here. For the full list of options shared by all Gnuastro programs,
-please see @ref{Common options}. @ref{Mesh grid options} lists all the
-options related to specifying a mesh grid which is currently only used
-in spatial convolution. Note that here, no interpolation or smoothing
-is defined, only channels and the mesh size are
-important. @ref{Convolution kernel} lists the the convolution kernel
-options.
+here. For the full list of options shared by all Gnuastro programs, please
+see @ref{Common options}. In particular, in the spatial domain convolve
+uses Gnuastro's tessellation, see @ref{Tessellation} and the common options
+related to that in @ref{Processing options}.
 
 Here we will only explain the options particular to Convolve. Run Convolve
 with @option{--help} in order to see the full list of options Convolve
@@ -10092,9 +10083,12 @@ convolved profile(s) did not convert, the values are 
now
 errors. Therefore in the final step (when cropping the central parts
 of the image), we also remove any pixel with a value less than
 @mymath{10^{-17}}.
-
 @end enumerate
 
address@hidden --noedgecorrection
+Do not correct the edge effect in spatial domain convolution. For a full
+discussion, please see @ref{Edges in the spatial domain}.
+
 @item -m INT
 @itemx --makekernel=INT
 (@option{=INT}) If this option is called, Convolve will do de-convolution
@@ -11187,58 +11181,8 @@ program with this option.
 @node Mesh grid options,  , Checking grid values, Tiling an image
 @subsubsection Mesh grid options
 
-The mesh grid structure defined here (see @ref{Tiling an image}) is
-used by more than one program. Therefore in order to avoid repetition,
-all the options to do with the mesh grid (and are shared by all the
-programs using it) are listed here.
-
-Some programs might define multiple meshs over the image (for example
-in NoiseChisel, there is a large and a small mesh for different
-operations, see @ref{NoiseChisel}), in such cases, the options for
-each mesh are designated by an appropriate prefix. For example in
-NoiseChisel the small and large mesh sizes are specified through the
address@hidden and @option{--lmeshsize} respectively. Both these
-options are similar to the @option{--meshsize} option explained below,
-but for their respective grid. Note that the short option name might
-also differ. If such options exist in a program, they are listed in
-the `Invoking ProgramName' section within the list of options.
-
 @table @option
 
address@hidden -s INT
address@hidden --tilesize=INT
-The size of each mesh, see @ref{Tiling an image}. If the width of all
-channels are not an exact multiple of the specified size, then the last
-mesh on each axis will have a different size to cover the full channel.
-
address@hidden -a INT
address@hidden --nch1=INT
-The number of channels along the first FITS axis (horizontal when viewed in
-SAO ds9). If the length of the image is not an exact multiple of this
-number, then the program will stop. You can use Crop (@ref{Crop}) to trim
-off or add some pixels (blank pixels if added, see @ref{Blank pixels}) to
-the image if it is not an exact multiple.
-
address@hidden -b INT
address@hidden --nch2=INT
-The number of channels along the second FITS axis, (vertical when viewed in
-SAO ds9). Similar to @option{--nch1}.
-
address@hidden -L FLT
address@hidden --lastmeshfrac=FLT
-Fraction of extra area on the last (rightest on the first FITS axis and
-highest/top on the second) mesh, to define a new (smaller) one. See
address@hidden an image}.
-
address@hidden --checkmesh
-An image with suffix @file{_mesh.fits} will be created for you to
-check the mesh grid, see @ref{Tiling an image}. The input image will
-be the first extension, followed by an extension, where each pixel is
-labeled (number starting from zero) by the ID of the mesh it belongs
-to. If the program uses multiple mesh grids, the output will have more
-than two extensions. By flipping through the extensions, you can check
-the positioning and size of the meshs.
-
 @item -d FLT
 @itemx --mirrordist=FLT
 The distance beyond the mirror point (in units of the error in the mirror
diff --git a/lib/convolve.c b/lib/convolve.c
index 81bf27e..d741a40 100644
--- a/lib/convolve.c
+++ b/lib/convolve.c
@@ -92,6 +92,7 @@ struct spatial_params
   gal_data_t  *tiles;
   gal_data_t *kernel;
   int     convoverch;
+  int edgecorrection;
 };
 
 
@@ -327,7 +328,8 @@ convolve_spatial_tile(struct spatial_params *cprm, size_t 
tile_ind,
               k_start=kernel->array; k_start+=k_start_inc;
 
               /* Go over the kernel-overlap region. */
-              ksum=sum=0.0f; k_inc=0; o_inc=0; o_ninc=1; kv=k_start;
+              ksum = cprm->edgecorrection ? 0.0f : 1.0f;
+              sum=0.0f; k_inc=0; o_inc=0; o_ninc=1; kv=k_start;
               while( o_st_en[0] + o_inc <= o_st_en[1] )
                 {
                   /* Go over the contiguous region. When there is full
@@ -340,7 +342,10 @@ convolve_spatial_tile(struct spatial_params *cprm, size_t 
tile_ind,
                   do
                     {
                       if( !isnan(*iv) )
-                        { ksum += *kv; sum += *iv * *kv; }
+                        {
+                          sum += *iv * *kv;
+                          if(cprm->edgecorrection) ksum += *kv;
+                        }
                       ++kv;
                     }
                   while(++iv<ivf);
@@ -356,7 +361,9 @@ convolve_spatial_tile(struct spatial_params *cprm, size_t 
tile_ind,
                 }
 
               /* Set the output value. */
-              out[ in_v - in ] = ksum==0.0f ? NAN : sum/ksum;
+              out[ in_v - in ] = ( ksum==0.0f
+                                   ? NAN
+                                   : sum/ksum );
             }
 
           /* Increment the last coordinate. */
@@ -416,7 +423,7 @@ convolve_spatial_on_thread(void *inparam)
    spatial convolution can be very series of tiles arranged as an array. */
 gal_data_t *
 gal_convolve_spatial(gal_data_t *tiles, gal_data_t *kernel,
-                     size_t numthreads, int convoverch)
+                     size_t numthreads, int edgecorrection, int convoverch)
 {
   struct spatial_params params;
   gal_data_t *out, *block=gal_tile_block(tiles);
@@ -440,6 +447,7 @@ gal_convolve_spatial(gal_data_t *tiles, gal_data_t *kernel,
   params.tiles=tiles;
   params.kernel=kernel;
   params.convoverch=convoverch;
+  params.edgecorrection=edgecorrection;
 
   /* Do the spatial convolution on threads. */
   gal_tile_function_on_threads(tiles, convolve_spatial_on_thread,
diff --git a/lib/gnuastro/convolve.h b/lib/gnuastro/convolve.h
index 5751168..a8bbfd0 100644
--- a/lib/gnuastro/convolve.h
+++ b/lib/gnuastro/convolve.h
@@ -46,7 +46,7 @@ __BEGIN_C_DECLS  /* From C++ preparations */
 
 gal_data_t *
 gal_convolve_spatial(gal_data_t *tiles, gal_data_t *kernel,
-                     size_t numthreads, int convoverch);
+                     size_t numthreads, int edgecorrection, int convoverch);
 
 
 
diff --git a/lib/statistics.c b/lib/statistics.c
index ce64b1e..b8a72e5 100644
--- a/lib/statistics.c
+++ b/lib/statistics.c
@@ -1376,7 +1376,7 @@ gal_statistics_regular_bins(gal_data_t *data, gal_data_t 
*inrange,
 {
   size_t i;
   gal_data_t *bins, *tmp, *range;
-  double *b, *ra, min, max, hbw, diff, binwidth;
+  double *b, *ra, min=NAN, max=NAN, hbw, diff, binwidth;
 
 
   /* Some sanity checks. */
@@ -1797,10 +1797,10 @@ gal_statistics_sigma_clip(gal_data_t *input, float 
multip, float param,
   int sortstatus;
   double *med, *mean, *std;
   void *start, *sorted_array;
-  double oldmed, oldmean, oldstd;
   size_t num=0, dsize=4, size, oldsize;
   uint8_t bytolerance = param>=1.0f ? 0 : 1;
-  gal_data_t *sorted, *median_i, *median_d, *out, *meanstd, *noblank;
+  double oldmed=NAN, oldmean=NAN, oldstd=NAN;
+  gal_data_t *sorted=NULL, *median_i, *median_d, *out, *meanstd, *noblank;
   size_t maxnum = param>=1.0f ? param : GAL_STATISTICS_SIG_CLIP_MAX_CONVERGE;
 
   /* Some sanity checks. */
diff --git a/lib/txt.c b/lib/txt.c
index 1d8c5a6..9c83afd 100644
--- a/lib/txt.c
+++ b/lib/txt.c
@@ -1262,8 +1262,8 @@ gal_txt_write(gal_data_t *datall, struct 
gal_linkedlist_stll *comment,
 {
   FILE *fp;
   char **fmts;
-  gal_data_t *data, *next2d;
   size_t i, j, num=0, fmtlen;
+  gal_data_t *data, *next2d=NULL;
 
 
   /* Currently only 1 and 2 dimension datasets are acceptable. */
diff --git a/tmpfs-config-make b/tmpfs-config-make
index 6c48b73..9f31ef0 100755
--- a/tmpfs-config-make
+++ b/tmpfs-config-make
@@ -130,11 +130,12 @@ cd $build_dir
 #
 # ####################################
 if [ ! -f Makefile ]; then
-    $srcdir/configure --srcdir=$srcdir --disable-shared CFLAGS="-g -O0"        
\
+    $srcdir/configure --srcdir=$srcdir                                         
\
                       --enable-arithmetic --enable-convertt   
--enable-convolve\
                       --enable-cosmiccal  --enable-crop       --enable-fits    
\
                       --enable-mknoise    --enable-statistics --enable-mkprof  
\
-                      --enable-table      --enable-warp
+                      --enable-table      --enable-warp                        
\
+                      --disable-shared CFLAGS="-g -O0"
 fi
 
 



reply via email to

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