Skip to content

Commit

Permalink
Removes unused code from development and print statements from develo…
Browse files Browse the repository at this point in the history
…pment.
  • Loading branch information
DanielAdriaansen committed Dec 23, 2024
1 parent 6f8cc5b commit 98adc3d
Showing 1 changed file with 0 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ def apply_args_and_kwargs(fn, args, kwargs):
ny = indims['grid_yt']
nx = indims['grid_xt']

# Flip the latitudes across the equator
#ds = ds.reindex(grid_yt=ds.grid_yt[::-1])

print(ds.spfh)

# Open the mask file
maskdata = xr.open_dataset(mask_file)

Expand Down Expand Up @@ -99,8 +94,6 @@ def apply_args_and_kwargs(fn, args, kwargs):
sph3d = sph3d.isel(pfull=slice(0,len(z0)))

# Change the vertical coordinate and dimension for the temperature and specific humidity data to be z0
#tmp3d = tmp3d.expand_dims(dim={'z0':z0}).assign_coords({'z0':z0}).isel(pfull=0).squeeze()
#tmp3d = tmp3d.expand_dims(dim={'z0':z0}).assign_coords({'z0':z0}).squeeze()
tmp3d = tmp3d.rename({'pfull':'z0'}).assign_coords({'z0':z0})
tmp3d = tmp3d*units('degK')
sph3d = sph3d.rename({'pfull':'z0'}).assign_coords({'z0':z0})
Expand All @@ -114,10 +107,6 @@ def apply_args_and_kwargs(fn, args, kwargs):
dew3d = dewpoint_from_specific_humidity(prs3d,sph3d)
dew3d = dew3d*units('degK')

print(tmp3d)
print(prs3d)
print(dew3d)

# Get a pool of workers
mp = multiprocessing.Pool(multiprocessing.cpu_count()-2)

Expand All @@ -143,11 +132,6 @@ def apply_args_and_kwargs(fn, args, kwargs):
# Re-populate the stacked array with the values at the correct locations
resstack[mskstack>0] = result

# Put the results back into an Xarray DataArray and assign the multi-index variable from
# stacking earlier so we can unstack the data into a 2D grid
#met_data = xr.DataArray(result,dims=['sid'],coords={'sid':tmpstack.sid},attrs={'units':'J/kg'}).unstack().to_netcdf('test.nc')
#met_data = xr.DataArray(result,dims=['sid'],coords={'sid':tmpstack.sid},attrs={'units':'J/kg'}).unstack()

# Unstack the data from the `sid` dimension back to just grid_xt and grid_yt (2D) and obtain the NumPy N-D array
met_data = resstack.unstack()
met_data = met_data.reindex(grid_yt=met_data.grid_yt[::-1])
Expand Down

0 comments on commit 98adc3d

Please sign in to comment.