~ubuntu-branches/debian/jessie/eso-midas/jessie

« back to all changes in this revision

Viewing changes to contrib/wavelet/src/wa_head.c

  • Committer: Package Import Robot
  • Author(s): Ole Streicher
  • Date: 2014-04-22 14:44:58 UTC
  • Revision ID: package-import@ubuntu.com-20140422144458-okiwi1assxkkiz39
Tags: upstream-13.09pl1.2+dfsg
ImportĀ upstreamĀ versionĀ 13.09pl1.2+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*===========================================================================
 
2
  Copyright (C) 1993-2009 European Southern Observatory (ESO)
 
3
 
 
4
  This program is free software; you can redistribute it and/or 
 
5
  modify it under the terms of the GNU General Public License as 
 
6
  published by the Free Software Foundation; either version 2 of 
 
7
  the License, or (at your option) any later version.
 
8
 
 
9
  This program is distributed in the hope that it will be useful,
 
10
  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
  GNU General Public License for more details.
 
13
 
 
14
  You should have received a copy of the GNU General Public 
 
15
  License along with this program; if not, write to the Free 
 
16
  Software Foundation, Inc., 675 Massachusetts Ave, Cambridge, 
 
17
  MA 02139, USA.
 
18
 
 
19
  Correspondence concerning ESO-MIDAS should be addressed as follows:
 
20
        Internet e-mail: midas@eso.org
 
21
        Postal address: European Southern Observatory
 
22
                        Data Management Division 
 
23
                        Karl-Schwarzschild-Strasse 2
 
24
                        D 85748 Garching bei Muenchen 
 
25
                        GERMANY
 
26
===========================================================================*/
 
27
 
 
28
/******************************************************************************
 
29
**
 
30
**    UNIT
 
31
**
 
32
**    Version: 19.1
 
33
**
 
34
**    Author: Jean-Luc Starck
 
35
**
 
36
**    Date:  03/02/25
 
37
**    
 
38
**    File:  wa_head.c
 
39
**
 
40
.VERSION
 
41
 090810         last modif
 
42
 
 
43
*******************************************************************************
 
44
**
 
45
**    DESCRIPTION Gives information about a wavelet file 
 
46
**    -----------  
 
47
**                 
 
48
**
 
49
**    PARAMETRES    
 
50
**    ----------    
 
51
**         OUTPUTI[1] = number of lines
 
52
**         OUTPUTI[2] = number of columns
 
53
**         OUTPUTI[3] = number of scales
 
54
**         OUTPUTI[4] = algorithm number
 
55
**         OUTPUTR[1] = Frequency cut-off
 
56
**         OUT_A      = PYR, CUB or IMA
 
57
**         OUT_B      = 
 
58
**         File_Name_Transform (keyword: OU_A):
 
59
**             File name of the input wavelet transform
 
60
**
 
61
**    RESULTS      
 
62
**    -------  
 
63
**                          
 
64
******************************************************************************/
 
65
 
 
66
 
 
67
#include <stdio.h>
 
68
#include <math.h>
 
69
#include <string.h>
 
70
 
 
71
#include <midas_def.h>
 
72
 
 
73
#include "Def_Math.h"
 
74
#include "Def_Mem.h"
 
75
#include "Def_Wavelet.h"
 
76
 
 
77
extern void wave_io_read();
 
78
 
 
79
 
 
80
 
 
81
/*****************************************************************************/
 
82
 
 
83
int main()
 
84
{
 
85
    wave_transf_des Wavelet;
 
86
    int Stat, Actvals, Maxvals, Felem, Noelm;
 
87
    string File_Name_Transform, Send;
 
88
    int  Unit;
 
89
    int Buffer_Int;
 
90
    float Buffer_Float;
 
91
 
 
92
 
 
93
    /* Initialisation */
 
94
    SCSPRO("info_header");
 
95
 
 
96
    /* read the image file name */
 
97
    Felem = 1;
 
98
    Maxvals = 60;
 
99
    Stat = SCKGETC("IN_A", Felem, Maxvals, &Actvals, File_Name_Transform);
 
100
 
 
101
    /* read the wavelet */
 
102
    wave_io_read (File_Name_Transform, &Wavelet);
 
103
 
 
104
    sprintf (Send,"\n            Wavelet file : %s\n", File_Name_Transform);
 
105
    SCTPUT(Send);
 
106
    sprintf (Send,"\n   Original name image : %s", Wavelet.Name_Imag);
 
107
    SCTPUT(Send);
 
108
    sprintf(Send,"   Number of lines : %d", Wavelet.Nbr_Ligne);
 
109
    SCTPUT(Send);
 
110
    sprintf (Send,"   Number of columns : %d", Wavelet.Nbr_Col);
 
111
    SCTPUT(Send);
 
112
    sprintf (Send,"   Number of scales : %d", Wavelet.Nbr_Plan);
 
113
    SCTPUT(Send);
 
114
 
 
115
    Felem = 1;
 
116
    Maxvals = 1;
 
117
    Buffer_Int = Wavelet.Nbr_Ligne;
 
118
    Stat = SCKWRI("OUTPUTI", &Buffer_Int, Felem, Maxvals, &Unit);
 
119
 
 
120
    Felem = 2;
 
121
    Buffer_Int = Wavelet.Nbr_Col;
 
122
    Stat = SCKWRI("OUTPUTI", &Buffer_Int, Felem, Maxvals, &Unit);
 
123
 
 
124
    Felem = 3;
 
125
    Buffer_Int = Wavelet.Nbr_Plan;
 
126
    Stat = SCKWRI("OUTPUTI", &Buffer_Int, Felem, Maxvals, &Unit);
 
127
 
 
128
    Felem = 4;
 
129
    Buffer_Int = Wavelet.Type_Wave_Transform;
 
130
    Stat = SCKWRI("OUTPUTI", &Buffer_Int, Felem, Maxvals, &Unit);
 
131
 
 
132
    Buffer_Float = 0.;
 
133
    Felem = Noelm = 1;
 
134
    Maxvals = 60;
 
135
    switch (Wavelet.Type_Wave_Transform)
 
136
    {
 
137
        case TO_PAVE_BSPLINE_FFT:
 
138
               Buffer_Float = Wavelet.Pave.Freq_Coup;
 
139
        case TO_PAVE_LINEAR:
 
140
        case TO_PAVE_BSPLINE:
 
141
               sprintf (Send,"   cube : %d", Wavelet.Type_Wave_Transform);
 
142
               SCTPUT(Send);
 
143
               strcpy (Send,"CUB");
 
144
               SCKWRC("OUT_A", Noelm, "CUB", Felem, Maxvals, &Unit);
 
145
               break;
 
146
        case TO_PYR_FFT_DIFF_RESOL:
 
147
        case TO_PYR_FFT_DIFF_SQUARE_RESOL:
 
148
               Buffer_Float = Wavelet.Pyramid.Freq_Coup;
 
149
        case TO_PYR_LINEAR:
 
150
        case TO_PYR_BSPLINE:
 
151
             sprintf (Send,"   pyramid : %d", Wavelet.Type_Wave_Transform);
 
152
             SCTPUT(Send);
 
153
             SCKWRC("OUT_A", Noelm, "PYR", Felem, Maxvals, &Unit);
 
154
             break;
 
155
        case TO_MALLAT_BARLAUD:
 
156
             sprintf (Send,"   image : %d", Wavelet.Type_Wave_Transform);
 
157
             SCTPUT(Send);
 
158
             SCKWRC("OUT_A", Noelm, "IMA", Felem, Maxvals, &Unit);
 
159
             break;
 
160
    }
 
161
    
 
162
    Felem = 1;
 
163
    Maxvals = 1;
 
164
    Stat = SCKWRR("OUTPUTR", &Buffer_Float, Felem, Maxvals, &Unit);
 
165
 
 
166
   /* End */
 
167
 return  SCSEPI();
 
168
}
 
169