Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions lofarimaging/lofarimaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
__all__ = ["nearfield_imager", "sky_imager", "ground_imager", "skycoord_to_lmn", "calibrate", "simulate_sky_source",
"subtract_sources"]

__version__ = "1.5.0"
__version__ = "1.5.1"
SPEED_OF_LIGHT = 299792458.0


Expand Down Expand Up @@ -118,20 +118,18 @@ def nearfield_imager(visibilities, baseline_indices, freqs, npix_p, npix_q, exte

bl_diff = np.zeros((vis_chunksize, npix_q, npix_p), dtype=np.float64)
img = np.zeros((npix_q, npix_p), dtype=np.complex128)
j2pi = 1j * 2 * np.pi
for vis_chunkstart in range(0, len(baseline_indices), vis_chunksize):
vis_chunkend = min(vis_chunkstart + vis_chunksize, baseline_indices.shape[0])
# For the last chunk, bl_diff_chunk is a bit smaller than bl_diff
bl_diff_chunk = bl_diff[:vis_chunkend - vis_chunkstart, :]
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
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
np.add(img, np.sum(ne.evaluate("v * exp(j2pi * bl_diff_chunk / lamb)"), axis=0), out=img)
img /= len(freqs) * len(baseline_indices)

Expand Down
2 changes: 1 addition & 1 deletion lofarimaging/maputil.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

__all__ = ["get_map", "make_leaflet_map"]

__version__ = "1.5.0"
__version__ = "1.5.1"


def get_map(lon_min, lon_max, lat_min, lat_max, zoom=19):
Expand Down
6 changes: 3 additions & 3 deletions lofarimaging/singlestationutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import matplotlib.axes as maxes
from mpl_toolkits.axes_grid1 import make_axes_locatable

from astropy.coordinates import SkyCoord, GCRS, EarthLocation, AltAz, get_sun, get_moon
from astropy.coordinates import SkyCoord, GCRS, EarthLocation, AltAz, get_sun, get_body
import astropy.units as u
from astropy.time import Time

Expand All @@ -37,7 +37,7 @@
"make_sky_plot", "make_ground_plot", "make_xst_plots", "apply_calibration",
"get_full_station_name", "get_extent_lonlat", "make_sky_movie", "reimage_sky"]

__version__ = "1.5.0"
__version__ = "1.5.1"

# Configurations for HBA observations with a single dipole activated per tile.
GENERIC_INT_201512 = [0, 5, 3, 1, 8, 3, 12, 15, 10, 13, 11, 5, 12, 12, 5, 2, 10, 8, 0, 3, 5, 1, 4, 0, 11, 6, 2, 4, 9,
Expand Down Expand Up @@ -723,7 +723,7 @@ def make_xst_plots(xst_data: np.ndarray,
'Cen A': SkyCoord(ra=201.36506288*u.deg, dec=-43.01911267*u.deg),
'Vir A': SkyCoord(ra=187.70593076*u.deg, dec=12.39112329*u.deg),
'3C295': SkyCoord(ra=212.83527917*u.deg, dec=52.20264444*u.deg),
'Moon': get_moon(time=obstime_astropy, location=station_earthlocation).transform_to(gcrs_instance),
'Moon': get_body(body = "MOON", time=obstime_astropy, location=station_earthlocation).transform_to(gcrs_instance),
'Sun': get_sun(time=obstime_astropy).transform_to(gcrs_instance),
'3C196': SkyCoord(ra=123.40023371*u.deg, dec=48.21739888*u.deg)
}
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ build-backend = "hatchling.build"

[project]
name = "lofarimaging"
version = "1.5.0"
version = "1.5.1"
authors = [
{ name="Vanessa Moss", email="[email protected]" },
{ name="Michiel Brentjens" },
Expand Down
Loading