Skip to content

Commit

Permalink
package structure + debug dashboard color ramps
Browse files Browse the repository at this point in the history
  • Loading branch information
tschlenther committed Sep 25, 2024
1 parent 8d16a3e commit c44f494
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.matsim.analysis.postAnalysis;
package org.matsim.analysis.postAnalysis.emissions;

import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVPrinter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* *
* *********************************************************************** */

package org.matsim.analysis.emissions;
package org.matsim.analysis.postAnalysis.emissions;

import it.unimi.dsi.fastutil.objects.Object2DoubleLinkedOpenHashMap;
import it.unimi.dsi.fastutil.objects.Object2DoubleMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

package org.matsim.dashboard;

import org.matsim.analysis.postAnalysis.EmissionsPostProcessingAverageAnalysis;
import org.matsim.analysis.postAnalysis.emissions.EmissionsPostProcessingAverageAnalysis;
import org.matsim.simwrapper.Dashboard;
import org.matsim.simwrapper.Data;
import org.matsim.simwrapper.Header;
Expand All @@ -33,6 +33,8 @@
import java.util.ArrayList;
import java.util.List;

import static org.matsim.dashboard.AverageKelheimNoiseDashboard.*;

/**
* Average emissions dashboard for several runs with the same config but a different random seed.
*/
Expand Down Expand Up @@ -105,13 +107,15 @@ public void configure(Header header, Layout layout) {
viz.title = "CO₂ Emissions";
viz.description = "per day. Be aware that CO2 values are provided in the simulation sample size!";
viz.projection = "EPSG:25832";
viz.setColorRamp(new double[]{30, 40, 50, 60, 70}, new String[]{DARK_BLUE, LIGHT_BLUE, YELLOW, SAND, ORANGE, RED});
viz.height = 12.0;
viz.file = postProcess(data, "mean_emissions_grid_per_day.xyt.csv");
});
layout.row("third")
.el(GridMap.class, (viz, data) -> {
viz.title = "CO₂ Emissions";
viz.projection = "EPSG:25832";
viz.setColorRamp(new double[]{30, 40, 50, 60, 70}, new String[]{DARK_BLUE, LIGHT_BLUE, YELLOW, SAND, ORANGE, RED});
viz.description = "per hour. Be aware that CO2 values are provided in the simulation sample size!";
viz.height = 12.;
viz.file = postProcess(data, "mean_emissions_grid_per_hour.csv");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ public class AverageKelheimNoiseDashboard implements Dashboard {
private final List<String> dirs;
private final Integer noRuns;
private static final String NOISE = "noise";
private static final String DARK_BLUE = "#1175b3";
private static final String LIGHT_BLUE = "#95c7df";
private static final String ORANGE = "#f4a986";
private static final String RED = "#cc0c27";
private static final String SAND = "#dfb095";
private static final String YELLOW = "#dfdb95";
static final String DARK_BLUE = "#1175b3";
static final String LIGHT_BLUE = "#95c7df";
static final String ORANGE = "#f4a986";
static final String RED = "#cc0c27";
static final String SAND = "#dfb095";
static final String YELLOW = "#dfdb95";

public AverageKelheimNoiseDashboard(List<String> dirs, Integer noRuns) {
this.dirs = dirs;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.matsim.dashboard;

import org.matsim.analysis.emissions.KelheimEmissionsDashboard;
import org.matsim.core.config.Config;
import org.matsim.core.utils.io.IOUtils;
import org.matsim.simwrapper.Dashboard;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
* *
* *********************************************************************** */

package org.matsim.analysis.emissions;
package org.matsim.dashboard;

import org.matsim.analysis.postAnalysis.emissions.KelheimOfflineAirPollutionAnalysisByEngineInformation;
import org.matsim.application.prepare.network.CreateGeoJsonNetwork;
import org.matsim.simwrapper.Dashboard;
import org.matsim.simwrapper.Header;
Expand All @@ -28,6 +29,9 @@
import org.matsim.simwrapper.viz.Links;
import org.matsim.simwrapper.viz.Table;

import static org.matsim.dashboard.AverageKelheimNoiseDashboard.*;
import static org.matsim.dashboard.AverageKelheimNoiseDashboard.RED;

/**
* this is basically equivalent to the standard emissions dashboard
* but calls the matsim-kelheim-specific emissions analysis class
Expand Down Expand Up @@ -93,13 +97,16 @@ public void configure(Header header, Layout layout) {
viz.description = "per day. Be aware that CO2 values are provided in the simulation sample size!";
viz.height = 12.0;
viz.file = data.compute(KelheimOfflineAirPollutionAnalysisByEngineInformation.class, "emissions_grid_per_day.xyt.csv", new String[0]);
viz.setColorRamp(new double[]{30, 40, 50, 60, 70}, new String[]{DARK_BLUE, LIGHT_BLUE, YELLOW, SAND, ORANGE, RED});

});
layout.row("third")
.el(GridMap.class, (viz, data) -> {
viz.title = "CO₂ Emissions";
viz.description = "per hour. Be aware that CO2 values are provided in the simulation sample size!";
viz.height = 12.;
viz.file = data.compute(KelheimOfflineAirPollutionAnalysisByEngineInformation.class, "emissions_grid_per_hour.csv");
viz.setColorRamp(new double[]{30, 40, 50, 60, 70}, new String[]{DARK_BLUE, LIGHT_BLUE, YELLOW, SAND, ORANGE, RED});
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.matsim.analysis.emissions.KelheimEmissionsDashboard;
import org.matsim.application.ApplicationUtils;
import org.matsim.application.MATSimAppCommand;
import org.matsim.application.options.ShpOptions;
Expand Down

0 comments on commit c44f494

Please sign in to comment.