Skip to content

Commit

Permalink
Remove unused things
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKurek authored and tammojan committed Nov 26, 2024
1 parent 0b1643d commit 0cf2f92
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
1 change: 0 additions & 1 deletion collect_from_opcua.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from lofarimaging.opc_interface import download_xst
from lofarimaging import make_xst_plots
import threading
import sys
import matplotlib.pyplot as plt
import logging

Expand Down
10 changes: 5 additions & 5 deletions lofarimaging/lofarimaging.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Functions for working with LOFAR single station data"""

from typing import Dict, List
from typing import Dict
import numpy as np
from numpy.linalg import norm, lstsq
import numexpr as ne
Expand Down Expand Up @@ -125,10 +125,10 @@ def nearfield_imager(visibilities, baseline_indices, freqs, npix_p, npix_q, exte
np.add(distances[baseline_indices[vis_chunkstart:vis_chunkend, 0]],
-distances[baseline_indices[vis_chunkstart:vis_chunkend, 1]], out=bl_diff_chunk)

j2pi = 1j * 2 * np.pi
# j2pi = 1j * 2 * np.pi
for ifreq, freq in enumerate(freqs):
v = visibilities[vis_chunkstart:vis_chunkend, ifreq][:, None, None]
lamb = SPEED_OF_LIGHT / freq
# v = visibilities[vis_chunkstart:vis_chunkend, ifreq][:, None, None]
# lamb = SPEED_OF_LIGHT / freq

# v[:,np.newaxis,np.newaxis]*np.exp(-2j*np.pi*freq/c*groundbase_pixels[:,:,:]/c)
# groundbase_pixels=nvis x npix x npix
Expand Down Expand Up @@ -171,7 +171,7 @@ def calibrate(vis, modelvis, maxiter=30, amplitudeonly=True):
if amplitudeonly:
gains = np.abs(gains).astype(np.complex128)
if iteration % 2 == 0 and iteration > 0:
dg = norm(gains - gains_prev)
# dg = norm(gains - gains_prev)
residual = vis.copy()
for d in range(ndir):
residual -= np.diag(np.conj(gains[d])) @ modelvis[d] @ np.diag(gains[d])
Expand Down
6 changes: 2 additions & 4 deletions lofarimaging/opc_interface.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import logging

from opcua import ua, uamethod, Server, Client
from opcua import Client
import numpy as np

DEFAULT_URI = "http://lofar.eu"
Expand All @@ -26,7 +24,7 @@ def download_xst(subband: int, integration_time_s: int, url: str = 'localhost',
client = Client("opc.tcp://{}:{}/".format(url, port), timeout=1000)
client.connect()
client.load_type_definitions()
objects = client.get_objects_node()
# objects = client.get_objects_node()
idx = client.get_namespace_index(DEFAULT_URI)
obj = client.get_root_node().get_child(["0:Objects",
"{}:StationMetrics".format(idx),
Expand Down

0 comments on commit 0cf2f92

Please sign in to comment.