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
7fe18025
Commit
7fe18025
authored
6 years ago
by
Thomas Jürges
Browse files
Options
Downloads
Patches
Plain Diff
Task
SSB-42
: Added documentation
parent
56609934
No related branches found
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_dataset.py
+23
-0
23 additions, 0 deletions
...alibrationCommon/lib/datacontainers/holography_dataset.py
with
23 additions
and
0 deletions
CAL/CalibrationCommon/lib/datacontainers/holography_dataset.py
+
23
−
0
View file @
7fe18025
...
@@ -10,6 +10,11 @@ logger = logging.getLogger(__name__)
...
@@ -10,6 +10,11 @@ logger = logging.getLogger(__name__)
class
HolographyDataset
():
class
HolographyDataset
():
def
__init__
(
self
):
def
__init__
(
self
):
'''
Initialise the member variables with sane defaults. Simple types are
initialised with None, dicts, lists and other fancy things are
initialised with an assignment to their respective constructors.
'''
# float, HDS version
# float, HDS version
self
.
version
=
HOLOGRAPHY_DATA_SET_VERSION
self
.
version
=
HOLOGRAPHY_DATA_SET_VERSION
...
@@ -60,6 +65,14 @@ class HolographyDataset():
...
@@ -60,6 +65,14 @@ class HolographyDataset():
@staticmethod
@staticmethod
def
compare_dicts
(
dict1
,
dict2
):
def
compare_dicts
(
dict1
,
dict2
):
'''
This function compares the contents of two dicts. It recursively
iterates over all keys and embedded dicts.
@return: False if a key in dict1 is not a key in dict2 or if values for
a key differ in the dicts, True if the contents of both dicts match.
@param dict1: A dict
@param dict2: Another dict
'''
result
=
True
result
=
True
for
key
in
dict1
.
keys
():
for
key
in
dict1
.
keys
():
if
key
in
dict2
.
keys
():
if
key
in
dict2
.
keys
():
...
@@ -77,6 +90,16 @@ class HolographyDataset():
...
@@ -77,6 +90,16 @@ class HolographyDataset():
return
result
return
result
def
__eq__
(
self
,
hds
=
None
):
def
__eq__
(
self
,
hds
=
None
):
'''
This comparison operator compares the values of the relevant members of
this class instance and the ones in the parameter hds. This allows to
compare a Holography Data Set in memory with one that has been loaded
from an HDF5 file. It is also possible to compare two HDSs that were
imported from Holography Measurement Sets.
@param hds: An instance of the HolographyDataset class
@return: True if the values of the members that are relevant for HDS
are identical, False otherwise.
'''
equality
=
False
equality
=
False
if
hds
is
not
None
and
isinstance
(
hds
,
HolographyDataset
)
is
True
:
if
hds
is
not
None
and
isinstance
(
hds
,
HolographyDataset
)
is
True
:
equality
=
True
equality
=
True
...
...
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