Skip to content

SPR1-660: Fix sources setting during delaycal observations#484

Open
spassmoor wants to merge 1 commit intomasterfrom
spassmoor-Fix_delaycal
Open

SPR1-660: Fix sources setting during delaycal observations#484
spassmoor wants to merge 1 commit intomasterfrom
spassmoor-Fix_delaycal

Conversation

@spassmoor
Copy link
Contributor

In calibrate_delays.py there is a rare occurrence where the source that is above the horizon at the start of the Observation then sets during the observation causing a failed observation

In  calibrate_delays.py there is a rare occurrence  where the source that is above the horizon at the start of the Observation then sets during the observation causing a failed observation
@spassmoor
Copy link
Contributor Author

@ludwigschwardt can check that I have done this correctly . That I have not messed up units etc.

Copy link
Contributor

@ludwigschwardt ludwigschwardt left a comment

Choose a reason for hiding this comment

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

Have you checked that the three calibs won't leave a gap somewhere with horizon = 25? My OPT doesn't want to work at the moment... (all proposals are greyed out so I can't quickly check an old one).

raise ValueError('Not enough receptors to do calibration - you '
'need 4 and you have %d' % (len(session.ants),))
sources_above_horizon = observation_sources.filter(el_limit_deg=opts.horizon)
sources_above_horizon = observation_sources.filter(el_limit_deg=opts.horizon+5)
Copy link
Contributor

@ludwigschwardt ludwigschwardt Feb 20, 2026

Choose a reason for hiding this comment

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

I would add some documentation here, e.g.

Suggested change
sources_above_horizon = observation_sources.filter(el_limit_deg=opts.horizon+5)
# Lift horizon to avoid source setting while waiting for gains or during verification
sources_above_horizon = observation_sources.filter(el_limit_deg=opts.horizon+5)

That 5º buys you 20 minutes or so extra.

help='Maximum length of time to wait for delays (K-cross diode), '
'solutions to be computed by pipeline (default=%default)')
# Set default value for any option (both standard and experiment-specific options)
parser.set_defaults(observer='comm_test', nd_params='off', project_id='COMMTEST',
Copy link
Contributor

Choose a reason for hiding this comment

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

You could also implement it directly as a horizon override in set_defaults (e.g. horizon=25 instead of the usual 20).

@ludwigschwardt
Copy link
Contributor

ludwigschwardt commented Feb 20, 2026

Mmm, it looks like there will be a gap between LST 10:30 and 12:00... The problem of lifting the horizon is that it affects both rising and setting sources, and you really only want to fix setting sources.

Screenshot 2026-02-20 at 12 08 40

Maybe it's better to do an explicit session.target_visible call, or better yet, an observation_sources.filter with the current timestamp, followed by another filter with a timestamp sufficiently in the future (i.e. opts.track_duration + opts.verify_duration + opts.timeout + a bit extra).

You can stack those filters, e.g.

sources_above_horizon_now = observation_sources.filter(el_limit_deg=opts.horizon)
sources_above_horizon = sources_above_horizon_now.filter(
    el_limit_deg=opts.horizon, timestamp=katpoint.Timestamp() + total_duration,
)

@ludwigschwardt
Copy link
Contributor

ludwigschwardt commented Feb 20, 2026

Another request: please start your commit messages and branch names with SPR1-660, which will link this to the relevant Jira ticket.

And finally: we should repeat this fix for phaseup too.

@ludwigschwardt ludwigschwardt changed the title Fix Sources setting during observation SPR1-660: Fix sources setting during delaycal observations Feb 20, 2026
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