[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master 2bf9663: gal_convolve_spatial ignores convover
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master 2bf9663: gal_convolve_spatial ignores convoverch when input isn't a tile |
Date: |
Fri, 21 Dec 2018 12:03:26 -0500 (EST) |
branch: master
commit 2bf96630d99178fdc732c7adac8392a86e0f389e
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>
gal_convolve_spatial ignores convoverch when input isn't a tile
When the input isn't a tile, the `convoverch' argument to
`gal_convolve_spatial' must be 1. Otherwise it will crash (and really
confuse a user who is giving a simple complete dataset instead of a
tessellation).
With this commit, in such scenarios we manually set to the value of
`convoverch' to 1 and ignore the user's given value (most probably zero in
that scenario).
---
doc/gnuastro.texi | 29 ++++++++++++++++-------------
lib/convolve.c | 4 ++++
2 files changed, 20 insertions(+), 13 deletions(-)
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index 2feed22..38d58be 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -28533,19 +28533,22 @@ in the Convolve address@hidden any help would be
greatly
appreciated.}.
@deftypefun {gal_data_t *} gal_convolve_spatial (gal_data_t @code{*tiles},
gal_data_t @code{*kernel}, size_t @code{numthreads}, int @code{edgecorrection},
int @code{convoverch})
-Convolve each node of the list of @code{tiles} (see @ref{List of
-gal_data_t} and @ref{Tessellation library}) with @code{kernel} using
address@hidden When @code{edgecorrection} is non-zero, it will correct
-for the edge dimming effects as discussed in @ref{Edges in the spatial
-domain}.
-
-To create a tessellation that fully covers an input image, you may use
address@hidden, or @code{gal_tile_full_two_layers} to also define
-channels over your input dataset. These functions are discussed in
address@hidden grid}. You may then pass the list of tiles to this function. This
-is the recommended way to call this function because spatial domain
-convolution is slow and breaking the job into many small tiles and working
-on simultaneously on several threads can greatly speed up the processing.
+Convolve the given @code{tiles} dataset (possibly a list of tiles, see
address@hidden of gal_data_t} and @ref{Tessellation library}) with @code{kernel}
+on @code{numthreads} threads. When @code{edgecorrection} is non-zero, it
+will correct for the edge dimming effects as discussed in @ref{Edges in the
+spatial domain}.
+
address@hidden can be a single/complete dataset, but in that case the speed
+will be very slow. Therefore, for larger images, it is recommended to give
+a list of tiles covering a dataset. To create a tessellation that fully
+covers an input image, you may use @code{gal_tile_full}, or
address@hidden to also define channels over your input
+dataset. These functions are discussed in @ref{Tile grid}. You may then
+pass the list of tiles to this function. This is the recommended way to
+call this function because spatial domain convolution is slow and breaking
+the job into many small tiles and working on simultaneously on several
+threads can greatly speed up the processing.
If the tiles are defined within a channel (a larger tile), by default
convolution will be done within the channel, so pixels on the edge of a
diff --git a/lib/convolve.c b/lib/convolve.c
index 1f558b4..5fd9b62 100644
--- a/lib/convolve.c
+++ b/lib/convolve.c
@@ -559,6 +559,10 @@ gal_data_t *
gal_convolve_spatial(gal_data_t *tiles, gal_data_t *kernel,
size_t numthreads, int edgecorrection, int convoverch)
{
+ /* When there isn't any tile structure, `convoverch' must be set to
+ one. Recall that the input can be a single full dataset also. */
+ if(tiles->block==NULL) convoverch=1;
+
/* Call the general function. */
return gal_convolve_spatial_general(tiles, kernel, numthreads,
edgecorrection, convoverch, NULL);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnuastro-commits] master 2bf9663: gal_convolve_spatial ignores convoverch when input isn't a tile,
Mohammad Akhlaghi <=