File: main.h

package info (click to toggle)
gnuastro 0.24-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 44,360 kB
  • sloc: ansic: 185,444; sh: 15,785; makefile: 1,303; cpp: 9
file content (103 lines) | stat: -rw-r--r-- 3,920 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/*********************************************************************
Convolve - Convolve input data with a given kernel.
Convolve is part of GNU Astronomy Utilities (Gnuastro) package.

Original author:
     Mohammad Akhlaghi <mohammad@akhlaghi.org>
Contributing author(s):
Copyright (C) 2015-2025 Free Software Foundation, Inc.

Gnuastro is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.

Gnuastro is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with Gnuastro. If not, see <http://www.gnu.org/licenses/>.
**********************************************************************/
#ifndef MAIN_H
#define MAIN_H

/* Include necessary headers */
#include <gnuastro/data.h>

#include <gnuastro-internal/options.h>

/* Program names.  */
#define PROGRAM_NAME   "Convolve"      /* Program full name.       */
#define PROGRAM_EXEC   "astconvolve"   /* Program executable name. */
#define PROGRAM_STRING PROGRAM_NAME" (" PACKAGE_NAME ") " PACKAGE_VERSION





/* Macros */
#define CONVFLOATINGPOINTERR 1e-10
#define INPUT_USE_TYPE       GAL_TYPE_FLOAT32




/* Enumerators */
enum complex_to_real
{
  COMPLEX_TO_REAL_INVALID,           /* ==0 by C standard. */

  COMPLEX_TO_REAL_SPEC,
  COMPLEX_TO_REAL_PHASE,
  COMPLEX_TO_REAL_REAL,
};

enum domain_codes
{
  CONVOLVE_DOMAIN_INVALID,           /* ==0 by C standard. */

  CONVOLVE_DOMAIN_SPATIAL,
  CONVOLVE_DOMAIN_FREQUENCY,
};





/* Processing parameters structure */
struct convolveparams
{
  /* From command-line */
  struct gal_options_common_params cp; /* Common parameters.              */
  char             *filename;  /* Name of input file.                     */
  char               *column;  /* Name of column if input is a table.     */
  char           *kernelname;  /* File name of kernel.                    */
  char                 *khdu;  /* HDU of kernel.                          */
  char         *kernelcolumn;  /* Column to read the input kernel.        */
  uint8_t       nokernelflip;  /* Do not flip the kernel.                 */
  uint8_t       nokernelnorm;  /* Do not normalize the kernel.            */
  double        minsharpspec;  /* Deconvolution: min spect. of sharp img. */
  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.    */
  uint8_t      conv_on_blank;  /* Do convolution on blank pixels also.    */

  /* Internal */
  int                 isfits;  /* Input is a FITS file.                   */
  int               hdu_type;  /* Type of HDU (image or table).           */
  int                 domain;  /* Frequency or spatial domain conv.       */
  gal_data_t          *input;  /* Input image array.                      */
  gal_data_t         *kernel;  /* Input Kernel array.                     */
  double               *pimg;  /* Padded image array.                     */
  double               *pker;  /* Padded kernel array.                    */
  double               *rpad;  /* Real final image before removing pad'd. */
  size_t                 ps0;  /* Padded size along first C axis.         */
  size_t                 ps1;  /* Padded size along second C axis.        */
  char        *freqstepsname;  /* Name of file to check frequency steps.  */
  time_t             rawtime;  /* Starting time of the program.           */
};

#endif