xgcm / xcape

Fast convective parameters for numpy, dask, and xarray
Other
30 stars 11 forks source link

Improve documentation on order of dimensions and units #53

Open zbruick opened 2 years ago

zbruick commented 2 years ago

First, this is a super useful package, so thank you to the creators and contributors! Second, in attempting to use this package, I stumbled across two confusing items related to documentation:

  1. Order of dimensions within input arrays

In calc_cape, it is implied that the order of dimensions for 4-D arrays should be (z, y, x, t), coming from the docstring in line 149: When vertical_lev='model', p.shape = t.shape = (nlev, x, y, ...). However, in _reshape_inputs and _reshape_surface_inputs it's clear that the input arrays are expected to be in the order of (x, y, t, z) or (x, y, t), respectively, which turns out to be the correct order. The docstring for calc_cape should be updated to reflect this.

  1. Units of input arrays

In calc_cape all temperature-related input arrays are specified to be in degC, but in cape within fortran.py, the docstring says everything should be in Kelvin. I believe degC is correct, based on the results I was able to get, but documentation should be updated to match and be correct.

May have time to put in a PR on this at some point soon, but just wanted to flag here for now.

xebadir commented 2 years ago

Hi @zbruick

Thanks for noting these issues. I'm beginning to work on the next set of additions and expansion of the variables covered by xcape so I will take a look at fixing these (as they arise from my adding documentation).