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

Write measurement sets #12

Merged
merged 17 commits into from
Apr 10, 2022
Merged

Write measurement sets #12

merged 17 commits into from
Apr 10, 2022

Conversation

d3v-null
Copy link
Collaborator

@d3v-null d3v-null commented Apr 5, 2022

  • fix an issue when writing calibration solutions with multiple timeblocks by shortening fits key names ( 16d004a )
  • Move vis weighting outside calibration to optimize calibration performance ( 5781f9a )
  • remove autocorrelation plumbing for di cal
  • implement measurement set writing for calibrated and simulated vis
  • improve precision of uvfits reading
  • fix logic around input and output averaging factors stacking

open questions:

  • write to different columns in measurement set?

When calibrating with multiple timeblocks, the start, end and average
times of the timeblocks are written to the hyperdrive-formatted
calibration solutions. However, they weren't written correctly. Using
shorter key names for these times (e.g. "START_TIMESTAMPS" -> "S_TIMES")
appears to fix the issue. I don't fully understand why this works; maybe
there's probably a bad interaction in cfitsio between long key names and
long strings.

In addition, the way that solutions were propagated across timeblocks
was incorrect; this is now fixed.
Multiply visibilities by weights before calibration and divide by
weights if writing visibilities out. This means weights are needed
during calibration and the code is able to run about 25% faster.

Note that there are relatively big (up to 1e-4) float-point errors
introduced by doing this; writing visibilities out of di-calibration
should therefore only be done as a "quick and dirty" convenience. When
solutions-apply is introduced, that will be the preferred way to obtain
calibrated visibilities.
@codecov
Copy link

codecov bot commented Apr 5, 2022

Codecov Report

Merging #12 (d5690df) into main (8e97a8b) will increase coverage by 0.78%.
The diff coverage is 92.72%.

@@            Coverage Diff             @@
##             main      #12      +/-   ##
==========================================
+ Coverage   79.52%   80.31%   +0.78%     
==========================================
  Files          90       93       +3     
  Lines       16685    17150     +465     
==========================================
+ Hits        13269    13774     +505     
+ Misses       3416     3376      -40     
Impacted Files Coverage Δ
src/calibrate/args.rs 13.20% <ø> (+0.09%) ⬆️
src/calibrate/error.rs 0.00% <ø> (ø)
src/data_formats/mod.rs 50.00% <ø> (ø)
src/simulate_vis/error.rs 0.00% <ø> (ø)
src/calibrate/params/mod.rs 74.60% <37.50%> (-0.86%) ⬇️
src/calibrate/solutions/hyperdrive.rs 95.12% <88.00%> (+0.25%) ⬆️
src/simulate_vis/mod.rs 81.14% <90.90%> (+0.76%) ⬆️
src/calibrate/di/mod.rs 95.03% <95.86%> (+1.95%) ⬆️
src/calibrate/di/code/mod.rs 78.71% <97.33%> (+1.53%) ⬆️
src/calibrate/di/code/tests.rs 96.25% <100.00%> (-0.03%) ⬇️
... and 18 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8e97a8b...d5690df. Read the comment docs.

cjordan and others added 6 commits April 6, 2022 16:10
Autocorrelations will only be calibrated and written out as part of a
to-be-written solutions-apply command.

Fix one test passing --cpu to SimulateVisArgs when it was not expected.
The parse_{time,freq}_average_factor functions expect {time,freq}
resolutions, but they weren't getting them, and things weren't working
as expected. This commit fixes that and an associated test.
Dev McElhinney added 6 commits April 7, 2022 16:06
round jd_frac before it gets added to PZERO5
add round_hundredths_of_a_second_duration
-> implement time averaging on calibrate-vis output when the
selected timesteps are non-contiguous.
@d3v-null d3v-null force-pushed the ms_write branch 2 times, most recently from a652b7b to e873302 Compare April 8, 2022 03:48
@d3v-null d3v-null marked this pull request as ready for review April 8, 2022 05:16
Dev McElhinney and others added 2 commits April 8, 2022 16:24
di-calibrate cannot currently write its sky model to an ms -- the help
text has been updated to account for this and a test now exists to check
that the help text is correct.

There were problems around files and directories being overwritten. I've
done the best I can but it looks like we can't ever handle detecting
whether we have permission to remove a directory ahead of time. We may
want to improve an error message associated with attempting to remove a
directory we don't have permission to, if it's not already clear enough.

A message stating where calibrated visibilities have been written to was
lost; this is now back.
@cjordan cjordan merged commit d5690df into main Apr 10, 2022
@cjordan cjordan deleted the ms_write branch June 10, 2022 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants