mirror of
https://github.com/MartinOpat/cuda-based-raytrace.git
synced 2025-06-07 02:13:10 +02:00
for some reason computing the mean in python and netcdfc++ gives two slightly different values
This commit is contained in:
@@ -15,9 +15,18 @@ print("Shape of U:", U.shape)
|
||||
|
||||
# Compute the mean of the variable across all axes (for all elements in U)
|
||||
U_mean = np.mean(U)
|
||||
U_sum = np.sum(U)
|
||||
|
||||
# Print the mean
|
||||
print("Mean of U:", U_mean)
|
||||
|
||||
print("Sum of U:", U_sum)
|
||||
|
||||
masked_count = np.ma.count_masked(U)
|
||||
print("Number of masked values in U:", masked_count)
|
||||
|
||||
nan_count = np.isnan(U).sum()
|
||||
print("Number of NaN values in U:", nan_count)
|
||||
|
||||
# Close the NetCDF file
|
||||
ncfile.close()
|
||||
|
||||
Reference in New Issue
Block a user