Skip to content

New ctime-based bundling#13

Merged
earosenberg merged 3 commits intoer/bundler_updates_260112from
er/bundler_updates_260218
Mar 11, 2026
Merged

New ctime-based bundling#13
earosenberg merged 3 commits intoer/bundler_updates_260112from
er/bundler_updates_260218

Conversation

@earosenberg
Copy link
Copy Markdown
Contributor

Implements bundling based on ctime.
There are two new config arguments: bundle_duration and bundle_t0
Setting bundling_duration: 'obs' will recover the old behaviour of bundling by obs.

Otherwise the new behaviour will make bins of ctime starting at bundle_t0 and of length bundle_duration. These bins are each assigned a bundle id randomly, and all obs in that ctime bin are assigned the same bundle id.

The ctime bundling will be the same for equal values of bundle_duration, bundle_t0, and seed. This means that different bundling dbs made independently with the same values of these parameters will share the same bundling scheme (eg satp1, satp3).

The new scheme no longer guarantees equal numbers of obs per bundle. If this is needed (eg for small numbers of obs) than the old bundling_duration: obs behaviour can be used.

Copy link
Copy Markdown
Collaborator

@kwolz kwolz left a comment

Choose a reason for hiding this comment

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

Just two small comments, otherwise this looks good!

atomic_db: str = ""
seed: int = 0
bundle_duration: int = 86400
bundle_t0: int = 1704121200
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What does this starting time correspond to? Would it need to be changed depending on the telescope, ctime split etc, or is it just supposed to be prior to the earliest SAT observation day?

If the answer to this is nontrivial, I'd suggest at least including a version of it in the docstring.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is just supposed to be prior to the earliest day yes

if np.min(ctimes) < t0:
raise ValueError(f"Min ctime {np.min(ctimes)} < min allowed time {t0}")
tbins = np.arange(t0, TEND, period)
index = np.digitize(ctimes, tbins) # Index of right bin edge. Bins are left-edge-inclusive.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Alright, this answers partly my above question. Is there a reason why t0 is a free parameter (and isn't simply set to, e.g. 1 Jan 2020 in this function)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The reason for this is that t0 sets the "phase" of the bundling. So for now I have set it at Chilean noon in the example config file, with a daily period. Since it is preferred to have the split between bundles be during a gap in observations to minimize overlap due to neighbouring obs, it could be advantageous to set a particular phase (noon is a guess on my part but it should be easy to check if there is a particularly good time)

@earosenberg earosenberg reopened this Mar 11, 2026
@earosenberg earosenberg merged commit a8b6ad4 into er/bundler_updates_260112 Mar 11, 2026
@earosenberg earosenberg deleted the er/bundler_updates_260218 branch March 11, 2026 11:06
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