New ctime-based bundling#13
Conversation
kwolz
left a comment
There was a problem hiding this comment.
Just two small comments, otherwise this looks good!
| atomic_db: str = "" | ||
| seed: int = 0 | ||
| bundle_duration: int = 86400 | ||
| bundle_t0: int = 1704121200 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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)?
There was a problem hiding this comment.
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)
Implements bundling based on ctime.
There are two new config arguments:
bundle_durationandbundle_t0Setting bundling_duration: 'obs' will recover the old behaviour of bundling by obs.
Otherwise the new behaviour will make bins of ctime starting at
bundle_t0and of lengthbundle_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, andseed. 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: obsbehaviour can be used.