Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/Solcast/Clients/ForecastClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,9 @@ public async Task<ApiResponse<ForecastsDataResponse>> GetForecastRadiationAndWea
/// <param name="hours">The number of hours to return in the response. Default is 24.</param>
/// <param name="period">Length of the averaging period in ISO 8601 format. Default is PT30M.</param>
/// <param name="depoVelocPm10">Deposition or settling velocity of PM2.5 particulates. [m/s]. Default is 0.0009.</param>
/// <param name="depoVelocPm2_5">Deposition or settling velocity of PM10 particulates. [m/s]. Default is 0.004.</param>
/// <param name="depoVelocPm25">Deposition or settling velocity of PM10 particulates. [m/s]. Default is 0.004.</param>
/// <param name="pm10">Restricted. A list of PM10 values. Concentration of airborne particulate matter (PM) with aerodynamicdiameter less than 10 microns. [g/m^3]. HSU endpoint will internally use Solcast's PM2.5 values tailored to your request time period.</param>
/// <param name="pm2_5">Restricted. Concentration of airborne particulate matter (PM) with aerodynamic diameter less than 2.5 microns. [g/m^3]. HSU endpoint will internally use Solcast's PM2.5 values tailored to your request time period.</param>
/// <param name="pm25">Restricted. Concentration of airborne particulate matter (PM) with aerodynamic diameter less than 2.5 microns. [g/m^3]. HSU endpoint will internally use Solcast's PM2.5 values tailored to your request time period.</param>
/// <param name="tilt">The angle (degrees) that the PV system is tilted off the horizontal. A tilt of 0 means the system faces directly upwards, and 90 means the system is vertical and facing the horizon. If you don't specify tilt, we use a default tilt angle based on the latitude you specify in your request. Must be between 0 and 90.</param>
/// <param name="cleaningThreshold">Amount of daily rainfall required to clean the panels (mm). Default is 6.0.</param>
/// <param name="initialSoiling">Initial percentage of energy lost due to soiling at time zero in the rainfall series input. If not provided, Solcast will perform a ramp up series calculation to accurately determine this value. If provided must be >= 0 and < 0.3437.</param>
Expand All @@ -398,9 +398,9 @@ public async Task<ApiResponse<ForecastsDataResponse>> GetForecastHsu(
int? hours = null,
string period = null,
double? depoVelocPm10 = null,
double? depoVelocPm2_5 = null,
double? depoVelocPm25 = null,
List<double?> pm10 = null,
List<double?> pm2_5 = null,
List<double?> pm25 = null,
double? tilt = null,
double? cleaningThreshold = null,
double? initialSoiling = null,
Expand All @@ -419,14 +419,14 @@ public async Task<ApiResponse<ForecastsDataResponse>> GetForecastHsu(
if (hours.HasValue) parameters.Add("hours", hours.Value.ToString());
if (period != null) parameters.Add("period", period.ToString());
if (depoVelocPm10.HasValue) parameters.Add("depoVelocPm10", depoVelocPm10.Value.ToString());
if (depoVelocPm2_5.HasValue) parameters.Add("depoVelocPm2_5", depoVelocPm2_5.Value.ToString());
if (pm10 != null && pm10.Any()) parameters.Add("pm10", string.Join(",", pm10));
if (pm2_5 != null && pm2_5.Any()) parameters.Add("pm2_5", string.Join(",", pm2_5));
if (depoVelocPm25.HasValue) parameters.Add("depoVelocPm25", depoVelocPm25.Value.ToString());
if (pm10 != null) parameters.Add("pm10", pm10.ToString());
if (pm25 != null) parameters.Add("pm25", pm25.ToString());
if (tilt.HasValue) parameters.Add("tilt", tilt.Value.ToString());
if (cleaningThreshold.HasValue) parameters.Add("cleaningThreshold", cleaningThreshold.Value.ToString());
if (initialSoiling.HasValue) parameters.Add("initialSoiling", initialSoiling.Value.ToString());
if (rainAccumPeriod.HasValue) parameters.Add("rainAccumPeriod", rainAccumPeriod.Value.ToString());
if (rainfall != null && rainfall.Any()) parameters.Add("rainfall", string.Join(",", rainfall));
if (rainfall != null) parameters.Add("rainfall", rainfall.ToString());
if (manualWashDates != null && manualWashDates.Any()) parameters.Add("manualWashDates", string.Join(",", manualWashDates));
if (format != null) parameters.Add("format", format.ToString());

Expand Down Expand Up @@ -462,7 +462,7 @@ public async Task<ApiResponse<ForecastsDataResponse>> GetForecastHsu(
}
catch (HttpRequestException httpEx)
{
var paramDetails = "latitude=" + latitude + ", " + "longitude=" + longitude + ", " + "timeZone=" + timeZone + ", " + "hours=" + hours + ", " + "period=" + period + ", " + "depoVelocPm10=" + depoVelocPm10 + ", " + "depoVelocPm2_5=" + depoVelocPm2_5 + ", " + "pm10=" + pm10 + ", " + "pm2_5=" + pm2_5 + ", " + "tilt=" + tilt + ", " + "cleaningThreshold=" + cleaningThreshold + ", " + "initialSoiling=" + initialSoiling + ", " + "rainAccumPeriod=" + rainAccumPeriod + ", " + "rainfall=" + rainfall + ", " + "manualWashDates=" + manualWashDates + ", " + "format=" + format;
var paramDetails = "latitude=" + latitude + ", " + "longitude=" + longitude + ", " + "timeZone=" + timeZone + ", " + "hours=" + hours + ", " + "period=" + period + ", " + "depoVelocPm10=" + depoVelocPm10 + ", " + "depoVelocPm25=" + depoVelocPm25 + ", " + "pm10=" + pm10 + ", " + "pm25=" + pm25 + ", " + "tilt=" + tilt + ", " + "cleaningThreshold=" + cleaningThreshold + ", " + "initialSoiling=" + initialSoiling + ", " + "rainAccumPeriod=" + rainAccumPeriod + ", " + "rainfall=" + rainfall + ", " + "manualWashDates=" + manualWashDates + ", " + "format=" + format;
var status = httpEx.StatusCode.HasValue ? ((int)httpEx.StatusCode).ToString() : "unknown";
var content = httpEx.Data.Contains("Content") ? httpEx.Data["Content"] : "no content";
throw new Exception($@"HTTP error in GetForecastHsu
Expand All @@ -473,7 +473,7 @@ public async Task<ApiResponse<ForecastsDataResponse>> GetForecastHsu(
}
catch (Exception ex)
{
var paramDetails = "latitude=" + latitude + ", " + "longitude=" + longitude + ", " + "timeZone=" + timeZone + ", " + "hours=" + hours + ", " + "period=" + period + ", " + "depoVelocPm10=" + depoVelocPm10 + ", " + "depoVelocPm2_5=" + depoVelocPm2_5 + ", " + "pm10=" + pm10 + ", " + "pm2_5=" + pm2_5 + ", " + "tilt=" + tilt + ", " + "cleaningThreshold=" + cleaningThreshold + ", " + "initialSoiling=" + initialSoiling + ", " + "rainAccumPeriod=" + rainAccumPeriod + ", " + "rainfall=" + rainfall + ", " + "manualWashDates=" + manualWashDates + ", " + "format=" + format;
var paramDetails = "latitude=" + latitude + ", " + "longitude=" + longitude + ", " + "timeZone=" + timeZone + ", " + "hours=" + hours + ", " + "period=" + period + ", " + "depoVelocPm10=" + depoVelocPm10 + ", " + "depoVelocPm25=" + depoVelocPm25 + ", " + "pm10=" + pm10 + ", " + "pm25=" + pm25 + ", " + "tilt=" + tilt + ", " + "cleaningThreshold=" + cleaningThreshold + ", " + "initialSoiling=" + initialSoiling + ", " + "rainAccumPeriod=" + rainAccumPeriod + ", " + "rainfall=" + rainfall + ", " + "manualWashDates=" + manualWashDates + ", " + "format=" + format;
throw new Exception($@"Unhandled error in GetForecastHsu
Parameters: {paramDetails}
Error: {ex.Message}", ex);
Expand Down
20 changes: 10 additions & 10 deletions src/Solcast/Clients/HistoricClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,9 @@ public async Task<ApiResponse<HistoricPvPowerResponse>> GetHistoricRooftopPvPowe
/// <param name="timeZone">Timezone to return in data set. Accepted values are utc, longitudinal, or a range from -13 to 13 in 0.25 hour increments for utc offset. Default is utc.</param>
/// <param name="period">Length of the averaging period in ISO 8601 format. Default is PT30M.</param>
/// <param name="depoVelocPm10">Deposition or settling velocity of PM2.5 particulates. [m/s]. Default is 0.0009.</param>
/// <param name="depoVelocPm2_5">Deposition or settling velocity of PM10 particulates. [m/s]. Default is 0.004.</param>
/// <param name="depoVelocPm2.5">Deposition or settling velocity of PM10 particulates. [m/s]. Default is 0.004.</param>
/// <param name="pm10">Restricted. A list of PM10 values. Concentration of airborne particulate matter (PM) with aerodynamicdiameter less than 10 microns. [g/m^3]. HSU endpoint will internally use Solcast's PM2.5 values tailored to your request time period.</param>
/// <param name="pm2_5">Restricted. Concentration of airborne particulate matter (PM) with aerodynamic diameter less than 2.5 microns. [g/m^3]. HSU endpoint will internally use Solcast's PM2.5 values tailored to your request time period.</param>
/// <param name="pm2.5">Restricted. Concentration of airborne particulate matter (PM) with aerodynamic diameter less than 2.5 microns. [g/m^3]. HSU endpoint will internally use Solcast's PM2.5 values tailored to your request time period.</param>
/// <param name="tilt">The angle (degrees) that the PV system is tilted off the horizontal. A tilt of 0 means the system faces directly upwards, and 90 means the system is vertical and facing the horizon. If you don't specify tilt, we use a default tilt angle based on the latitude you specify in your request. Must be between 0 and 90.</param>
/// <param name="start">ISO_8601 compliant starting datetime for the historical data. If the supplied value does not specify a timezone, the timezone will be inferred from the time_zone parameter, if supplied. Otherwise UTC is assumed.</param>
/// <param name="duration">Must include one of end_date and duration. ISO_8601 compliant duration for the historical data. Must be within 31 days of the start_date.</param>
Expand All @@ -354,9 +354,9 @@ public async Task<ApiResponse<EstimatedActualsDataResponse>> GetHistoricHsu(
string timeZone = null,
string period = null,
double? depoVelocPm10 = null,
double? depoVelocPm2_5 = null,
double? depoVelocPm2.5 = null,
List<double?> pm10 = null,
List<double?> pm2_5 = null,
List<double?> pm2.5 = null,
double? tilt = null,
string duration = null,
string end = null,
Expand All @@ -377,17 +377,17 @@ public async Task<ApiResponse<EstimatedActualsDataResponse>> GetHistoricHsu(
if (timeZone != null) parameters.Add("timeZone", timeZone.ToString());
if (period != null) parameters.Add("period", period.ToString());
if (depoVelocPm10.HasValue) parameters.Add("depoVelocPm10", depoVelocPm10.Value.ToString());
if (depoVelocPm2_5.HasValue) parameters.Add("depoVelocPm2.5", depoVelocPm2_5.Value.ToString());
if (pm10 != null && pm10.Any()) parameters.Add("pm10", string.Join(",", pm10));
if (pm2_5 != null && pm2_5.Any()) parameters.Add("pm2.5", string.Join(",", pm2_5));
if (depoVelocPm2.5.HasValue) parameters.Add("depoVelocPm2.5", depoVelocPm2.5.Value.ToString());
if (pm10 != null) parameters.Add("pm10", pm10.ToString());
if (pm2.5 != null) parameters.Add("pm2.5", pm2.5.ToString());
if (tilt.HasValue) parameters.Add("tilt", tilt.Value.ToString());
if (duration != null) parameters.Add("duration", duration.ToString());
if (end != null) parameters.Add("end", end.ToString());
if (cleaningThreshold.HasValue) parameters.Add("cleaningThreshold", cleaningThreshold.Value.ToString());
if (initialSoiling.HasValue) parameters.Add("initialSoiling", initialSoiling.Value.ToString());
if (manualWashDates != null && manualWashDates.Any()) parameters.Add("manualWashDates", string.Join(",", manualWashDates));
if (rainAccumPeriod.HasValue) parameters.Add("rainAccumPeriod", rainAccumPeriod.Value.ToString());
if (rainfall != null && rainfall.Any()) parameters.Add("rainfall", string.Join(",", rainfall));
if (rainfall != null) parameters.Add("rainfall", rainfall.ToString());
if (format != null) parameters.Add("format", format.ToString());

var queryString = string.Join("&", parameters.Select(p => $"{p.Key}={Uri.EscapeDataString(p.Value ?? string.Empty)}"));
Expand Down Expand Up @@ -422,7 +422,7 @@ public async Task<ApiResponse<EstimatedActualsDataResponse>> GetHistoricHsu(
}
catch (HttpRequestException httpEx)
{
var paramDetails = "latitude=" + latitude + ", " + "longitude=" + longitude + ", " + "start=" + start + ", " + "timeZone=" + timeZone + ", " + "period=" + period + ", " + "depoVelocPm10=" + depoVelocPm10 + ", " + "depoVelocPm2_5=" + depoVelocPm2_5 + ", " + "pm10=" + pm10 + ", " + "pm2_5=" + pm2_5 + ", " + "tilt=" + tilt + ", " + "duration=" + duration + ", " + "end=" + end + ", " + "cleaningThreshold=" + cleaningThreshold + ", " + "initialSoiling=" + initialSoiling + ", " + "manualWashDates=" + manualWashDates + ", " + "rainAccumPeriod=" + rainAccumPeriod + ", " + "rainfall=" + rainfall + ", " + "format=" + format;
var paramDetails = "latitude=" + latitude + ", " + "longitude=" + longitude + ", " + "start=" + start + ", " + "timeZone=" + timeZone + ", " + "period=" + period + ", " + "depoVelocPm10=" + depoVelocPm10 + ", " + "depoVelocPm2.5=" + depoVelocPm2.5 + ", " + "pm10=" + pm10 + ", " + "pm2.5=" + pm2.5 + ", " + "tilt=" + tilt + ", " + "duration=" + duration + ", " + "end=" + end + ", " + "cleaningThreshold=" + cleaningThreshold + ", " + "initialSoiling=" + initialSoiling + ", " + "manualWashDates=" + manualWashDates + ", " + "rainAccumPeriod=" + rainAccumPeriod + ", " + "rainfall=" + rainfall + ", " + "format=" + format;
var status = httpEx.StatusCode.HasValue ? ((int)httpEx.StatusCode).ToString() : "unknown";
var content = httpEx.Data.Contains("Content") ? httpEx.Data["Content"] : "no content";
throw new Exception($@"HTTP error in GetHistoricHsu
Expand All @@ -433,7 +433,7 @@ public async Task<ApiResponse<EstimatedActualsDataResponse>> GetHistoricHsu(
}
catch (Exception ex)
{
var paramDetails = "latitude=" + latitude + ", " + "longitude=" + longitude + ", " + "start=" + start + ", " + "timeZone=" + timeZone + ", " + "period=" + period + ", " + "depoVelocPm10=" + depoVelocPm10 + ", " + "depoVelocPm2_5=" + depoVelocPm2_5 + ", " + "pm10=" + pm10 + ", " + "pm2_5=" + pm2_5 + ", " + "tilt=" + tilt + ", " + "duration=" + duration + ", " + "end=" + end + ", " + "cleaningThreshold=" + cleaningThreshold + ", " + "initialSoiling=" + initialSoiling + ", " + "manualWashDates=" + manualWashDates + ", " + "rainAccumPeriod=" + rainAccumPeriod + ", " + "rainfall=" + rainfall + ", " + "format=" + format;
var paramDetails = "latitude=" + latitude + ", " + "longitude=" + longitude + ", " + "start=" + start + ", " + "timeZone=" + timeZone + ", " + "period=" + period + ", " + "depoVelocPm10=" + depoVelocPm10 + ", " + "depoVelocPm2.5=" + depoVelocPm2.5 + ", " + "pm10=" + pm10 + ", " + "pm2.5=" + pm2.5 + ", " + "tilt=" + tilt + ", " + "duration=" + duration + ", " + "end=" + end + ", " + "cleaningThreshold=" + cleaningThreshold + ", " + "initialSoiling=" + initialSoiling + ", " + "manualWashDates=" + manualWashDates + ", " + "rainAccumPeriod=" + rainAccumPeriod + ", " + "rainfall=" + rainfall + ", " + "format=" + format;
throw new Exception($@"Unhandled error in GetHistoricHsu
Parameters: {paramDetails}
Error: {ex.Message}", ex);
Expand Down
Loading