Skip to content

Commit

Permalink
Correct internal tools script
Browse files Browse the repository at this point in the history
  • Loading branch information
gnrgomes committed Feb 10, 2025
1 parent 4513716 commit d508198
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
OUTPUT_PATH = '/mnt/nahaUsers/gomesgo/CALIBRATION_6.0/var_statistics'

# For pr6, e0, es, et in mm/day
mm_per_day_to_m = 1000.0 / 4.0
mm_per_day_to_m = 1000.0 * 4.0
# For pr6, e0, es, et in mm/6h
mm_to_m = 1000.0

Expand Down Expand Up @@ -95,14 +95,12 @@
# Open the data NetCDF file
data_nc = nc.Dataset(data_filename, 'r')

# Assuming the variable containing the monthly data is named 'monthly_data'
# and the mask variable is named 'mask'
monthly_data_var = v

# Initialize an empty list to store the yearly totals
yearly_totals = []

# Loop through each timeslice (assuming there are 12 for each year)
# Loop through each timeslice
for i in range(start_step, end_step+1):
cur_idx += 1
# Read the data for the current timeslice
Expand All @@ -112,8 +110,7 @@
monthly_data = np.flipud(monthly_data)

# Apply the mask to the data subset
# masked_monthly_data = np.where(mask_data, data_subset, 0)
masked_monthly_data = np.ma.masked_where(mask_data!=1, monthly_data)
masked_monthly_data = np.ma.masked_where(mask_data !=1, monthly_data)

monthly_sum_m = masked_monthly_data / conversion_to_meters

Expand Down

0 comments on commit d508198

Please sign in to comment.