HERA-Team / hera_sim

Simple simulation code for HERA-like redundant interferometric arrays
Other
16 stars 8 forks source link

Made notebooks run with current hera_sim #238

Closed hughbg closed 3 weeks ago

hughbg commented 2 years ago

Updated notebooks. They run, but may not make use of all the new features properly, so that needs to be examined.

review-notebook-app[bot] commented 2 years ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

codecov[bot] commented 2 years ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 93.34%. Comparing base (4ed6ae8) to head (b950bff). Report is 19 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #238 +/- ## ======================================= Coverage 93.34% 93.34% ======================================= Files 25 25 Lines 3428 3428 Branches 737 737 ======================================= Hits 3200 3200 Misses 122 122 Partials 106 106 ``` | [Flag](https://app.codecov.io/gh/HERA-Team/hera_sim/pull/238/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HERA-Team) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/HERA-Team/hera_sim/pull/238/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HERA-Team) | `93.31% <100.00%> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HERA-Team#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

steven-murray commented 2 years ago

Thanks @hughbg. I can't seem to make comments directly on the notebooks in reviewnb for some reason, so I will just leave comments here:

hera_sim_defaults

hera_sim_simulator

hera_sim_tour

polybeam_simulation

visibility_simulator

r-pascua commented 2 years ago

Thanks for the updates @hughbg. I'm a little confused about some of the things that I'm seeing. According to some of the output from the Simulator tutorial notebook, it looks like your version is up-to-date, so I think the parts that are confusing me are likely the result of running cells out of order. When you get a chance, could you re-run the notebooks with freshly started kernels and push the results?

I'm just going to add some comments in response to the things @steven-murray raised in his review, as well as maybe a few of my own (or some suggestions), with the hope that the input is useful.

hera_sim_defaults

hera_sim_simulator

hera_sim_tour

As for the other notebooks, I don't have any comments beyond what @steven-murray has pointed out. Thanks again for your work @hughbg! Hopefully it'll only be a few iterations for us to get everything wrangled.

hughbg commented 2 years ago

I've uploaded a new version of hera_sim_defaults. Rerunning the cells in order fixed some issues. I switched the beam and bandpass code to

freqs = np.linspace(0.1, 0.2, 100)
hera_sim.defaults.set('h1c')
h1c_omega_p = hera_sim.defaults('omega_p')(freqs)
h1c_bandpass = hera_sim.defaults('bp_poly')(freqs)
hera_sim.defaults.set('h2c')
h2c_omega_p = hera_sim.defaults('omega_p')(freqs)
h2c_bandpass = hera_sim.defaults('bp_poly')(freqs)

The old code was returning model values whereas this code is returning values interpolated from the models. That is in accord with the y-label axes which have always referred to beam and bandpass values (area and gains) rather than models. The plots are quite different now.

steven-murray commented 1 month ago

@r-pascua and @hughbg, I have finally gotten back to this PR.

I did the following:

review-notebook-app[bot] commented 1 month ago

View / edit / reply to this conversation on ReviewNB

r-pascua commented on 2024-08-27T22:44:23Z ----------------------------------------------------------------

Line #7.        ax1.set_xlabel(None)

I think a better way to do this is to replace this line and line 8 with ax1.xaxis.set_visible(False)


review-notebook-app[bot] commented 1 month ago

View / edit / reply to this conversation on ReviewNB

r-pascua commented on 2024-08-27T22:44:23Z ----------------------------------------------------------------

Is the change to np.int64(ant) a ruff formatting thing?


steven-murray commented on 2024-09-09T12:54:56Z ----------------------------------------------------------------

no, it's a numpy 2 thing.