Description
Use whole day and originDay coordinates and a positive whole daysPerWeek.
Epidemiological timing depends on which event defines the origin, how intervals include their boundaries and whether time is observed. Numeric day coordinates and elapsed intervals do not by themselves select a calendar or a transmission model.
Use whole day and originDay coordinates and a positive whole daysPerWeek.
When to use this tool
Use Epidemic Week Explicit Origin Offset when reconciling supplied day coordinates, observation windows or interval boundaries.
How to use the tool and how it works
- Enter day, originDay, daysPerWeek. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read weekIndex, dayWithinWeek. Use the output convention below.
Use whole day and originDay coordinates and a positive whole daysPerWeek. Compute elapsed = day-originDay with exact integer arithmetic, then floor-divide by daysPerWeek. Return weekIndex and a nonnegative dayWithinWeek less than daysPerWeek, including for days before the origin.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| day | Day | Required. Safe integer. |
| originDay | Origin Day | Required. Safe integer. |
| daysPerWeek | Days Per Week | Required. Safe integer; minimum 1. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| weekIndex | Floor of elapsed whole days divided by daysPerWeek; zero is the origin week. | Required. Safe integer. |
| dayWithinWeek | Nonnegative remainder, always less than daysPerWeek. | Required. Safe integer. |
{
"input": {
"day": 110,
"originDay": 100,
"daysPerWeek": 7
},
"output": {
"weekIndex": 1,
"dayWithinWeek": 3
}
} Limitations and assumptions
- This is an explicit-origin numeric partition, not ISO, MMWR or another calendar epidemiological-week assignment. Output integer bounds still apply even when exact intermediate differences are larger.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Use an explicit calendar conversion for real dates and a suitable transmission or censoring model for inference beyond these local time calculations.
References
Similar or alternative tools
- Outbreak Case Onset Day Index
Return dayIndex = onsetDay - originDay, adding one when dayOne is true.
- Surveillance Week Origin Gap Tool
Calculate surveillance week origin gap from explicit caller-supplied inputs.