diff --git a/include/inset_state.hpp b/include/inset_state.hpp index 7304e175..44a56130 100644 --- a/include/inset_state.hpp +++ b/include/inset_state.hpp @@ -294,7 +294,6 @@ class InsetState void write_labels_on_surface(cairo_t *cr); void write_density_image( const std::string filename, - const double *density, const bool plot_pycnophylactic); void write_intersections_image(unsigned int res); void write_legend_on_surface(cairo_t *cr, bool equal_area_map); diff --git a/src/inset_state/blur_density.cpp b/src/inset_state/blur_density.cpp index 04c69f32..8ffc11a9 100644 --- a/src/inset_state/blur_density.cpp +++ b/src/inset_state/blur_density.cpp @@ -22,6 +22,6 @@ void InsetState::blur_density(const double blur_width, bool plot_density) if (plot_density && blur_width > 0.1) { std::string file_name = inset_name_ + "_blurred_density_" + std::to_string(n_finished_integrations()) + ".svg"; - write_density_image(file_name, rho_init_.as_1d_array(), false); + write_density_image(file_name, false); } } diff --git a/src/inset_state/fill_with_density_clip.cpp b/src/inset_state/fill_with_density_clip.cpp index a9418ec1..9a00985e 100644 --- a/src/inset_state/fill_with_density_clip.cpp +++ b/src/inset_state/fill_with_density_clip.cpp @@ -179,11 +179,5 @@ void InsetState::fill_with_density_clip(bool plot_density) dens_mean_ = ocean_density; dens_max_ = *max_iter; - if (plot_density) { - std::string file_name = inset_name_ + "_unblurred_density_" + - std::to_string(n_finished_integrations()) + ".svg"; - write_density_image(file_name, rho_init_.as_1d_array(), false); - } - execute_fftw_fwd_plan(); } diff --git a/src/inset_state/fill_with_density_rays.cpp b/src/inset_state/fill_with_density_rays.cpp index 230c9f77..09db7101 100644 --- a/src/inset_state/fill_with_density_rays.cpp +++ b/src/inset_state/fill_with_density_rays.cpp @@ -244,11 +244,5 @@ void InsetState::fill_with_density_rays(bool plot_density) exterior_density_ = exterior_density; dens_max_ = *max_iter; - if (plot_density) { - std::string file_name = inset_name_ + "_unblurred_density_" + - std::to_string(n_finished_integrations()) + ".svg"; - write_density_image(file_name, rho_init_.as_1d_array(), false); - } - execute_fftw_fwd_plan(); } diff --git a/src/inset_state/write_image.cpp b/src/inset_state/write_image.cpp index 8acf531f..212710f0 100644 --- a/src/inset_state/write_image.cpp +++ b/src/inset_state/write_image.cpp @@ -886,10 +886,9 @@ void InsetState::write_legend_on_surface(cairo_t *cr, bool equal_area_map) void InsetState::write_density_image( const std::string filename, - const double *density, const bool plot_pycnophylactic) { - + double *density = rho_init_.as_1d_array(); std::cerr << "Writing " << filename << std::endl; // Whether to draw bar on the cairo surface const bool draw_bar = false; diff --git a/src/main.cpp b/src/main.cpp index ee656145..01c61445 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -292,6 +292,12 @@ int main(const int argc, const char *argv[]) } } + if (plot_density) { + std::string file_name = inset_state.inset_name() + "_unblurred_density_" + + std::to_string(inset_state.n_finished_integrations()) + ".svg"; + inset_state.write_density_image(file_name, false); + } + const double blur_width = inset_state.blur_width(); if (blur_width > 0.0) { time_tracker.start("Blur");