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
a5c254ca
Commit
a5c254ca
authored
6 years ago
by
Mattia Mancini
Browse files
Options
Downloads
Patches
Plain Diff
SSB-47
: redefinition of l, m before solving for the gains
parent
4e945cdd
No related branches found
No related tags found
1 merge request
!44
Merge back holography to master
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
CAL/CalibrationProcessing/lib/processing/solver.py
+23
-6
23 additions, 6 deletions
CAL/CalibrationProcessing/lib/processing/solver.py
with
23 additions
and
6 deletions
CAL/CalibrationProcessing/lib/processing/solver.py
+
23
−
6
View file @
a5c254ca
...
@@ -20,7 +20,7 @@ def _rotate_antenna_coordinates(dataset):
...
@@ -20,7 +20,7 @@ def _rotate_antenna_coordinates(dataset):
station_position
=
numpy
.
array
(
dataset
.
target_station_position
)
station_position
=
numpy
.
array
(
dataset
.
target_station_position
)
antenna_field_position
=
numpy
.
array
(
dataset
.
antenna_field_position
)
antenna_field_position
=
numpy
.
array
(
dataset
.
antenna_field_position
)
antenna_position_offset
=
numpy
.
array
([
antenna
_position
-
station
_position
for
antenna_position_offset
=
numpy
.
array
([
station
_position
-
antenna
_position
for
antenna_position
in
antenna_field_position
])
antenna_position
in
antenna_field_position
])
station_rotation_matrix
=
dataset
.
rotation_matrix
station_rotation_matrix
=
dataset
.
rotation_matrix
...
@@ -42,7 +42,8 @@ def _compute_expected_phase_delay(l, m, x, y, frequency):
...
@@ -42,7 +42,8 @@ def _compute_expected_phase_delay(l, m, x, y, frequency):
return
phase
return
phase
def
_compute_pointing_matrices_per_station_frequency_beam
(
dataset
,
datatable
,
frequency
):
def
_compute_pointing_matrices_per_station_frequency_beam
(
dataset
,
datatable
,
central_beam
,
frequency
):
"""
"""
Compute the pointing matrix of a given station, at a given frequency and for a specific beam.
Compute the pointing matrix of a given station, at a given frequency and for a specific beam.
:param dataset: datatable
'
s dataset
:param dataset: datatable
'
s dataset
...
@@ -51,6 +52,8 @@ def _compute_pointing_matrices_per_station_frequency_beam(dataset, datatable, fr
...
@@ -51,6 +52,8 @@ def _compute_pointing_matrices_per_station_frequency_beam(dataset, datatable, fr
:type datatable: dict(dict(numpy.ndarray))
:type datatable: dict(dict(numpy.ndarray))
:param frequency: frequency at which to compute the pointing matrix
:param frequency: frequency at which to compute the pointing matrix
:type frequency: float
:type frequency: float
:param central_beam: central beam
:type central_beam: str
:return: the pointing matrix
:return: the pointing matrix
:rtype: numpy.matrix
:rtype: numpy.matrix
"""
"""
...
@@ -64,8 +67,8 @@ def _compute_pointing_matrices_per_station_frequency_beam(dataset, datatable, fr
...
@@ -64,8 +67,8 @@ def _compute_pointing_matrices_per_station_frequency_beam(dataset, datatable, fr
for
i
in
range
(
n_beams
):
for
i
in
range
(
n_beams
):
for
j
in
range
(
n_antennas
):
for
j
in
range
(
n_antennas
):
l
=
datatable
[
str
(
i
)][
'
mean
'
][
'
l
'
][
0
]
l
=
datatable
[
central_beam
][
'
mean
'
][
'
l
'
][
0
]
-
datatable
[
str
(
i
)][
'
mean
'
][
'
l
'
][
0
]
m
=
datatable
[
str
(
i
)][
'
mean
'
][
'
m
'
][
0
]
m
=
datatable
[
central_beam
][
'
mean
'
][
'
m
'
][
0
]
-
datatable
[
str
(
i
)][
'
mean
'
][
'
m
'
][
0
]
x
,
y
=
rotated_coordinates
[
j
,
0
:
2
]
x
,
y
=
rotated_coordinates
[
j
,
0
:
2
]
phase
=
_compute_expected_phase_delay
(
l
,
m
,
x
,
y
,
frequency
)
phase
=
_compute_expected_phase_delay
(
l
,
m
,
x
,
y
,
frequency
)
...
@@ -229,7 +232,7 @@ def _solve_gains(visibilities, matrix, **kwargs):
...
@@ -229,7 +232,7 @@ def _solve_gains(visibilities, matrix, **kwargs):
return
__empty
return
__empty
def
_solve_gains_per_frequency
(
dataset
,
datatable
,
frequency
,
direct_complex
=
Fals
e
,
**
kwargs
):
def
_solve_gains_per_frequency
(
dataset
,
datatable
,
frequency
,
direct_complex
=
Tru
e
,
**
kwargs
):
"""
"""
SOLVE THE EQUATION M * G = V FOR G
SOLVE THE EQUATION M * G = V FOR G
:param dataset:
:param dataset:
...
@@ -239,13 +242,27 @@ def _solve_gains_per_frequency(dataset, datatable, frequency, direct_complex=Fal
...
@@ -239,13 +242,27 @@ def _solve_gains_per_frequency(dataset, datatable, frequency, direct_complex=Fal
:type frequency: float
:type frequency: float
:return:
:return:
"""
"""
matrix
=
_compute_pointing_matrices_per_station_frequency_beam
(
dataset
,
datatable
,
frequency
)
central_beam
=
dataset
.
central_beamlets
[
str
(
frequency
)]
matrix
=
_compute_pointing_matrices_per_station_frequency_beam
(
dataset
,
datatable
,
central_beam
,
frequency
)
n_beams
=
len
(
datatable
)
n_beams
=
len
(
datatable
)
result
=
dict
()
result
=
dict
()
#flags = numpy.array(
# [datatable[str(i)]['mean']['flag'] for i in range(n_beams)])
#__empty = dict(gains=numpy.array(numpy.nan),
# residual=numpy.array(numpy.nan),
# relative_error=numpy.array(numpy.nan),
# flag=numpy.array(True))
#is_frequency_flagged = flags
for
polarization
in
[
'
XX
'
,
'
XY
'
,
'
YX
'
,
'
YY
'
]:
for
polarization
in
[
'
XX
'
,
'
XY
'
,
'
YX
'
,
'
YY
'
]:
visibilities
=
numpy
.
matrix
(
visibilities
=
numpy
.
matrix
(
[
datatable
[
str
(
i
)][
'
mean
'
][
polarization
]
for
i
in
range
(
n_beams
)])
[
datatable
[
str
(
i
)][
'
mean
'
][
polarization
]
for
i
in
range
(
n_beams
)])
if
direct_complex
is
True
:
if
direct_complex
is
True
:
result
[
polarization
]
=
_solve_gains
(
visibilities
,
matrix
,
**
kwargs
)
result
[
polarization
]
=
_solve_gains
(
visibilities
,
matrix
,
**
kwargs
)
else
:
else
:
...
...
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