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

1D analysis #159

Merged
merged 125 commits into from
Nov 3, 2023
Merged
Changes from 1 commit
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
134c5ab
CrossValidate: add model to self
jeffjennings Feb 20, 2023
95bf0e0
CrossValidate: rename var
jeffjennings Feb 20, 2023
7e18237
add onedim.py, func to get 1d vis fit
jeffjennings Feb 20, 2023
a5f6365
add 1d radial profile func
jeffjennings Feb 20, 2023
0c0ffc8
get_radial_profile: simplify args
jeffjennings Feb 20, 2023
aa5dd0c
typos
jeffjennings Feb 20, 2023
1d288c2
add deproject_vis routine
jeffjennings Feb 20, 2023
9b43c9b
setup.py: add new type of EXTRA, with frank
jeffjennings Feb 20, 2023
8ac919c
get_radial_profile: add comments, stage deprojec.
jeffjennings Feb 20, 2023
3055639
get_1d_vis_fit: stage vis deprojection
jeffjennings Feb 20, 2023
0b6da4b
move frank import internal to func
jeffjennings Feb 21, 2023
ce50793
get_radial_profile: bug fix (norm radial profile)
jeffjennings Feb 21, 2023
4f02353
Merge branch 'main' into one_dim
jeffjennings Feb 21, 2023
5437e0c
deproject_vis: add TODO
jeffjennings Feb 21, 2023
b4c318c
typo
jeffjennings Feb 22, 2023
dd7324f
get_1d_vis_fit: only intake `model`
jeffjennings Feb 22, 2023
a34374a
Merge branch 'main' into one_dim
jeffjennings Feb 22, 2023
8d93ec3
setup.py: copy/paste typo
jeffjennings Feb 22, 2023
a98f711
CrossValidate: hold off on hyperpar changes
jeffjennings Feb 22, 2023
b565fbc
Merge branch 'main' into one_dim
jeffjennings Feb 24, 2023
e4c121b
fold deproject_vis into get_1d_vis_fit
jeffjennings Feb 24, 2023
e30b3db
get_radial_profile: clean up docstring
jeffjennings Feb 24, 2023
6f2471b
get_radial_profile: convert to rad
jeffjennings Feb 24, 2023
df1ecdc
get_radial_profile: add 'geom' arg
jeffjennings Feb 24, 2023
eab4579
get_radial_profile: incorporate image deprojection
jeffjennings Feb 24, 2023
5c1f0e3
get_1d_vis_fit: update args, docstring
jeffjennings Feb 24, 2023
14c9239
get_1d_vis_fit: get model u, v, V
jeffjennings Feb 24, 2023
287e6c4
get_1d_vis_fit: deproject vis with frank
jeffjennings Feb 24, 2023
985fd9a
get_1d_vis_fit: get radial vis profile
jeffjennings Feb 24, 2023
6a47a0e
get_radial_profile: simplify
jeffjennings Feb 24, 2023
ed65449
get_radial_profile: simplify
jeffjennings Feb 28, 2023
8ed9563
get_1d_vis_fit debugged
jeffjennings Mar 13, 2023
aa7d9d9
flat_to_observer, observer_to_flat: opt_thick arg
jeffjennings Mar 13, 2023
35c7b93
mypy: add frank ignore
jeffjennings Mar 13, 2023
ef5633f
Merge branch 'main' into one_dim
jeffjennings Mar 13, 2023
beb3de1
revert opt_thick geometry arg
jeffjennings Mar 13, 2023
9fc9c26
typos
jeffjennings Mar 13, 2023
9661b9c
Merge branch 'main' into one_dim
jeffjennings Mar 22, 2023
d9f21a2
docstring spacing
jeffjennings Mar 22, 2023
c905d25
get_1d_vis_fit: intake vis and coords, not model
jeffjennings Mar 30, 2023
2ebd17e
get_1d_vis_profile: rename
jeffjennings Mar 30, 2023
349d9e7
get_1d_image_profile: rename
jeffjennings Mar 30, 2023
9405943
get_1d_image_profile: intake image and coords
jeffjennings Mar 30, 2023
7a36f25
get_1d_image_profile: add flux rescaling
jeffjennings Mar 30, 2023
090deaf
Merge branch 'main' into one_dim
jeffjennings Mar 30, 2023
4afe6d6
Merge branch 'main' into one_dim
jeffjennings Apr 4, 2023
ac01276
get_1d_vis_profile: explicit deproject
jeffjennings Jun 22, 2023
ad893f0
Merge branch 'one_dim' of https://github.com/MPoL-dev/MPoL into one_dim
jeffjennings Oct 17, 2023
883d4cc
Merge branch 'main' into one_dim
jeffjennings Oct 17, 2023
d6a2df3
Merge branch 'main' into one_dim
jeffjennings Oct 17, 2023
42aa022
Merge branch 'one_dim' of https://github.com/MPoL-dev/MPoL into one_dim
jeffjennings Oct 17, 2023
6a3a24f
blank space
jeffjennings Oct 17, 2023
6d06d9e
create 1d tests file
jeffjennings Oct 17, 2023
cf1c04d
rename 1d vis profile func
jeffjennings Oct 17, 2023
e3aedf9
radialV: force specify rescale_flux
jeffjennings Oct 17, 2023
0440d60
rename 1d brightness profile func
jeffjennings Oct 17, 2023
9e58207
radialI: force specify rescale_flux
jeffjennings Oct 17, 2023
446530e
radialI: simplify
jeffjennings Oct 17, 2023
1c5629c
remove reimplemented func
jeffjennings Oct 19, 2023
34c95b7
radialI: add TODO checks
jeffjennings Oct 19, 2023
f7efc90
start of onedim tests
jeffjennings Oct 19, 2023
8c7a9a0
radialI: remove 'rescale_flux'
jeffjennings Oct 27, 2023
25b4658
radialI: var disambiguation
jeffjennings Oct 27, 2023
d890a70
radialI: custom deprojection
jeffjennings Oct 27, 2023
843b0e2
radialI: more precise comments
jeffjennings Oct 27, 2023
2679a2f
radialI: sensible default bins
jeffjennings Oct 27, 2023
85e54a9
radialI: mask empty bins
jeffjennings Oct 27, 2023
c009f23
radialV: replicate radialI layout
jeffjennings Oct 27, 2023
10b7fb2
radialV: mask empty bins
jeffjennings Oct 27, 2023
6934dfa
radialI: more general bin guess
jeffjennings Oct 27, 2023
c768689
radialI: set bin guess
jeffjennings Oct 31, 2023
eacf2b6
Merge branch 'one_dim' of https://github.com/MPoL-dev/MPoL into one_dim
jeffjennings Oct 31, 2023
1b7fc03
Merge branch 'zenodo_relocate' of https://github.com/MPoL-dev/MPoL in…
jeffjennings Oct 31, 2023
5e4b192
add pytest fixtures for mock 1d dataset
jeffjennings Oct 31, 2023
9655277
add utility function to center a numpy image
jeffjennings Oct 31, 2023
062e2f1
add utility function to convert np to ImageCube
jeffjennings Oct 31, 2023
1b76a32
move np to ImageCube out of utils
jeffjennings Oct 31, 2023
efa6807
Move np to ImageCube into images.py
jeffjennings Oct 31, 2023
ec422f6
np__to_imagecube: add import
jeffjennings Oct 31, 2023
0ac11dc
Merge branch 'numpy_image_helper_funcs' of https://github.com/MPoL-de…
jeffjennings Nov 1, 2023
d99a025
add processing steps to mock_1d_image_models
jeffjennings Nov 1, 2023
343e377
mock 1d data: new filename
jeffjennings Nov 1, 2023
9ef73ef
simplify mock_1d_image_model fixture
jeffjennings Nov 1, 2023
bc21790
simplify onedim_test design
jeffjennings Nov 1, 2023
43f3311
implement test of radialI
jeffjennings Nov 1, 2023
eecfef4
add diag plot to test_radialI
jeffjennings Nov 1, 2023
c61f864
test_radialI: save diag fig
jeffjennings Nov 1, 2023
8f1a610
test_radialI: add plot ax labels
jeffjennings Nov 1, 2023
3cc2316
test_radialI: set bins
jeffjennings Nov 1, 2023
7380eca
radialV: less conservative step size
jeffjennings Nov 1, 2023
df6b2a6
mock_1d_image_model test fixture: clarify naming
jeffjennings Nov 1, 2023
704d770
add mock_1d_vis_model test fixture
jeffjennings Nov 1, 2023
346a598
remove unneeded func
jeffjennings Nov 1, 2023
647cee7
test_radialI: update test points
jeffjennings Nov 1, 2023
d83bf2a
test_radialV: add test assert
jeffjennings Nov 1, 2023
611fee0
test_radialV: add plot
jeffjennings Nov 1, 2023
80fd113
Merge branch 'zenodo_record_ref' of https://github.com/MPoL-dev/MPoL …
jeffjennings Nov 1, 2023
6a6894d
mock_1d_archive: update zenodo record ref
jeffjennings Nov 1, 2023
59ad2c7
test_radialI: consistent naming
jeffjennings Nov 1, 2023
f94c235
onedim_test: set geom
jeffjennings Nov 1, 2023
45e7b23
add frank as test dep
jeffjennings Nov 1, 2023
3a9f6b1
tests.yml: add frank to dep installs
jeffjennings Nov 1, 2023
35caea8
extra_requires: remove frank version restriction
jeffjennings Nov 1, 2023
c2c6d21
typo
jeffjennings Nov 1, 2023
afad0a9
test_radialI: clean up diag plot
jeffjennings Nov 2, 2023
55029c7
test_radialV: clean up diag plot
jeffjennings Nov 2, 2023
53da887
remove unneeded func
jeffjennings Nov 2, 2023
6885e61
Merge branch 'main' of https://github.com/MPoL-dev/MPoL into one_dim
jeffjennings Nov 2, 2023
ea9e970
conftest: recast 'geom' type
jeffjennings Nov 3, 2023
e4d0499
mock_1d_image_model: undo image centering
jeffjennings Nov 3, 2023
90f8fdc
mock_1d_image_model: place image in cube
jeffjennings Nov 3, 2023
bdd599d
mock_1d_image_model: update outputs
jeffjennings Nov 3, 2023
b50e98e
mock_1d_vis_model: create fourier cube
jeffjennings Nov 3, 2023
c313f10
mock_1d_vis_model: put vis in ground_cube
jeffjennings Nov 3, 2023
2209863
mock_1d_vis_model: update outputs
jeffjennings Nov 3, 2023
7bfb5c6
radialI: change input from array to icube
jeffjennings Nov 3, 2023
24b48cd
radialI: add chan arg
jeffjennings Nov 3, 2023
845bd28
radialI: update calls to icube
jeffjennings Nov 3, 2023
cf835cf
radialV: change input to fcube
jeffjennings Nov 3, 2023
943874e
radialV: add chan arg
jeffjennings Nov 3, 2023
052b4c8
radialV: use fcube
jeffjennings Nov 3, 2023
deeec2a
test_radialI: update data retrieval call
jeffjennings Nov 3, 2023
3493068
test_radialV: update data retrieval call
jeffjennings Nov 3, 2023
5bd168a
test_radialI: use icube
jeffjennings Nov 3, 2023
fb7bf32
test_radialV: use fcube
jeffjennings Nov 3, 2023
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
Prev Previous commit
Next Next commit
radialI: custom deprojection
jeffjennings committed Oct 27, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit d890a706b98dca78cb4fb692a285bb6b76782c96
19 changes: 6 additions & 13 deletions src/mpol/onedim.py
Original file line number Diff line number Diff line change
@@ -40,22 +40,15 @@ def radialI(image, coords, geom, bins=None):
# projected Cartesian pixel coordinates [arcsec]
xx, yy = coords.sky_x_centers_2D, coords.sky_y_centers_2D

# deproject and rotate image
xdep, ydep = observer_to_flat(xx, yy,
omega=geom["omega"] * np.pi / 180,
incl=geom["incl"] * np.pi / 180,
Omega=geom["Omega"] * np.pi / 180,
)

# shift image center to source center
xc, yc = xx - geom["dRA"], yy - geom["dDec"]

# TODO: this block temp
# cos_PA = np.cos(geom["Omega"] * np.pi / 180)
# sin_PA = np.sin(geom["Omega"] * np.pi / 180)
# xdep = xshift * cos_PA - yshift * sin_PA
# ydep = xshift * sin_PA + yshift * cos_PA
# xdep /= (geom["incl"] * np.pi / 180)
# deproject image
cos_PA = np.cos(geom["Omega"] * np.pi / 180)
sin_PA = np.sin(geom["Omega"] * np.pi / 180)
xd = xc * cos_PA - yc * sin_PA
yd = xc * sin_PA + yc * cos_PA
xd /= np.cos(geom["incl"] * np.pi / 180)

# radial pixel coordinates
rr = np.ravel(np.hypot(xc, yc))