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 807c49e commit 2c9ec0b
Showing 1 changed file with 0 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,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])

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

Expand Down Expand Up @@ -93,18 +90,13 @@ def apply_args_and_kwargs(fn, args, kwargs):
tmp3d = tmp3d.isel(pfull=slice(0,len(z0)))

# Change the vertical coordinate and dimension for the temperature 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')

# Create the 3D pressure variable
prs3d = xr.DataArray(bk_interp,dims=['z0'],coords={'z0':z0},attrs={'units':'Pa'}).broadcast_like(tmp3d)
prs3d = (prs3d*(ds['pressfc'].squeeze()))*units('Pa').to('hPa')

print(tmp3d)
print(prs3d)

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

Expand All @@ -128,11 +120,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 2c9ec0b

Please sign in to comment.