Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
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
RadioObservatory
LOFAR
Commits
5fa04837
Commit
5fa04837
authored
13 years ago
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
Task #2669: Allow easy factorisation of block size if only beam forming is performed
parent
409c95c8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
RTCP/Run/src/LOFAR/Parset.py
+32
-2
32 additions, 2 deletions
RTCP/Run/src/LOFAR/Parset.py
with
32 additions
and
2 deletions
RTCP/Run/src/LOFAR/Parset.py
+
32
−
2
View file @
5fa04837
...
...
@@ -606,12 +606,42 @@ class Parset(util.Parset.Parset):
"""
Round x to a multiple of y.
"""
return
max
(
int
(
round
(
x
/
y
))
*
y
,
y
)
cnIntegrationSteps
=
max
(
1
,
roundTo
(
nrSamplesPerSecond
*
cnIntegrationTime
,
lcmlist
(
[
def
increase_factors
(
n
):
# increase the factors of n; returns a value close to n (<10% off for n<=195312)
if
n
<
4
:
return
n
factors
=
[]
while
n
>
1
:
for
f
in
[
2
,
3
,
5
,
7
]:
if
n
%
f
==
0
:
factors
+=
[
f
]
n
/=
f
break
else
:
n
+=
1
factors
+=
[
3
]
n
/=
3
prod
=
lambda
l
:
reduce
(
lambda
x
,
y
:
x
*
y
,
l
,
1
)
return
prod
(
factors
)
# cnIntegrationSteps MUST be a multiple of these values
forced_factors
=
lcmlist
(
[
16
,
int
(
self
[
"
OLAP.CNProc_CoherentStokes.timeIntegrationFactor
"
]),
int
(
self
[
"
OLAP.CNProc_IncoherentStokes.timeIntegrationFactor
"
]),
int
(
self
.
get
(
"
OLAP.CNProc.dedispersionFFTsize
"
,
1
)),
])))
]
)
if
self
.
getBool
(
"
Observation.DataProducts.Output_Correlated.enabled
"
):
# if doing imaging, don't mess with the block size too much
cnIntegrationSteps
=
roundTo
(
nrSamplesPerSecond
*
cnIntegrationTime
,
forced_factors
)
else
:
# make sure that the remainder is easily factorisable for easier post-processing
cnIntegrationSteps
=
forced_factors
*
increase_factors
(
int
(
round
(
nrSamplesPerSecond
*
cnIntegrationTime
/
forced_factors
))
)
cnIntegrationSteps
=
max
(
1
,
cnIntegrationSteps
)
self
.
setdefault
(
'
OLAP.CNProc.integrationSteps
'
,
cnIntegrationSteps
)
...
...
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