Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] v0.3 tracking branch #248

Merged
merged 71 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
bdc5c2d
GridCoords constructor with props and cached_props
kadri-nizam Apr 5, 2023
a8f7c6f
Merge branch 'MPoL-dev:main' into #152-coordinates
kadri-nizam Apr 5, 2023
8391981
GridCoords repr and fix coordinates test
kadri-nizam Apr 5, 2023
e8a42bd
Fix wrong variable
kadri-nizam Apr 5, 2023
99f4058
Fix missing bracket and add meshgrid vs tile test
kadri-nizam Apr 5, 2023
d648ac9
Update src/mpol/coordinates.py
kadri-nizam Apr 6, 2023
63b9b77
Update uv variable names
kadri-nizam Apr 6, 2023
411fa18
Merge branch '#152-coordinates' of github.com:kadri-nizam/MPol into #…
kadri-nizam Apr 6, 2023
3db16e8
first commit on loss branch, changelog stub.
iancze Dec 27, 2023
9f1ea92
fixed log_likelihood weight factors.
iancze Dec 27, 2023
2177960
fixed log_likelihood weight factors.
iancze Dec 28, 2023
ba63e19
tests passing again.
iancze Dec 28, 2023
2709d3b
some changes to make_fake_data but still docs build errors.
iancze Dec 28, 2023
d8e9829
changes to docs to build.
iancze Dec 28, 2023
d64fecd
updated README with library scope for MPoL.
iancze Dec 28, 2023
a64c1b8
added links to readme.
iancze Dec 28, 2023
5ead82a
switched index to md.
iancze Dec 28, 2023
94ab743
converted api to md.
iancze Dec 28, 2023
c2e5370
tests and docs build.
iancze Dec 28, 2023
fe9c786
addressed #153 internally, keeping result the same using kadri's pyto…
iancze Dec 28, 2023
7c9b3a2
simplified developer documentation.
iancze Dec 28, 2023
4350f95
consolidated loss function math into API.
iancze Dec 29, 2023
62b341d
separating longer format tutorials to examples.
iancze Dec 29, 2023
1bd07f3
introductory notes.
iancze Dec 29, 2023
66c7864
large restructuring of intro text and API into folder.
iancze Dec 29, 2023
f710838
removed connectors_test to datasets_test, added RIME and CASA conj to…
iancze Dec 29, 2023
a085ecf
added notes to changelog.
iancze Dec 29, 2023
dee9128
Merge pull request #247 from MPoL-dev/loss-correction
iancze Dec 29, 2023
d3f11b7
starting changelog for lambda.
iancze Dec 30, 2023
7cd7631
simplified tests to take only baselines where needed.
iancze Dec 31, 2023
f6c6927
added source baselines and img for mock data.
iancze Dec 31, 2023
53ec3ad
removed convert baselines closes #227
iancze Jan 1, 2024
7e55d0f
tests pass in intermediate fake dataset state.
iancze Jan 1, 2024
dda51cd
updated types and coverage.
iancze Jan 1, 2024
0de30ac
disabling residual plot for now.
iancze Jan 1, 2024
a4d8572
full mypy coverage for core routines.
iancze Jan 1, 2024
969c4b6
renamed SimpleNet to GriddedNet, tests pass locally.
iancze Jan 1, 2024
caa27cc
rewrote some mock data using butterfly image and passed some more tests.
iancze Jan 4, 2024
ed65754
commenting out TrainTest and CrossVal for now.
iancze Jan 5, 2024
1532251
tests pass with new mock data.
iancze Jan 5, 2024
ba2b39a
tests pass locally after base unit change.
iancze Jan 5, 2024
600b478
another spot to convert.
iancze Jan 5, 2024
8aa609f
updated to new resid funcitonality.
iancze Jan 5, 2024
e5e6d8b
resolved merge conflicts.
iancze Jan 5, 2024
acfbbd9
Merge pull request #250 from MPoL-dev/coordinates
iancze Jan 5, 2024
84e1b7d
Merge pull request #249 from MPoL-dev/base-unit
iancze Jan 5, 2024
e2e3acb
anticipated changes.
iancze Jan 5, 2024
aaacddc
removed stale comment.
iancze Jan 5, 2024
860be57
changed basecube default value.
iancze Jan 6, 2024
5b48924
adding conftest changes
iancze Jan 6, 2024
296f0bf
removed basecube from test entirely.
iancze Jan 6, 2024
65173f7
added untested convolve method.
iancze Jan 7, 2024
8437f53
implemented UV Gaussian taper, image convolve, and tests.
iancze Jan 8, 2024
c27f230
added tests for non-circular PSF with rotation.
iancze Jan 8, 2024
8ccad6c
fixing type error.
iancze Jan 8, 2024
f396e15
Merge branch 'main' of https://github.com/MPoL-dev/MPoL into sgd
iancze Jan 10, 2024
d1ab601
removing autodoc2, unused.
iancze Jan 10, 2024
5554125
added ruff as test and dev dependency
iancze Jan 18, 2024
5e03444
initial ruff fixes.
iancze Jan 18, 2024
dc54cc8
ruff passing with basics.
iancze Jan 18, 2024
0e0a576
fix docstring @ kristin.hopley
iancze Jan 26, 2024
f9cc5cb
switched to float32 default throughout codebase.
iancze Feb 29, 2024
13a3a06
fixed ruff checks.
iancze Feb 29, 2024
3c5da5b
Merge pull request #255 from MPoL-dev/float32
iancze Feb 29, 2024
c1b70ef
updated docstring and changed default Omega to 0.
iancze Mar 1, 2024
0b9e416
working rotating Gaussian convolve.
iancze Mar 4, 2024
add01fe
added Gauss Fourier option for Base Cube.
iancze Mar 5, 2024
0b5db31
removed nchan from gauss
iancze Mar 5, 2024
1b3271a
added fixed resolution base gauss.
iancze Mar 5, 2024
4c7b453
consolidated Gauss routines.
iancze Mar 6, 2024
d06fc25
Merge pull request #252 from MPoL-dev/sgd
iancze Apr 26, 2024
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
8 changes: 2 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,9 @@ jobs:
- name: Install test dependencies
run: |
pip install .[test]
- name: Lint with flake8
- name: Lint with ruff
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
ruff check .
- name: Check types with MyPy
run: |
mypy src/mpol --pretty
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,6 @@ plotsdir
runs

# hatch-generated version file
src/mpol/mpol_version.py
src/mpol/mpol_version.py

.ruff_cache
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ Contributors
* Hannah Grzybowski, `@hgrzy`
* Mary Ogborn
* Tyler Quinn, `@trq5014`
* Kristin Hopley
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@
[![gh-pages docs](https://github.com/MPoL-dev/MPoL/actions/workflows/gh_docs.yml/badge.svg)](https://mpol-dev.github.io/MPoL/)
[![DOI](https://zenodo.org/badge/224543208.svg)](https://zenodo.org/badge/latestdoi/224543208)

A Million Points of Light are needed to synthesize image cubes from interferometers.

MPoL is a flexible Python package designed for Regularized Maximum Likelihood imaging. We focus on supporting spectral line and continuum observations from interferometers like the Atacama Large Millimeter/Submillimeter Array (ALMA) and the Karl G. Jansky Very Large Array (VLA). There is potential to extend the package to work on other Fourier reconstruction problems like sparse aperture masking and kernel phase interferometry.

Documentation and installation instructions: [https://mpol-dev.github.io/MPoL/](https://mpol-dev.github.io/MPoL/)
MPoL is a [PyTorch](https://pytorch.org/) *library* built for Regularized Maximum Likelihood (RML) imaging and Bayesian Inference with datasets from interferometers like the Atacama Large Millimeter/Submillimeter Array ([ALMA](https://www.almaobservatory.org/en/home/)) and the Karl G. Jansky Very Large Array ([VLA](https://public.nrao.edu/telescopes/vla/)).

As a PyTorch *library*, MPoL is designed expecting that the user will write Python code that uses MPoL primitives as building blocks to solve their interferometric imaging workflow, much the same way the artificial intelligence community writes Python code that uses PyTorch layers to implement new neural network architectures (for [example](https://github.com/pytorch/examples)). You will find MPoL easiest to use if you adhere to PyTorch customs and idioms, e.g., feed-forward neural networks, data storage, GPU acceleration, and train/test optimization loops. Therefore, a basic familiarity with PyTorch is considered a prerequisite for MPoL.

MPoL is *not* an imaging application nor a pipeline, though such programs could be built for specialized workflows using MPoL components. We are focused on providing a numerically correct and expressive set of core primitives so the user can leverage the full power of the PyTorch (and Python) ecosystem to solve their research-grade imaging tasks. This is already a significant development and maintenance burden for our small research team, so our immediate scope must necessarily be limited.

Installation instructions, documentation, and examples at: [https://mpol-dev.github.io/MPoL/](https://mpol-dev.github.io/MPoL/)



## Citation

Expand Down Expand Up @@ -57,4 +63,6 @@ and
}

---
Copyright Ian Czekala and contributors 2019-23
Copyright Ian Czekala and contributors 2019-24

A Million Points of Light are needed to synthesize image cubes from interferometers.
20 changes: 10 additions & 10 deletions docs/_static/baselines/src/print_conversions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import csv

import numpy as np
from mpol.constants import c_ms

import argparse

parser = argparse.ArgumentParser(
Expand All @@ -6,11 +11,6 @@
parser.add_argument("outfile", help="Destination to save CSV table.")
args = parser.parse_args()

import csv

import numpy as np

from mpol.constants import c_ms

header = ["baseline", "100 GHz (Band 3)", "230 GHz (Band 6)", "340 GHz (Band 7)"]

Expand All @@ -20,18 +20,18 @@

def format_baseline(baseline_m):
if baseline_m < 1e3:
return "{:.0f} m".format(baseline_m)
return f"{baseline_m:.0f} m"
elif baseline_m < 1e6:
return "{:.0f} km".format(baseline_m * 1e-3)
return f"{baseline_m * 1e-3:.0f} km"


def format_lambda(lam):
if lam < 1e3:
return "{:.0f}".format(lam) + " :math:`\lambda`"
return f"{lam:.0f}" + r" :math:`\lambda`"
elif lam < 1e6:
return "{:.0f}".format(lam * 1e-3) + " :math:`\mathrm{k}\lambda`"
return f"{lam * 1e-3:.0f}" + r" :math:`\mathrm{k}\lambda`"
else:
return "{:.0f}".format(lam * 1e-6) + " :math:`\mathrm{M}\lambda`"
return f"{lam * 1e-6:.0f}" + r" :math:`\mathrm{M}\lambda`"


data = []
Expand Down
14 changes: 7 additions & 7 deletions docs/_static/fftshift/src/plot.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import argparse

parser = argparse.ArgumentParser(description="Create the fftshift plot")
parser.add_argument("outfile", help="Destination to save plot.")
args = parser.parse_args()

import matplotlib.pyplot as plt
import numpy as np
from astropy.io import fits
from astropy.utils.data import download_file
from matplotlib import patches
from matplotlib.colors import LogNorm
from matplotlib.gridspec import GridSpec

from mpol import coordinates

import argparse

parser = argparse.ArgumentParser(description="Create the fftshift plot")
parser.add_argument("outfile", help="Destination to save plot.")
args = parser.parse_args()


fname = download_file(
"https://zenodo.org/record/4711811/files/logo_cont.fits",
cache=True,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
graph TD
subgraph SimpleNet
subgraph GriddedNet
bc(BaseCube) --> HannConvCube
HannConvCube --> ImageCube
ImageCube --> FourierLayer
Expand Down
80 changes: 0 additions & 80 deletions docs/api.rst

This file was deleted.

6 changes: 6 additions & 0 deletions docs/api/analysis.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Analysis

```{eval-rst}
.. automodule:: mpol.onedim
:members:
```
6 changes: 6 additions & 0 deletions docs/api/coordinates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Coordinates

```{eval-rst}
.. automodule:: mpol.coordinates
:members:
```
6 changes: 6 additions & 0 deletions docs/api/crossval.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Cross-validation

```{eval-rst}
.. automodule:: mpol.crossval
:members:
```
6 changes: 6 additions & 0 deletions docs/api/datasets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Datasets

```{eval-rst}
.. automodule:: mpol.datasets
:members:
```
6 changes: 6 additions & 0 deletions docs/api/fourier.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Fourier

```{eval-rst}
.. automodule:: mpol.fourier
:members:
```
6 changes: 6 additions & 0 deletions docs/api/geometry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Geometry

```{eval-rst}
.. automodule:: mpol.geometry
:members:
```
6 changes: 6 additions & 0 deletions docs/api/gridding.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Gridding

```{eval-rst}
.. automodule:: mpol.gridding
:members:
```
6 changes: 6 additions & 0 deletions docs/api/images.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Images

```{eval-rst}
.. automodule:: mpol.images
:members:
```
Loading
Loading