Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix variable height to elevationAngle #154

Merged
merged 12 commits into from
Mar 4, 2022
2 changes: 1 addition & 1 deletion input/samples/vn_simona/fullGrid/pv_input.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"uuid","albedo","azimuth","cos_phi_rated","eta_conv","height","id","k_g","k_t","market_reaction","node","operates_from","operates_until","operator","q_characteristics","s_rated"
"uuid","albedo","azimuth","cos_phi_rated","eta_conv","elevation_angle","id","k_g","k_t","market_reaction","node","operates_from","operates_until","operator","q_characteristics","s_rated"
5b38af42-1ee4-4a41-b666-ea141187df37,0.20000000298023224,-11.463644027709961,0.8999999761581421,96.0,33.62879943847656,NS_NET146_F2_(3)_PV,0.8999999761581421,1.0,false,0170837a-1876-45f9-a613-666f9991964d,,,,cosPhiFixed:{(0.00,0.90)},10.0
e447506e-3d43-4bce-8aab-a7ca8b7fbc45,0.20000000298023224,3.8914573192596436,0.8999999761581421,98.0,42.77021408081055,NS_NET146_F4_(9)_PV,0.8999999761581421,1.0,false,9b889b73-c108-4b38-b6eb-3377841e0c83,,,,cosPhiFixed:{(0.00,0.90)},10.0
6cac0624-6336-4418-bcf0-990abcdb824b,0.20000000298023224,-8.097375869750977,0.8999999761581421,98.0,44.90728759765625,NS_NET146_F4_(16)_PV,0.8999999761581421,1.0,false,9f7599de-c488-46c5-b053-1279a511f7b9,,,,cosPhiFixed:{(0.00,0.90)},30.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ case object PVModel {
inputModel.getAlbedo,
inputModel.getEtaConv,
inputModel.getAzimuth,
inputModel.getHeight
inputModel.getElevationAngle
)

model.enable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
package edu.ie3.simona.service.primary

import akka.actor.{Actor, ActorRef, PoisonPill, Props}
import edu.ie3.datamodel.io.connectors.CsvFileConnector.CsvIndividualTimeSeriesMetaInformation
import edu.ie3.datamodel.io.csv.timeseries.ColumnScheme
import edu.ie3.datamodel.io.csv.CsvIndividualTimeSeriesMetaInformation
import edu.ie3.datamodel.io.naming.FileNamingStrategy
import edu.ie3.datamodel.io.naming.timeseries.ColumnScheme
import edu.ie3.datamodel.io.source.TimeSeriesMappingSource
import edu.ie3.datamodel.io.source.csv.CsvTimeSeriesMappingSource
import edu.ie3.datamodel.models.value.Value
Expand Down Expand Up @@ -148,7 +148,7 @@ case class PrimaryServiceProxy(
.distinct
.flatMap { timeSeriesUuid =>
mappingSource
.getTimeSeriesMetaInformation(timeSeriesUuid)
.timeSeriesMetaInformation(timeSeriesUuid)
.toScala match {
case Some(metaInformation) =>
val columnScheme = metaInformation.getColumnScheme
Expand Down Expand Up @@ -386,7 +386,7 @@ case class PrimaryServiceProxy(
None
) =>
/* The mapping and actual data sources are from csv. At first, get the file name of the file to read. */
Try(mappingSource.getTimeSeriesMetaInformation(timeSeriesUuid).get)
Try(mappingSource.timeSeriesMetaInformation(timeSeriesUuid).get)
.flatMap {
/* Time series meta information could be successfully obtained */
case csvMetaData: CsvIndividualTimeSeriesMetaInformation =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
package edu.ie3.simona.service.primary

import akka.actor.{ActorRef, Props}
import edu.ie3.datamodel.io.csv.timeseries.ColumnScheme
import edu.ie3.datamodel.io.factory.timeseries.TimeBasedSimpleValueFactory
import edu.ie3.datamodel.io.naming.FileNamingStrategy
import edu.ie3.datamodel.io.naming.timeseries.ColumnScheme
import edu.ie3.datamodel.io.source.TimeSeriesSource
import edu.ie3.datamodel.io.source.csv.CsvTimeSeriesSource
import edu.ie3.datamodel.models.value.Value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ object WeatherSource {
*/
object WeatherScheme extends ParsableEnumeration {
val ICON: Value = Value("icon")
val PSDM: Value = Value("psdm")
val COSMO: Value = Value("cosmo")
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import edu.ie3.datamodel.io.connectors.{
}
import edu.ie3.datamodel.io.factory.timeseries.{
IconTimeBasedWeatherValueFactory,
PsdmTimeBasedWeatherValueFactory
CosmoTimeBasedWeatherValueFactory
}
import edu.ie3.datamodel.io.naming.FileNamingStrategy
import edu.ie3.datamodel.io.source.couchbase.CouchbaseWeatherSource
Expand Down Expand Up @@ -357,7 +357,8 @@ private[weather] object WeatherSourceWrapper extends LazyLogging {
.mkString("\n\t")}'"
)
case Success(WeatherScheme.ICON) => new IconTimeBasedWeatherValueFactory()
case Success(WeatherScheme.PSDM) => new PsdmTimeBasedWeatherValueFactory()
case Success(WeatherScheme.COSMO) =>
new CosmoTimeBasedWeatherValueFactory()
case Success(unknownScheme) =>
throw new InitializationException(
s"Error while initializing WeatherFactory for weather source wrapper: weather scheme '$unknownScheme' is not an expected input."
Expand All @@ -373,8 +374,8 @@ private[weather] object WeatherSourceWrapper extends LazyLogging {
)
case Success(WeatherScheme.ICON) =>
new IconTimeBasedWeatherValueFactory(timeStampPattern)
case Success(WeatherScheme.PSDM) =>
new PsdmTimeBasedWeatherValueFactory(timeStampPattern)
case Success(WeatherScheme.COSMO) =>
new CosmoTimeBasedWeatherValueFactory(timeStampPattern)
case Success(unknownScheme) =>
throw new InitializationException(
s"Error while initializing WeatherFactory for weather source wrapper: weather scheme '$unknownScheme' is not an expected input."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ trait PVModelITHelper {
inputModel.getAlbedo(),
inputModel.getEtaConv(),
inputModel.getAzimuth(),
inputModel.getHeight(),
inputModel.getElevationAngle(),
getQuantity(1d, SQUARE_METRE)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class PVModelTest extends Specification {
pvInput.getAlbedo(),
pvInput.getEtaConv() as ComparableQuantity<Dimensionless>,
getQuantity(Math.toRadians(pvInput.getAzimuth().getValue().doubleValue()), RADIAN),
getQuantity(Math.toRadians(pvInput.getHeight().getValue().doubleValue()), RADIAN),
getQuantity(Math.toRadians(pvInput.getElevationAngle().getValue().doubleValue()), RADIAN),
getQuantity(1d, SQUARE_METRE)
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"uuid";"albedo";"azimuth";"cosphi_rated";"eta_conv";"height";"id";"k_g";"k_t";"market_reaction";"operates_from";"operates_until";"s_rated";"q_characteristics";"node";"operator"
"uuid";"albedo";"azimuth";"cosphi_rated";"eta_conv";"elevation_angle";"id";"k_g";"k_t";"market_reaction";"operates_from";"operates_until";"s_rated";"q_characteristics";"node";"operator"
7ac5bb15-36ee-42b0-902b-9cd520e241b3;0.2;16.09490984119475;0.95;91.23978812713176;51.75144341774285;pv_south_1;0.9;1;false;;;100;cosPhiFixed:{(0.00,1.0)};022a94c6-2d60-4400-875c-ab9db1ae2736;
939d254a-98b9-43d9-939d-dac9d91e7d73;0.2;-11.883286549709737;0.95;93.55452200165019;50.710754711180925;pv_south_2;0.9;1;false;;;100;cosPhiFixed:{(0.00,1.0)};9a2524f1-3639-4e90-a547-81a259712f8c;
e3b34366-9a4b-4e8f-b46d-fccdd3c318b3;0.2;-3.6445723846554756;0.95;90.07983175106347;50.727743320167065;pv_south_3;0.9;1;false;;;100;cosPhiFixed:{(0.00,1.0)};9354b02c-a4a9-4e9d-905a-e48110b04d88;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ class ConfigFailFastSpec extends UnitSpec with ConfigTestData {
ConfigFailFast invokePrivate checkWeatherDataSource(
weatherDataSource
)
}.getMessage shouldBe "The weather data scheme 'this won't work' is not supported. Supported schemes:\n\ticon\n\tpsdm"
}.getMessage shouldBe "The weather data scheme 'this won't work' is not supported. Supported schemes:\n\ticon\n\tcosmo"
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import akka.actor.{ActorRef, ActorSystem, PoisonPill}
import akka.testkit.{TestActorRef, TestProbe}
import akka.util.Timeout
import com.typesafe.config.ConfigFactory
import edu.ie3.datamodel.io.csv.timeseries.ColumnScheme
import edu.ie3.datamodel.io.naming.FileNamingStrategy
import edu.ie3.datamodel.io.naming.timeseries.ColumnScheme
import edu.ie3.datamodel.io.source.TimeSeriesMappingSource
import edu.ie3.datamodel.io.source.csv.CsvTimeSeriesMappingSource
import edu.ie3.datamodel.models.value.{SValue, Value}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ trait PvInputTestData
1,
Quantities.getQuantity(12, StandardUnits.AZIMUTH),
Quantities.getQuantity(10, StandardUnits.EFFICIENCY),
Quantities.getQuantity(100, StandardUnits.SOLAR_HEIGHT),
Quantities.getQuantity(100, StandardUnits.SOLAR_ELEVATION_ANGLE),
12,
11,
false,
Expand Down