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

Calibration misc #325

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Calibration misc #325

wants to merge 7 commits into from

Conversation

nicholebarry
Copy link
Contributor

These are miscellaneous calibration changes:

  1. Store the used bandpass in the cal structure. This is important if you want to reconstruct each step of calibration after a run has finished. Purely for metadata/storing/tracking purposes.
  2. Remove NANs from the yrange calculation of calibration plots for better viewing. This is something that rarely happens, but if you are playing around with some simulations and doing some hand-flagging, it's possible.
  3. Model transfer framework that can handle WODEN inputs. Some time/baseline matching needs to occur because WODEN makes the full-model without flagging. This is kept very generalized to work with previous versions of WODEN that had a JD offset (noon versus midnight).

All changes have been confirmed to work in PS.

Copy link
Member

@bhazelton bhazelton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks very sensible, I just have a couple questions about the time matching.

Comment on lines 57 to 58
if total(matched_times_opt1 < 1) GT total(matched_times_opt2 < 1) then matched_times = matched_times_opt1
if total(matched_times_opt1 < 1) LT total(matched_times_opt2 < 1) then matched_times = matched_times_opt2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if neither are very good? should we error or warn if the best one is still way off?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've included two errors to be explicit, one if no times matched and one if the times matched do not equal the number of timesteps in the data.

Comment on lines 75 to 83
; In each matched timestep, match the baselines and fill a new, matched model array
for time_i=0, data_n_time-1 do begin
;suba is the subset of indices in the first array that are also in the second.
;subb is the subset of indices in the second array that are also in the first.
match, data_baseline_index[time_i*data_nbaselines:(time_i+1)*data_nbaselines-1], $
model_baseline_index[matched_times[time_i]*model_nbaselines:(matched_times[time_i]+1)*model_nbaselines-1], $
suba, subb
for pol_i=0, obs.n_pol-1 do (*matched_model[pol_i])[*,suba+time_i*(data_nbaselines)] = (*vis_model_arr[pol_i])[*,subb+matched_times[time_i]*model_nbaselines]
endfor
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, so this takes care of the ones that don't match? what exactly happens if there are times that don't match?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added an extra comment to be a little more clear.

Any unmatched transferred model times are discarded. The idea here is that you have a full model for all times, and you are matching it to imperfect, flagged data.

You may have noticed that I did not force timestep matching if the number of times is the same between the data and the model. I want to keep it somewhat flexible in case people are working with simulations. Ideally everyone fills in the metadata for simulations, but I'm not going to force them.

@nicholebarry
Copy link
Contributor Author

Added an extra option for the newer version of WODEN (which includes a better JDate convention after realizing there was such a huge difference).

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