Dated |
The DatedDataSpec type exposes the following members.
Name | Description | |
---|---|---|
DatedDataSpec | Constructs a DatedDataSpec object with the specified Calculation and DatedBreakdown. |
Name | Description | |
---|---|---|
Breakdown | Gets the non-null DatedBreakdown object that defines the way in which the degree days should be broken down and the period in time that they should cover. | |
Calculation | Gets the non-null Calculation object that defines the way in which the degree days should be calculated in terms of their base temperature and whether they should be heating degree days or cooling degree days. |
Name | Description | |
---|---|---|
Equals |
Two DataSpec objects are equal if they have the same class
and the same configuration.
(Inherited from DataSpec) | |
GetHashCode |
Overridden to ensure consistency with Equals.
(Inherited from DataSpec) | |
ToString |
Returns a non-null, non-empty string representation of this instance for logging and debugging purposes.
(Overrides ObjectToString) |
A DatedDataSpec specifies a set of degree days in terms of:
Here's how you could specify monthly heating degree days with a base temperature of 15.5°C covering the whole of 2019:
DatedDataSpec datedDataSpec = DataSpec.Dated( Calculation.HeatingDegreeDays(Temperature.Celsius(15.5)), DatedBreakdown.Monthly(Period.DayRange( new Day(2019, 1, 1).To(2019, 12, 31))));
You could then send that DatedDataSpec to the API as part of a LocationDataRequest, and get a response containing an DatedDataSet back:
DegreeDaysApi api = new DegreeDaysApi(new AccountKey(yourStringAccountKey), new SecurityKey(yourStringSecurityKey)); LocationDataRequest request = new LocationDataRequest( Location.StationId("KHYA"), new DataSpecs(datedDataSpec)); LocationDataResponse response = api.DataApi.GetLocationData(request); DatedDataSet datedData = response.DataSets.GetDated(datedDataSpec); foreach (DatedDataValue v in datedData.Values) { Console.WriteLine(v.DayRange + ": " + v.Value); }
To request multiple sets of dated data with different calculation processes (e.g. multiple different base temperatures) and/or different breakdowns, simply put multiple DatedDataSpec objects into the DataSpecs object that you pass into your LocationDataRequest.