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
3a85c7ef
Commit
3a85c7ef
authored
5 years ago
by
Mattia Mancini
Browse files
Options
Downloads
Patches
Plain Diff
SSB-44
: reordering of the indexes
parent
6362e3bb
No related branches found
Branches containing commit
No related tags found
1 merge request
!44
Merge back holography to master
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CAL/CalibrationCommon/lib/datacontainers/holography_datatable.py
+12
-11
12 additions, 11 deletions
...ibrationCommon/lib/datacontainers/holography_datatable.py
with
12 additions
and
11 deletions
CAL/CalibrationCommon/lib/datacontainers/holography_datatable.py
+
12
−
11
View file @
3a85c7ef
...
@@ -89,7 +89,7 @@ class HolographyDataTable(LazyH5Table):
...
@@ -89,7 +89,7 @@ class HolographyDataTable(LazyH5Table):
try
:
try
:
self
.
__get_index_arrays
()
self
.
__get_index_arrays
()
except
KeyError
:
except
KeyError
:
logger
.
debug
(
'
uri missing creating datable at:
'
+
self
.
uri
)
logger
.
debug
(
'
uri missing
,
creating datable at:
'
+
self
.
uri
)
def
__get_index_arrays
(
self
):
def
__get_index_arrays
(
self
):
"""
"""
...
@@ -109,12 +109,12 @@ class HolographyDataTable(LazyH5Table):
...
@@ -109,12 +109,12 @@ class HolographyDataTable(LazyH5Table):
# I select the first reference station just for convenience to iterate on the third level
# I select the first reference station just for convenience to iterate on the third level
first_frequency
=
frequencies_string
[
0
]
first_frequency
=
frequencies_string
[
0
]
beam_numbers
=
{
beam_number
for
beam_number
in
self
.
h5_file
[
self
.
uri
]
beam_numbers
=
{
beam_number
for
beam_number
in
self
.
h5_file
[
self
.
uri
]
[
first_
f
re
quency
]
[
first_re
ference_station
]
[
first_
reference_station
]}
[
first_
frequency
]}
self
.
_frequencies
=
set
(
sorted
(
map
(
float
,
frequencies_string
)))
self
.
_frequencies
=
tuple
(
sorted
(
map
(
float
,
frequencies_string
)))
self
.
_reference_stations
=
reference_stations
self
.
_reference_stations
=
tuple
(
reference_stations
)
self
.
_beam_numbers
=
set
(
sorted
(
map
(
int
,
beam_numbers
)))
self
.
_beam_numbers
=
tuple
(
sorted
(
map
(
int
,
beam_numbers
)))
@property
@property
def
frequencies
(
self
):
def
frequencies
(
self
):
...
@@ -173,7 +173,7 @@ class HolographyDataTable(LazyH5Table):
...
@@ -173,7 +173,7 @@ class HolographyDataTable(LazyH5Table):
reference_station
,
frequency
,
beam_number
=
key
reference_station
,
frequency
,
beam_number
=
key
self
.
_frequencies
.
add
(
float
(
frequency
))
self
.
_frequencies
.
add
(
float
(
frequency
))
self
.
_reference_stations
.
add
(
f
re
quency
)
self
.
_reference_stations
.
add
(
re
ference_station
)
self
.
_beam_numbers
.
add
(
int
(
beam_number
))
self
.
_beam_numbers
.
add
(
int
(
beam_number
))
super
().
__setitem__
((
reference_station
,
super
().
__setitem__
((
reference_station
,
...
@@ -184,13 +184,14 @@ class HolographyDataTable(LazyH5Table):
...
@@ -184,13 +184,14 @@ class HolographyDataTable(LazyH5Table):
for
frequency
in
self
.
_frequencies
:
for
frequency
in
self
.
_frequencies
:
for
station
in
self
.
_reference_stations
:
for
station
in
self
.
_reference_stations
:
for
beam
in
self
.
_beam_numbers
:
for
beam
in
self
.
_beam_numbers
:
yield
(
float
(
frequency
),
station
,
int
(
beam
)),
\
yield
(
station
,
float
(
frequency
),
int
(
beam
)),
\
self
.
__getitem__
((
station
,
frequency
,
beam
))
self
.
__getitem__
((
station
,
frequency
,
beam
))
def
keys
(
self
):
def
keys
(
self
):
key_set
=
set
()
key_set
=
set
()
for
frequency
in
self
.
_frequencies
:
for
station
in
self
.
_reference_stations
:
for
station
in
self
.
_reference_stations
:
for
frequency
in
self
.
_frequencies
:
for
beam
in
self
.
_beam_numbers
:
for
beam
in
self
.
_beam_numbers
:
key_set
.
add
((
frequency
,
station
,
beam
))
key_set
.
add
((
station
,
frequency
,
beam
))
return
key_set
return
key_set
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