Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
psrdada_cpp
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
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Winchen
psrdada_cpp
Commits
be9a2afd
Commit
be9a2afd
authored
5 years ago
by
sakthipriyas
Browse files
Options
Downloads
Patches
Plain Diff
modified replace_rfi_data method
parent
991b6592
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
psrdada_cpp/effelsberg/edd/SKRfiReplacementCuda.cuh
+0
-7
0 additions, 7 deletions
psrdada_cpp/effelsberg/edd/SKRfiReplacementCuda.cuh
psrdada_cpp/effelsberg/edd/src/SKRfiReplacementCuda.cu
+18
-14
18 additions, 14 deletions
psrdada_cpp/effelsberg/edd/src/SKRfiReplacementCuda.cu
with
18 additions
and
21 deletions
psrdada_cpp/effelsberg/edd/SKRfiReplacementCuda.cuh
+
0
−
7
View file @
be9a2afd
...
@@ -66,13 +66,6 @@ private:
...
@@ -66,13 +66,6 @@ private:
*/
*/
void
get_clean_data_statistics
(
const
thrust
::
device_vector
<
thrust
::
complex
<
float
>>
&
data
);
void
get_clean_data_statistics
(
const
thrust
::
device_vector
<
thrust
::
complex
<
float
>>
&
data
);
/**
* @brief Generates replacement data using clean window data statistics
*
* @param(out) replacement_data replacement data of size = _window_size generated using input stats.
*/
void
generate_replacement_data
(
thrust
::
device_vector
<
thrust
::
complex
<
float
>>
&
replacement_data
);
thrust
::
device_vector
<
int
>
_rfi_status
;
thrust
::
device_vector
<
int
>
_rfi_status
;
std
::
size_t
_window_size
;
std
::
size_t
_window_size
;
std
::
size_t
_nwindows
,
_nrfi_windows
,
_nclean_windows
;
std
::
size_t
_nwindows
,
_nrfi_windows
,
_nclean_windows
;
...
...
This diff is collapsed.
Click to expand it.
psrdada_cpp/effelsberg/edd/src/SKRfiReplacementCuda.cu
+
18
−
14
View file @
be9a2afd
...
@@ -14,6 +14,21 @@ struct mean_subtraction_square{
...
@@ -14,6 +14,21 @@ struct mean_subtraction_square{
}
}
};
};
struct
generate_replacement_data
{
float
normal_dist_mean
,
normal_dist_std
;
generate_replacement_data
(
float
mean
,
float
std
)
:
normal_dist_mean
(
mean
),
normal_dist_std
(
std
)
{};
__host__
__device__
thrust
::
complex
<
float
>
operator
()
(
unsigned
int
n
)
const
{
thrust
::
minstd_rand
gen
;
thrust
::
random
::
normal_distribution
<
float
>
dist
(
normal_dist_mean
,
normal_dist_std
);
gen
.
discard
(
n
);
return
thrust
::
complex
<
float
>
(
dist
(
gen
),
dist
(
gen
));
}
};
SKRfiReplacementCuda
::
SKRfiReplacementCuda
()
SKRfiReplacementCuda
::
SKRfiReplacementCuda
()
{
{
BOOST_LOG_TRIVIAL
(
info
)
<<
"Creating new SKRfiReplacementCuda instance..
\n
"
;
BOOST_LOG_TRIVIAL
(
info
)
<<
"Creating new SKRfiReplacementCuda instance..
\n
"
;
...
@@ -82,17 +97,6 @@ void SKRfiReplacementCuda::compute_clean_data_statistics()
...
@@ -82,17 +97,6 @@ void SKRfiReplacementCuda::compute_clean_data_statistics()
<<
" sd = "
<<
_ref_sd
;
<<
" sd = "
<<
_ref_sd
;
}
}
void
SKRfiReplacementCuda
::
generate_replacement_data
(
thrust
::
device_vector
<
thrust
::
complex
<
float
>>
&
replacement_data
)
{
BOOST_LOG_TRIVIAL
(
info
)
<<
"generating replacement data..
\n
"
;
replacement_data
.
resize
(
_window_size
);
thrust
::
minstd_rand
gen
;
thrust
::
random
::
normal_distribution
<
float
>
ndist
(
_ref_mean
,
_ref_sd
);
for
(
std
::
size_t
index
=
0
;
index
<
_window_size
;
index
++
){
replacement_data
[
index
]
=
thrust
::
complex
<
float
>
(
ndist
(
gen
),
ndist
(
gen
));
}
}
void
SKRfiReplacementCuda
::
replace_rfi_data
(
const
thrust
::
device_vector
<
int
>
&
rfi_status
,
void
SKRfiReplacementCuda
::
replace_rfi_data
(
const
thrust
::
device_vector
<
int
>
&
rfi_status
,
thrust
::
device_vector
<
thrust
::
complex
<
float
>>
&
data
)
thrust
::
device_vector
<
thrust
::
complex
<
float
>>
&
data
)
{
{
...
@@ -103,15 +107,15 @@ void SKRfiReplacementCuda::replace_rfi_data(const thrust::device_vector<int> &rf
...
@@ -103,15 +107,15 @@ void SKRfiReplacementCuda::replace_rfi_data(const thrust::device_vector<int> &rf
//RFI present and not in all windows
//RFI present and not in all windows
if
((
_nrfi_windows
>
0
)
&&
(
_nrfi_windows
<
_nwindows
)){
if
((
_nrfi_windows
>
0
)
&&
(
_nrfi_windows
<
_nwindows
)){
get_clean_data_statistics
(
data
);
get_clean_data_statistics
(
data
);
generate_replacement_data
(
replacement_data
);
//Replacing RFI
//Replacing RFI
thrust
::
counting_iterator
<
unsigned
int
>
sequence_index_begin
(
0
);
for
(
std
::
size_t
ii
=
0
;
ii
<
_nrfi_windows
;
ii
++
){
for
(
std
::
size_t
ii
=
0
;
ii
<
_nrfi_windows
;
ii
++
){
std
::
size_t
index
=
_rfi_window_indices
[
ii
]
*
_window_size
;
std
::
size_t
index
=
_rfi_window_indices
[
ii
]
*
_window_size
;
thrust
::
copy
(
replacement_data
.
begin
(),
replacement_data
.
end
(),
(
data
.
begin
()
+
index
));
thrust
::
transform
(
sequence_index_begin
,
(
sequence_index_begin
+
_window_size
),
(
data
.
begin
()
+
index
),
generate_replacement_data
(
_ref_mean
,
_ref_sd
));
}
}
}
}
}
}
}
//edd
}
//edd
}
//effelsberg
}
//effelsberg
}
//psrdada_cpp
}
//psrdada_cpp
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