Skip to content

Commit

Permalink
Noise dashboard (#3254)
Browse files Browse the repository at this point in the history
* first version of Noise Dashboard

* Added noise analysis class and merge class for noise data. Add support for avro files

* improved generated avro files

* update noise analysis

* clean code

* make csv code deprecated

* implement fixedColors for MapPlot

* added breakpoints and colors to GridMap

* added breakpoints and colors to GridMap

* Added avro file

* Added avro file

* realize feedback

* realize feedback

---------

Co-authored-by: rakow <[email protected]>
  • Loading branch information
frievoe97 and rakow authored May 6, 2024
1 parent 25de0eb commit 368b724
Show file tree
Hide file tree
Showing 18 changed files with 1,858 additions and 433 deletions.
35 changes: 34 additions & 1 deletion contribs/application/pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<parent>
<groupId>org.matsim</groupId>
Expand All @@ -20,12 +21,21 @@
</repository>
</repositories>

<properties>
<avro.version>1.11.3</avro.version>
</properties>

<dependencies>

<dependency>
<groupId>tech.tablesaw</groupId>
<artifactId>tablesaw-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro</artifactId>
<version>${avro.version}</version>
</dependency>

<dependency>
<groupId>org.matsim.contrib</groupId>
Expand Down Expand Up @@ -140,4 +150,27 @@
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.avro</groupId>
<artifactId>avro-maven-plugin</artifactId>
<version>${avro.version}</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>schema</goal>
</goals>
<configuration>
<sourceDirectory>${project.basedir}/src/main/avro/</sourceDirectory>
<outputDirectory>${project.basedir}/src/main/java/</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
47 changes: 47 additions & 0 deletions contribs/application/src/main/avro/xyt.avsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"namespace": "org.matsim.application.avro",
"type": "record",
"name": "XYTData",
"fields": [
{
"name": "crs",
"type": "string",
"doc": "Coordinate reference system"
},
{
"name": "xCoords",
"doc": "List of x coordinates",
"type": {
"type": "array",
"items": "float"
}
},
{
"name": "yCoords",
"doc": "List of y coordinates",
"type": {
"type": "array",
"items": "float"
}
},
{
"name": "timestamps",
"doc": "List of timestamps in seconds",
"type": {
"type": "array",
"items": "int"
}
},
{
"name": "data",
"doc": "XYT data for each dataset. The key is the name, the data is stored in one chunk of data.",
"type": {
"type": "map",
"values": {
"type": "array",
"items": "float"
}
}
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ private Config prepareConfig() {
config.transit().setTransitScheduleFile(ApplicationUtils.matchInput("transitSchedule", input.getRunDirectory()).toAbsolutePath().toString());
config.transit().setVehiclesFile(ApplicationUtils.matchInput("transitVehicles", input.getRunDirectory()).toAbsolutePath().toString());
config.plans().setInputFile(null);
config.facilities().setInputFile(null);
config.eventsManager().setNumberOfThreads(null);
config.eventsManager().setEstimatedNumberOfEvents(null);
config.global().setNumberOfThreads(1);
Expand Down Expand Up @@ -337,8 +338,8 @@ private void writeTimeDependentRaster(Network network, Config config, EmissionsO
Coord coord = raster.getCoordForIndex(xi, yi);
double value = timeBin.getValue().get(Pollutant.CO2_TOTAL).getValueByIndex(xi, yi);

// if (value == 0)
// continue;
if (value == 0)
continue;

printer.print(timeBin.getStartTime());
printer.print(coord.getX());
Expand Down
Loading

0 comments on commit 368b724

Please sign in to comment.