Skip to content

Commit

Permalink
2D1D
Browse files Browse the repository at this point in the history
  • Loading branch information
jstarck committed May 8, 2024
1 parent 1ff7b9b commit 2cf286b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
2 changes: 2 additions & 0 deletions src/sparse/libsparse3d/MR2D1D.cc
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ void MR2D1D::transform (fltarray &Data)
fltarray Vect(Nz);

// 2D wt transform per frame
WT2D.ModifiedATWT = ModifiedATWT;
for (z=0; z < Nz; z++)
{
for (i=0; i < Ny; i++)
Expand Down Expand Up @@ -599,6 +600,7 @@ void MR2D1D::recons (fltarray &Data)
}

// 2D wt
WT2D.ModifiedATWT = ModifiedATWT;
for (z=0; z < Nz; z++)
{
for (b=0; b < NbrBand2D; b++)
Expand Down
8 changes: 5 additions & 3 deletions src/sparse/libsparse3d/MR2D1D.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,13 @@ class MR2D1D {
type_undec_filter U_Filter; // Type of filter in case of undecimated WT
FilterAnaSynt FAS; // Filter bank object
FilterAnaSynt FAS1D; // Filter bank object

int mr_io_fill_header(fitsfile *fptr);
Bool ModifiedATWT; // It true, use the modified AT WT instead of the
// standard WT

int mr_io_fill_header(fitsfile *fptr);
//public:
Bool Verbose;
MR2D1D (){ NbrBand2D=NbrBand1D=0;Verbose=False;}
MR2D1D (){ NbrBand2D=NbrBand1D=0;Verbose=False;ModifiedATWT=False;}

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);
// Allocate the class for a cube of size (iNx, iNy, iNz) using Ns2D scale in 2D and Ns1D scale in 1D
Expand Down
22 changes: 12 additions & 10 deletions src/sparse/sparsemain/mr2d1d_trans.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ Bool Normalize=False; // normalize data in

type_border Bord = I_MIRROR;
Bool Reverse = False;
Bool ModifiedATWT = False;

/*********************************************************************/

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

/* get options */
while ((c = GetOpt(argc,argv,"rN:t:n:MvzZ:")) != -1)
while ((c = GetOpt(argc,argv,"ArN:t:n:MvzZ:")) != -1)
{
switch (c)
{
case 'A': ModifiedATWT = True; break;
case 't':
/* -d <type> type of transform */
if (sscanf(OptArg,"%d",&c ) != 1)
Expand Down Expand Up @@ -256,8 +258,6 @@ int main(int argc, char *argv[])

lm_check(LIC_MR3);
transinit(argc, argv);



if (Reverse == False)
{
Expand Down Expand Up @@ -291,7 +291,7 @@ int main(int argc, char *argv[])
MR2D1D WT;
if (Verbose == True) cout << "Alloc ... " << endl;
WT.alloc(Nx, Ny, Nz, Transform, NbrScale2d, Nbr_Plan);

WT.ModifiedATWT = ModifiedATWT;
if (Verbose == True) cout << "Transform ... " << endl;
WT.transform (Dat);

Expand All @@ -312,12 +312,14 @@ int main(int argc, char *argv[])
// fits_write_fltarr(Name, Band);
}
}
// cout << endl << "READ " << endl;
// MR2D1D WT1;
// WT1.read(Name_Out);
// fltarray Dat1;
// WT1.recons (Dat1);
// fits_write_fltarr (Name_Out, Dat1);
/* cout << endl << "READ " << endl;
MR2D1D WT1;
WT1.read(Name_Out);
fltarray Dat1;
WT1.recons (Dat1);
fits_write_fltarr (Name_Out, Dat1);
Dat1 -= Dat;
cout << " Resi Sigma = " << Dat1.sigma() << " Min = " << Dat1.min() << " Max = " << Dat1.max() << endl;*/
}
else
{
Expand Down

0 comments on commit 2cf286b

Please sign in to comment.