Skip to content

Commit 579ad92

Browse files
Fix critical projection bugs: mode=:sum and weight scaling
- Fix mode=:sum bug: sum mode was incorrectly dividing by weights - Fix weight scaling bug: weight_scale not applied in sequential/parallel processing
1 parent 04abd8f commit 579ad92

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/functions/projection/projection_hydro.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ function projection( dataobject::HydroDataType, vars::Array{Symbol,1};
693693
try
694694
# Use parallel projection system
695695
parallel_grids, parallel_weights, parallel_stats = project_amr_parallel(
696-
dataobject, keys(data_dict), data_dict, xval, yval, leveldata, weightval,
696+
dataobject, keys(data_dict), data_dict, xval, yval, leveldata, weightval .* weight_scale,
697697
grid_extent, (length1, length2), boxlen, lmin, simlmax;
698698
max_threads=max_threads, use_memory_pool=false, verbose=(verbose && verbose_threads)
699699
)
@@ -735,7 +735,7 @@ function projection( dataobject::HydroDataType, vars::Array{Symbol,1};
735735
# are already consistently masked in prep_data
736736
x_level = xval[mask_level]
737737
y_level = yval[mask_level]
738-
weights_level = weightval[mask_level]
738+
weights_level = weightval[mask_level] * weight_scale # Apply weight unit scaling
739739

740740
# Apply geometric center alignment corrections if available
741741
if isdefined(Main, :get_center_correction)

0 commit comments

Comments
 (0)