Day |
Exception | Condition |
---|---|
ArgumentOutOfRangeException | minimumDayRange extends earlier or later than DayRange. |
A DayRangePeriod created through the constructor does not have a minimum range. Without a minimum range, the API can decide what to do if there is not enough data available to satisfy the DayRange, and it will typically return what it can from within DayRange. If this method is used to specify a minimum range, then a request for data will fail unless that minimum range can be satisfied.
The following example shows typical usage of this method:
Warning: be careful with minimum ranges, particularly when defining the last day of a minimum range. The degree days for any given day will never become available until the day has finished in the location's local time-zone, and it usually takes at least a few hours more for the required temperature data to filter through the system. For stations that don't record temperatures in the early morning (this explains the high "% estimated" figures of some minor airport stations), it can consistently take 10 or so hours for the previous day's data to become available, as our system needs a usable temperature reading from today before it will calculate the degree days from yesterday. Occasionally there can also be problems that can delay the appearance of fresh data further for certain stations, and delays of up to 10 or so days are possible, albeit rare. If your system specifies a minimum range that is too restrictive, it can easily end up with no data at all when in fact there's plenty of usable data available.
That said, there are times when a minimum range with highly-restrictive dates is exactly what you want (and you'd rather get nothing than slightly less data), so don't be afraid to specify restrictive minimum ranges if you need them.