Skip to content

Commit db437d4

Browse files
author
landmanbester
committed
start renaming pfb-clean -> pfb-imaging
1 parent 9c2c1fd commit db437d4

File tree

8 files changed

+59
-68
lines changed

8 files changed

+59
-68
lines changed

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: pfb-clean Workflow
1+
name: pfb-imaging Workflow
22

33
on:
44
push:
@@ -31,7 +31,7 @@ jobs:
3131
# - name: Pin setuptools
3232
# run: python -m pip install setuptools==65.5
3333

34-
- name: Install pfb-clean
34+
- name: Install pfb-imaging
3535
run: python -m pip install .[testing]
3636

3737
- name: Run tests

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ RUN apt -y update && \
1212

1313

1414
RUN python -m pip install -U pip setuptools wheel && \
15-
python -m pip install -U pfb-clean@git+https://github.com/ratt-ru/pfb-clean@main && \
15+
python -m pip install -U pfb-imaging@git+https://github.com/ratt-ru/pfb-imaging@main && \
1616
python -m pip install numpy==1.22 && \
1717
python -m pip cache purge

README.rst

+3-11
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
pfb-clean
1+
pfb-imaging
22
=========
3-
Preconditioned forward-backward clean algorithm.
3+
Radio interferometric imaging suite base on the pre-conditioned forward-backward algorithm.
44

55
Install the package by cloning and running
66

7-
:code:`$ pip install -e pfb-clean/`
7+
:code:`$ pip install -e pfb-imaging/`
88

99
Note casacore needs to be installed on the system for this to work.
1010

@@ -19,14 +19,6 @@ no binary mode eg
1919

2020
:code:`$ pip install -e ducc`
2121

22-
You may also have to make numba aware of the tbb layer by doing
23-
24-
:code:`$ pip install tbb`
25-
26-
:code:`$ export LD_LIBRARY_PATH=/path/to/venv/lib`
27-
28-
see eg. https://github.com/ratt-ru/QuartiCal/issues/268
29-
3022
If you find any of this useful please cite (for now)
3123

3224
https://arxiv.org/abs/2101.08072

pfb/utils/fits.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def set_wcs(cell_x, cell_y, nx, ny, radec, freq,
6868

6969
header = w.to_header()
7070
header['RESTFRQ'] = fmean
71-
header['ORIGIN'] = 'pfb-clean'
71+
header['ORIGIN'] = 'pfb-imaging'
7272
header['BTYPE'] = 'Intensity'
7373
header['BUNIT'] = unit
7474
header['SPECSYS'] = 'TOPOCENT'

pfb/utils/misc.py

+46-46
Original file line numberDiff line numberDiff line change
@@ -1444,52 +1444,52 @@ def combine_columns(x, y, dc, dc1, dc2):
14441444
return x
14451445

14461446

1447-
# def fft_interp(image, cellxi, cellyi, nxo, nyo,
1448-
# cellxo, cellyo, shiftx, shifty):
1449-
# '''
1450-
# Use non-uniform fft to interpolate image in a flux conservative way
1451-
1452-
# image - input image
1453-
# cellxi - input x cell-size
1454-
# cellyi - input y cell-size
1455-
# nxo - number of x pixels in output
1456-
# nyo - number of y pixels in output
1457-
# cellxo - output x cell size
1458-
# cellyo - output y cell size
1459-
# shiftx - shift x coordinate by this amount
1460-
# shifty - shift y coordinate by this amount
1461-
1462-
# All sizes are assumed to be in radians.
1463-
# '''
1464-
# import matplotlib.pyplot as plt
1465-
# from scipy.fft import fftn, ifftn
1466-
# Fs = np.fft.fftshift
1467-
# iFs = np.fft.ifftshift
1468-
# # basic
1469-
# nx, ny = image.shape
1470-
# imhat = Fs(fftn(image))
1471-
1472-
# imabs = np.abs(imhat)
1473-
# imphase = np.angle(imhat) - 1.0
1474-
# # imphase = np.roll(imphase, nx//2, axis=0)
1475-
# imshift = ifftn(iFs(imabs*np.exp(1j*imphase))).real
1476-
1477-
# impad = np.pad(imhat, ((nx//2, nx//2), (ny//2, ny//2)), mode='constant')
1478-
# imo = ifftn(iFs(impad)).real
1479-
1480-
# print(np.sum(image) - np.sum(imo))
1481-
1482-
# plt.figure(1)
1483-
# plt.imshow(image/image.max(), vmin=0, vmax=1, interpolation=None)
1484-
# plt.colorbar()
1485-
# plt.figure(2)
1486-
# plt.imshow(imo/imo.max(), vmin=0, vmax=1, interpolation=None)
1487-
# plt.colorbar()
1488-
# plt.figure(3)
1489-
# plt.imshow(imshift/imshift.max() - image/image.max(), vmin=0, vmax=1, interpolation=None)
1490-
# plt.colorbar()
1491-
1492-
# plt.show()
1447+
def fft_interp(image, cellxi, cellyi, nxo, nyo,
1448+
cellxo, cellyo, shiftx, shifty):
1449+
'''
1450+
Use non-uniform fft to interpolate image in a flux conservative way
1451+
1452+
image - input image
1453+
cellxi - input x cell-size
1454+
cellyi - input y cell-size
1455+
nxo - number of x pixels in output
1456+
nyo - number of y pixels in output
1457+
cellxo - output x cell size
1458+
cellyo - output y cell size
1459+
shiftx - shift x coordinate by this amount
1460+
shifty - shift y coordinate by this amount
1461+
1462+
All sizes are assumed to be in radians.
1463+
'''
1464+
import matplotlib.pyplot as plt
1465+
from scipy.fft import fftn, ifftn
1466+
Fs = np.fft.fftshift
1467+
iFs = np.fft.ifftshift
1468+
# basic
1469+
nx, ny = image.shape
1470+
imhat = Fs(fftn(image))
1471+
1472+
# imabs = np.abs(imhat)
1473+
# imphase = np.angle(imhat) - 1.0
1474+
# imphase = np.roll(imphase, nx//2, axis=0)
1475+
# imshift = ifftn(iFs(imabs*np.exp(1j*imphase))).real
1476+
1477+
impad = np.pad(imhat, ((nx//2, nx//2), (ny//2, ny//2)), mode='constant')
1478+
imo = ifftn(iFs(impad)).real
1479+
1480+
print(np.sum(image) - np.sum(imo))
1481+
1482+
plt.figure(1)
1483+
plt.imshow(image/image.max(), vmin=0, vmax=1, interpolation=None)
1484+
plt.colorbar()
1485+
plt.figure(2)
1486+
plt.imshow(imo/imo.max(), vmin=0, vmax=1, interpolation=None)
1487+
plt.colorbar()
1488+
# plt.figure(3)
1489+
# plt.imshow(imshift/imshift.max() - image/image.max(), vmin=0, vmax=1, interpolation=None)
1490+
# plt.colorbar()
1491+
1492+
plt.show()
14931493

14941494
# # coordinates on input grid
14951495
# nx, ny = image.shapeimhat

pfb/workers/main.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ def cli():
77
pass
88

99

10-
from pfb.workers import (init, grid, degrid,
11-
klean, restore, fwdbwd,
12-
spotless, model2comps,
10+
from pfb.workers import (init, grid, degrid, klean,
11+
restore, spotless, model2comps,
1312
fluxmop, fastim, smoovie)

setup.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@
2828

2929

3030
setup(
31-
name='pfb-clean',
31+
name='pfb-imaging',
3232
version=pfb.__version__,
3333
author="Landman Bester",
3434
author_email="lbester@sarao.ac.za",
35-
description="Pre-conditioned forward-backward CLEAN algorithm",
35+
description="Radio interferometric imaging suite base on the pre-conditioned forward-backward algorithm",
3636
long_description=long_description,
3737
long_description_content_type="text/markdown",
38-
url="https://github.com/ratt-ru/pfb-clean",
38+
url="https://github.com/ratt-ru/pfb-imaging",
3939
packages=find_packages(),
4040
include_package_data=True,
4141
zip_safe=False,

tbump.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Uncomment this if your project is hosted on GitHub:
2-
github_url = "https://github.com/ratt-ru/pfb-clean/"
2+
github_url = "https://github.com/ratt-ru/pfb-imaging/"
33

44
[version]
55
current = "0.0.1"

0 commit comments

Comments
 (0)