Skip to content

Add heat budget tutorial#11

Merged
ifenty merged 3 commits intoECCO-GROUP:masterfrom
jetesdal:add_heat_budget_tutorial
Aug 12, 2020
Merged

Add heat budget tutorial#11
ifenty merged 3 commits intoECCO-GROUP:masterfrom
jetesdal:add_heat_budget_tutorial

Conversation

@jetesdal
Copy link
Copy Markdown
Contributor

I like to submit a first draft of the requested tutorial to close the global heat budget in ECCOv4. It is an extension to the heat budget calculations presented in ecco_budgets.ipynb, now including the global ocean. The code works with the netcdf files from the PO.DAAC Drive. The outline and explanations are added to follow a similar format as Volume_budget_closure.ipynb. I tried to do everything with lazy evaluation using xarray and dask, but there are a few cases where calculation load the data into memory. Maybe @rabernat might know how to avoid this. @ifenty I'm open to any suggestions.

@ifenty
Copy link
Copy Markdown
Contributor

ifenty commented Aug 11, 2020

@jetesdal Your heat budget tutorial looks really nice. There is an easier way to load the geothermal heat flux field (really any field saved in the llc format) using the routine 'read_llc_to_tiles'. I made a short notebook to demonstrate on this temporary hosting site. Check it out.

Here is the 'read_llc_to_tiles' code in action and an example of how I convert the geoflx ndarray to xarray DataArray.

geoflx = ecco.read_llc_to_tiles(input_init_dir, 'geothermalFlux.bin')
geoflux_llc = ecco_grid.XC.copy(deep=True)
geoflux_llc.values = geoflx
geoflux_llc.name = 'geoflux'
print(geoflux_llc.dims)
print(geoflux_llc.name)
geoflux_llc.attrs['name'] = 'geothermal flux'

After you implement the use of 'read_llc_to_tiles' I think we can merge.

@jetesdal
Copy link
Copy Markdown
Contributor Author

Thanks @ifenty for the tip. The tutorial is now using 'read_llc_to_tiles' to read the geothermal heat flux field. When converting to xarray, I suggest using xr.DataArray() instead of ecco_grid.XC.copy(deep=True). Otherwise, you'll get attributes that don't make sense (see screenshot).
Screen Shot 2020-08-12 at 5 54 59 PM

@ifenty ifenty merged commit b2f2984 into ECCO-GROUP:master Aug 12, 2020
@ifenty
Copy link
Copy Markdown
Contributor

ifenty commented Aug 12, 2020

@jetesdal agreed. Looks good!

@jetesdal jetesdal deleted the add_heat_budget_tutorial branch August 18, 2020 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants