Skip to content

Commit 2cf286b

Browse files
committed
2D1D
1 parent 1ff7b9b commit 2cf286b

File tree

3 files changed

+19
-13
lines changed

3 files changed

+19
-13
lines changed

src/sparse/libsparse3d/MR2D1D.cc

+2
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@ void MR2D1D::transform (fltarray &Data)
539539
fltarray Vect(Nz);
540540

541541
// 2D wt transform per frame
542+
WT2D.ModifiedATWT = ModifiedATWT;
542543
for (z=0; z < Nz; z++)
543544
{
544545
for (i=0; i < Ny; i++)
@@ -599,6 +600,7 @@ void MR2D1D::recons (fltarray &Data)
599600
}
600601

601602
// 2D wt
603+
WT2D.ModifiedATWT = ModifiedATWT;
602604
for (z=0; z < Nz; z++)
603605
{
604606
for (b=0; b < NbrBand2D; b++)

src/sparse/libsparse3d/MR2D1D.h

+5-3
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,13 @@ class MR2D1D {
6666
type_undec_filter U_Filter; // Type of filter in case of undecimated WT
6767
FilterAnaSynt FAS; // Filter bank object
6868
FilterAnaSynt FAS1D; // Filter bank object
69-
70-
int mr_io_fill_header(fitsfile *fptr);
69+
Bool ModifiedATWT; // It true, use the modified AT WT instead of the
70+
// standard WT
71+
72+
int mr_io_fill_header(fitsfile *fptr);
7173
//public:
7274
Bool Verbose;
73-
MR2D1D (){ NbrBand2D=NbrBand1D=0;Verbose=False;}
75+
MR2D1D (){ NbrBand2D=NbrBand1D=0;Verbose=False;ModifiedATWT=False;}
7476

7577
void alloc(int iNx, int iNy, int iNz, type_transform Trans2D, int Ns2D, int Ns1D=0, Bool NoAlloc=False, type_sb_filter Filter1D=F_MALLAT_7_9);
7678
// Allocate the class for a cube of size (iNx, iNy, iNz) using Ns2D scale in 2D and Ns1D scale in 1D

src/sparse/sparsemain/mr2d1d_trans.cc

+12-10
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ Bool Normalize=False; // normalize data in
9090

9191
type_border Bord = I_MIRROR;
9292
Bool Reverse = False;
93+
Bool ModifiedATWT = False;
9394

9495
/*********************************************************************/
9596

@@ -146,10 +147,11 @@ static void transinit(int argc, char *argv[])
146147
#endif
147148

148149
/* get options */
149-
while ((c = GetOpt(argc,argv,"rN:t:n:MvzZ:")) != -1)
150+
while ((c = GetOpt(argc,argv,"ArN:t:n:MvzZ:")) != -1)
150151
{
151152
switch (c)
152153
{
154+
case 'A': ModifiedATWT = True; break;
153155
case 't':
154156
/* -d <type> type of transform */
155157
if (sscanf(OptArg,"%d",&c ) != 1)
@@ -256,8 +258,6 @@ int main(int argc, char *argv[])
256258

257259
lm_check(LIC_MR3);
258260
transinit(argc, argv);
259-
260-
261261

262262
if (Reverse == False)
263263
{
@@ -291,7 +291,7 @@ int main(int argc, char *argv[])
291291
MR2D1D WT;
292292
if (Verbose == True) cout << "Alloc ... " << endl;
293293
WT.alloc(Nx, Ny, Nz, Transform, NbrScale2d, Nbr_Plan);
294-
294+
WT.ModifiedATWT = ModifiedATWT;
295295
if (Verbose == True) cout << "Transform ... " << endl;
296296
WT.transform (Dat);
297297

@@ -312,12 +312,14 @@ int main(int argc, char *argv[])
312312
// fits_write_fltarr(Name, Band);
313313
}
314314
}
315-
// cout << endl << "READ " << endl;
316-
// MR2D1D WT1;
317-
// WT1.read(Name_Out);
318-
// fltarray Dat1;
319-
// WT1.recons (Dat1);
320-
// fits_write_fltarr (Name_Out, Dat1);
315+
/* cout << endl << "READ " << endl;
316+
MR2D1D WT1;
317+
WT1.read(Name_Out);
318+
fltarray Dat1;
319+
WT1.recons (Dat1);
320+
fits_write_fltarr (Name_Out, Dat1);
321+
Dat1 -= Dat;
322+
cout << " Resi Sigma = " << Dat1.sigma() << " Min = " << Dat1.min() << " Max = " << Dat1.max() << endl;*/
321323
}
322324
else
323325
{

0 commit comments

Comments
 (0)