Skip to content

Commit

Permalink
Write unblurred density after creating quadtree
Browse files Browse the repository at this point in the history
  • Loading branch information
adisidev committed Dec 23, 2024
1 parent f44f74a commit 0166544
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 16 deletions.
1 change: 0 additions & 1 deletion include/inset_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/inset_state/blur_density.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
6 changes: 0 additions & 6 deletions src/inset_state/fill_with_density_clip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
6 changes: 0 additions & 6 deletions src/inset_state/fill_with_density_rays.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
3 changes: 1 addition & 2 deletions src/inset_state/write_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

1 comment on commit 0166544

@adisidev
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nihalzp I'm trying to retrace what the reason for this might've been. Do you have any ideas?

Please sign in to comment.