Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HPC_Imaging
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Claudio Gheller
HPC_Imaging
Commits
1db60710
Commit
1db60710
authored
2 years ago
by
Claudio Gheller
Browse files
Options
Downloads
Patches
Plain Diff
Kaiser-Bessel and tabulated Gaussian available on CPU. Bug fixed in uvw normalization
parent
02194d4b
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Makefile
+1
-1
1 addition, 1 deletion
Makefile
w-stacking-fftw.c
+4
-4
4 additions, 4 deletions
w-stacking-fftw.c
w-stacking.cu
+29
-9
29 additions, 9 deletions
w-stacking.cu
with
34 additions
and
14 deletions
Makefile
+
1
−
1
View file @
1db60710
...
@@ -40,7 +40,7 @@ OPT += -DWRITE_IMAGE
...
@@ -40,7 +40,7 @@ OPT += -DWRITE_IMAGE
#OPT += -DPARALLELIO
#OPT += -DPARALLELIO
# Normalize uvw in case it is not done in the binMS
# Normalize uvw in case it is not done in the binMS
OPT
+=
-DNORMALIZE_UVW
OPT
+=
-DNORMALIZE_UVW
# Gridding kernel: GAUSS, GAUSS_HI_PRECISION
# Gridding kernel: GAUSS, GAUSS_HI_PRECISION
, KAISERBESSEL
OPT
+=
-DGAUSS_HI_PRECISION
OPT
+=
-DGAUSS_HI_PRECISION
ifeq
(FITSIO,$(findstring FITSIO,$(OPT)))
ifeq
(FITSIO,$(findstring FITSIO,$(OPT)))
...
...
This diff is collapsed.
Click to expand it.
w-stacking-fftw.c
+
4
−
4
View file @
1db60710
...
@@ -354,12 +354,12 @@ if(rank == 0){
...
@@ -354,12 +354,12 @@ if(rank == 0){
maxv_all
=
maxv
;
maxv_all
=
maxv
;
maxw_all
=
maxw
;
maxw_all
=
maxw
;
#endif
#endif
double
offset
=
0
.
0
;
double
offset
=
0
.
001
;
double
ming
=
MIN
(
minu_all
,
minv_all
);
double
ming
=
MAX
(
abs
(
minu_all
),
abs
(
minv_all
));
double
maxg
=
MAX
(
maxu_all
,
maxv_all
);
double
maxg
=
MAX
(
abs
(
maxu_all
),
abs
(
maxv_all
));
maxg
=
MAX
(
maxg
,
ming
);
minw
=
minw_all
;
minw
=
minw_all
;
maxw
=
maxw_all
;
maxw
=
maxw_all
;
ming
=
ming
-
offset
*
ming
;
maxg
=
maxg
+
offset
*
maxg
;
maxg
=
maxg
+
offset
*
maxg
;
for
(
long
inorm
=
0
;
inorm
<
Nmeasures
;
inorm
++
)
for
(
long
inorm
=
0
;
inorm
<
Nmeasures
;
inorm
++
)
{
{
...
...
This diff is collapsed.
Click to expand it.
w-stacking.cu
+
29
−
9
View file @
1db60710
...
@@ -31,11 +31,12 @@ void makeGaussKernel(double * kernel,
...
@@ -31,11 +31,12 @@ void makeGaussKernel(double * kernel,
double
norm
=
std22
/
PI
;
double
norm
=
std22
/
PI
;
int
n
=
increaseprecision
*
KernelLen
,
mid
=
n
/
2
;
int
n
=
increaseprecision
*
KernelLen
,
mid
=
n
/
2
;
for
(
int
i
=
0
;
i
!=
mid
+
1
;
i
++
)
{
for
(
int
i
=
0
;
i
!=
mid
+
1
;
i
++
)
{
double
term
=
(
double
)
i
/
mid
;
double
term
=
(
double
)
i
/
(
double
)
increaseprecision
;
kernel
[
mid
+
i
]
=
sqrt
(
norm
)
*
exp
(
-
(
term
*
term
)
*
std22
);
kernel
[
mid
+
i
]
=
sqrt
(
norm
)
*
exp
(
-
(
term
*
term
)
*
std22
);
}
}
for
(
int
i
=
0
;
i
!=
mid
;
i
++
)
kernel
[
i
]
=
kernel
[
n
-
1
-
i
];
for
(
int
i
=
0
;
i
!=
mid
;
i
++
)
kernel
[
i
]
=
kernel
[
n
-
1
-
i
];
// for (int i = 0; i < n; i++) printf("%f\n",kernel[i]);
}
}
...
@@ -53,10 +54,11 @@ double bessel0(double x, double precision) {
...
@@ -53,10 +54,11 @@ double bessel0(double x, double precision) {
}
}
void
makeKaiserBesselKernel
(
double
*
kernel
,
void
makeKaiserBesselKernel
(
double
*
kernel
,
int
KernelLen
,
int
KernelLen
,
int
increaseprecision
,
double
alpha
,
double
alpha
,
double
overSamplingFactor
,
double
overSamplingFactor
,
int
withSinc
)
{
int
withSinc
)
{
int
n
=
KernelLen
,
mid
=
n
/
2
;
int
n
=
increaseprecision
*
KernelLen
,
mid
=
n
/
2
;
double
*
sincKernel
=
malloc
((
mid
+
1
)
*
sizeof
(
*
sincKernel
));
double
*
sincKernel
=
malloc
((
mid
+
1
)
*
sizeof
(
*
sincKernel
));
const
double
filterRatio
=
1.0
/
overSamplingFactor
;
const
double
filterRatio
=
1.0
/
overSamplingFactor
;
sincKernel
[
0
]
=
filterRatio
;
sincKernel
[
0
]
=
filterRatio
;
...
@@ -73,6 +75,7 @@ void makeKaiserBesselKernel(double * kernel,
...
@@ -73,6 +75,7 @@ void makeKaiserBesselKernel(double * kernel,
normFactor
;
normFactor
;
}
}
for
(
int
i
=
0
;
i
!=
mid
;
i
++
)
kernel
[
i
]
=
kernel
[
n
-
1
-
i
];
for
(
int
i
=
0
;
i
!=
mid
;
i
++
)
kernel
[
i
]
=
kernel
[
n
-
1
-
i
];
//for (int i = 0; i < n; i++) printf("%f\n",kernel[i]);
}
}
...
@@ -202,12 +205,21 @@ void wstack(
...
@@ -202,12 +205,21 @@ void wstack(
// initialize the convolution kernel
// initialize the convolution kernel
// gaussian:
// gaussian:
int
KernelLen
=
(
w_support
-
1
)
/
2
;
int
KernelLen
=
(
w_support
-
1
)
/
2
;
int
increaseprecision
=
21
;
// this number must be odd: increaseprecison*w_support must be odd (w_support must be odd)
int
increaseprecision
=
5
;
// this number must be odd: increaseprecison*w_support must be odd (w_support must be odd)
double
std
=
1.0
;
double
std
=
1.0
;
double
std22
=
1.0
/
(
2.0
*
std
*
std
);
double
std22
=
1.0
/
(
2.0
*
std
*
std
);
double
norm
=
std22
/
PI
;
double
norm
=
std22
/
PI
;
double
*
convkernel
=
malloc
(
increaseprecision
*
w_support
*
sizeof
(
*
convkernel
));
double
*
convkernel
=
malloc
(
increaseprecision
*
w_support
*
sizeof
(
*
convkernel
));
double
overSamplingFactor
=
1.0
;
int
withSinc
=
0
;
double
alpha
=
8.6
;
#ifdef GAUSS
makeGaussKernel
(
convkernel
,
w_support
,
increaseprecision
,
std22
);
makeGaussKernel
(
convkernel
,
w_support
,
increaseprecision
,
std22
);
#endif
#ifdef KAISERBESSEL
makeKaiserBesselKernel
(
convkernel
,
w_support
,
increaseprecision
,
alpha
,
overSamplingFactor
,
withSinc
);
#endif
// Loop over visibilities.
// Loop over visibilities.
// Switch between CUDA and GPU versions
// Switch between CUDA and GPU versions
...
@@ -325,20 +337,28 @@ void wstack(
...
@@ -325,20 +337,28 @@ void wstack(
for
(
k
=
kmin
;
k
<=
kmax
;
k
++
)
for
(
k
=
kmin
;
k
<=
kmax
;
k
++
)
{
{
double
v_dist
=
(
double
)
k
+
0.5
-
pos_v
;
//double v_dist = (double)k+0.5 - pos_v;
double
v_dist
=
(
double
)
k
-
pos_v
;
for
(
j
=
jmin
;
j
<=
jmax
;
j
++
)
for
(
j
=
jmin
;
j
<=
jmax
;
j
++
)
{
{
double
u_dist
=
(
double
)
j
+
0.5
-
pos_u
;
//double u_dist = (double)j+0.5 - pos_u;
double
u_dist
=
(
double
)
j
-
pos_u
;
long
iKer
=
2
*
(
j
+
k
*
grid_size_x
+
grid_w
*
grid_size_x
*
grid_size_y
);
long
iKer
=
2
*
(
j
+
k
*
grid_size_x
+
grid_w
*
grid_size_x
*
grid_size_y
);
int
jKer
=
(
int
)(
increaseprecision
*
u_dist
)
+
KernelLen
;
int
jKer
=
(
int
)(
increaseprecision
*
(
fabs
(
u_dist
+
(
double
)
KernelLen
)))
;
int
kKer
=
(
int
)(
increaseprecision
*
v_dist
)
+
KernelLen
;
int
kKer
=
(
int
)(
increaseprecision
*
(
fabs
(
v_dist
+
(
double
)
KernelLen
)))
;
#ifdef GAUSS_HI_PRECISION
#ifdef GAUSS_HI_PRECISION
double
conv_weight
=
gauss_kernel_norm
(
norm
,
std22
,
u_dist
,
v_dist
);
double
conv_weight
=
gauss_kernel_norm
(
norm
,
std22
,
u_dist
,
v_dist
);
#endif
#endif
#ifdef GAUSS
#ifdef GAUSS
double
conv_weight
=
convkernel
[
jKer
]
*
convkernel
[
kKer
];
double
conv_weight
=
convkernel
[
jKer
]
*
convkernel
[
kKer
];
//if(jKer < 0 || jKer >= 35 || kKer < 0 || kKer >= 35)
// printf("%f %d %f %d\n",fabs(u_dist+(double)KernelLen),jKer,fabs(v_dist+(double)KernelLen),kKer);
//printf("%d %d %d %d %f %f %f %f %f\n",jKer, j, kKer, k, pos_u, pos_v, u_dist,v_dist,conv_weight);
#endif
#ifdef KAISERBESSEL
double
conv_weight
=
convkernel
[
jKer
]
*
convkernel
[
kKer
];
#endif
#endif
// Loops over frequencies and polarizations
// Loops over frequencies and polarizations
double
add_term_real
=
0.0
;
double
add_term_real
=
0.0
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment