Complex eof#9
Conversation
…izes the data as time vs space and subtract the mean field in each coordinate. It returns all the variables related to CEOF in a DataArray.
I added the description for the ceof and reconstruct_ceof modules.
I added the ceof, reconstruct_ceof modules in the init file
| # PERFORM COMPLEX EOF | ||
| #========================================= | ||
| from scipy.signal import hilbert | ||
| import scipy.linalg as la |
There was a problem hiding this comment.
Imports should be placed in the top of each file regardless of the fuction in which they are used
| Translated to Python by Felipe Vilela da Silva @ IMAS, UTas, AU on 15/Mar/2021 | ||
| ============================================================================== | ||
| Inputs: | ||
| -> lon: longitudes (array) |
There was a problem hiding this comment.
Can you make the inputs following the standards of the other .py? (Maybe it changed after you started this) It's just capital input/output and the variables below the "U" (3 spaces), with the "=" signed aligned for the larger name: Example INPUT: Small = A variable with a small name BigNamedOne = A variable with a big name
| -> pcs: First nkp Complex Principal Components or amplitudes [time, nkp] | ||
| -> t_amp: Temporal amplitude [time, nkp] | ||
| -> t_phase: Temporal phase [time, nkp] | ||
| ============================================================================== |
There was a problem hiding this comment.
Please, remove all authorship comments (except for previous credits or paper citations). All contributors from OceanLab Team will be included in a single "contributors" file
Following Ryukamusa request about "Imports should be placed in the top of each file"
Following dantecn request
Now, org_data_ceof works faster and returns a DataArray
Followed @dantecn suggestion.
I just realized a typo.
| New modifications: | ||
| (i) The function organizes the data as time vs space and subtract the mean field in each coordinate | ||
| (ii) It returns all the variables related to CEOF in a DataArray | ||
| ''' |
There was a problem hiding this comment.
I'm not sure this version control is useful here.
- github has version control
- when we merge these commits, it will be the "actual first version" =P
| coords={'lat':(dims[1], lat), 'lon':(dims[2], lon)}) | ||
| data_ceof = datxarray.stack(lat_lon=("lat", "lon")).data_latlon | ||
| return data_ceof | ||
|
|
There was a problem hiding this comment.
@Ryukamusa @iuryt any idea on how to define these functions that are used only within other functions and used only internally?
Maybe define with the underline "_" at the beginning, as we did for _parallel_computing in the utils module?
def _org_data_ceof()
def _amplitude_phase()
There was a problem hiding this comment.
I have to learn where to put my comments o.0
I just followed dantecn suggestion
"_" at the beginning of auxiliary functions.
I added the parallel option to build a standard client within the ceof function. In case the user doesn't want a standard client, he/she can turn the option to False and build the client with other settings.
The ceof and reconstruct_ceof functions were tested in two different datasets (array and DataArray) in two different regions of the ocean. The ceof() returns the eigenvalues, eigenvectors (real and imaginary), amplitudes (real and imaginary), besides the spatial and temporal amplitudes and phases in a DataArray. The reconstruct_ceof() gives the reconstrucion of CEOF modes individually. I am happy to hear and follow any review.