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

Vis class UPdate #63

Merged
merged 53 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
aed809b
define first draft definition of visibility class API
annavolp Apr 29, 2024
fda39cd
add phase_uncertainty andamplitude_uncertainty to VisibilityABC
annavolp Apr 29, 2024
53a5689
update visibilities API
annavolp Apr 29, 2024
689674c
update Visibilities class
annavolp Apr 29, 2024
da235bb
Split up visibilitiesABC into VisibilitiesBaseABC and methods
annavolp Apr 30, 2024
9b0a9f4
implement VisibilitiesBase and Visibilities class
annavolp Apr 30, 2024
2d9428c
implement amplitude, amplitude_uncertainty, phase, phase_uncertainty
annavolp Apr 30, 2024
d89fd35
implement VisMeta class
annavolp Apr 30, 2024
342b951
fix indentation
annavolp Apr 30, 2024
8b258ff
fix the bugs
annavolp Apr 30, 2024
bdbbe70
Update xrayvision/visibility.py
annavolp Apr 30, 2024
2b3c9c3
fix the bugs in VisibilitiesBase class
annavolp Apr 30, 2024
a64462f
Add slicing by name to Visibilities class.
DanRyanIrish May 1, 2024
8e3d444
Merge branch 'vis_class' of https://github.com/annavolp/xrayvision in…
DanRyanIrish May 1, 2024
84f1a87
update in Visibilities Classs
annavolp May 1, 2024
46e44ad
Make underlying Visibilities data structure an xarray.
DanRyanIrish May 2, 2024
06eb355
Merge branch 'vis_class' of https://github.com/annavolp/xrayvision in…
DanRyanIrish May 2, 2024
ffd087e
removes defunct getitem from VisibilitiesBase.
DanRyanIrish May 2, 2024
2f87e85
Merge pull request #1 from DanRyanIrish/vis_class
annavolp May 7, 2024
bf5e986
Update test_visibility.py
annavolp May 14, 2024
2ae7b43
Add xarray as dependency to package.
DanRyanIrish May 18, 2024
f0a8500
Fix bug in VisibilitiesBase __init__ and fix codestyle.
DanRyanIrish May 18, 2024
0e8ae99
Merge branch 'main' of https://github.com/TCDSolar/xrayvision into vi…
DanRyanIrish May 18, 2024
e607b3c
Merge pull request #2 from DanRyanIrish/vis_class
annavolp May 21, 2024
28ff120
Update VisMeta class so its call signature is a little more like ndcu…
DanRyanIrish May 21, 2024
c4c5569
Fix codestyle.
DanRyanIrish May 21, 2024
4264858
Add changelog.
DanRyanIrish May 21, 2024
faac140
Docstring improvements.
DanRyanIrish May 21, 2024
dd55a38
Merge pull request #3 from DanRyanIrish/vis_class
annavolp May 21, 2024
757cf38
Apply suggestions from code review
annavolp May 21, 2024
e30e7b4
Update Visibilities API, including moving phase center to attribute o…
DanRyanIrish May 21, 2024
9377362
Consolidate new Visibilities API into single ABC and implemented class.
DanRyanIrish May 21, 2024
ccd7787
Fix codstyle.
DanRyanIrish May 21, 2024
cb9170d
Make meta getter on Visibilities class more flexible.
DanRyanIrish May 21, 2024
0c54fd6
Add setter for phase center.w
DanRyanIrish May 22, 2024
3e56e05
Fix codestyle
DanRyanIrish May 22, 2024
6dd0212
Fix typo.
DanRyanIrish May 22, 2024
ce4c015
Reduce call signature of Visibilities class by relying on meta to inc…
DanRyanIrish May 22, 2024
8237d25
Introduce input type checking to VisMeta. Also make unit typing consi…
DanRyanIrish May 22, 2024
5d6a64a
Fix Visibilities.meta so vis labels output is of correct type.
DanRyanIrish May 22, 2024
2d4a97a
Update changelog 55.
DanRyanIrish May 22, 2024
311153e
Update visibility.__all__
DanRyanIrish May 22, 2024
a58700a
Remove VisMeta phase_center setter.
DanRyanIrish May 22, 2024
6ab3cbb
Remove phase_center from VisMeta and store directly on Visibilities c…
DanRyanIrish May 23, 2024
a9c89bf
Change changleog 55 to changelog 62.
DanRyanIrish May 23, 2024
6c1de94
Rename changlelog 62 back to 55.
DanRyanIrish May 23, 2024
7d53d29
Apply suggestions from code review
DanRyanIrish May 23, 2024
0a84137
Apply changes from code review.
DanRyanIrish May 23, 2024
ed379cc
Fix codestyle.
DanRyanIrish May 23, 2024
8b1fff7
Fix meta typing for Visibilities class.
DanRyanIrish May 24, 2024
bbc5ab6
Merge branch 'main' of https://github.com/TCDSolar/xrayvision into vi…
DanRyanIrish May 24, 2024
4a4fad9
Add changelog 63.
DanRyanIrish May 24, 2024
3339083
Fix instantiation of default VisMeta in Visibilities.
DanRyanIrish May 24, 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
1 change: 1 addition & 0 deletions changelog/63.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Change typing of meta input to `~xrayvision.visibility.Visibilities` to be a `~xrayvision.visibilities.VisMeta`.
2 changes: 1 addition & 1 deletion xrayvision/tests/test_visibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def visibilities():
v = [-0.0013, 0.013] * 1 / apu.arcsec
phase_center = [0, 0] * apu.arcsec
unc = [0.01, 0.15] * apu.ct
meta = {"vis_labels": ["3a", "10b"]}
meta = vm.VisMeta({"vis_labels": ["3a", "10b"]})
return vm.Visibilities(visibilities, u, v, phase_center, uncertainty=unc, meta=meta)


Expand Down
10 changes: 4 additions & 6 deletions xrayvision/visibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import abc
from typing import Union, Optional
from collections.abc import Iterable, MutableMapping
from collections.abc import Iterable

import astropy.units as apu
import numpy as np
Expand Down Expand Up @@ -141,7 +141,7 @@
u: apu.Quantity[1 / apu.deg],
v: apu.Quantity[1 / apu.deg],
phase_center: apu.Quantity[apu.arcsec] = [0, 0] * apu.arcsec,
meta: MutableMapping = dict(),
meta: Optional[VisMetaABC] = None,
uncertainty: Optional[apu.Quantity] = None,
amplitude: Optional[apu.Quantity] = None,
amplitude_uncertainty: Optional[apu.Quantity] = None,
Expand Down Expand Up @@ -224,10 +224,6 @@
self._uv_key = "uv"
self._units_key = "units"

# Build meta. Make sure that phase center is included.
if not isinstance(meta, VisMetaABC):
meta = VisMeta(meta)

# Construct underlying data object.
# In case visibilities is multi-dimensional, assume last axis is the uv-axis.
# and give other axes arbitrary names.
Expand All @@ -246,6 +242,8 @@
units[self._phase_key] = phase.unit
if phase_uncertainty is not None:
data[self._phase_uncert_key] = (dims, phase_uncertainty.to_value(phase.unit))
if meta is None:
meta = VisMeta(dict())

Check warning on line 246 in xrayvision/visibility.py

View check run for this annotation

Codecov / codecov/patch

xrayvision/visibility.py#L246

Added line #L246 was not covered by tests
vis_labels = meta.vis_labels
if vis_labels is not None:
if len(vis_labels) != nvis:
Expand Down
Loading