Skip to content

Complex eof#9

Merged
vsilvafelipe merged 12 commits into
masterfrom
complex_eof
Oct 5, 2021
Merged

Complex eof#9
vsilvafelipe merged 12 commits into
masterfrom
complex_eof

Conversation

@vsilvafelipe

Copy link
Copy Markdown
Member

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.

…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
Comment thread OceanLab/eof.py Outdated
# PERFORM COMPLEX EOF
#=========================================
from scipy.signal import hilbert
import scipy.linalg as la

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imports should be placed in the top of each file regardless of the fuction in which they are used

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread OceanLab/eof.py Outdated
Translated to Python by Felipe Vilela da Silva @ IMAS, UTas, AU on 15/Mar/2021
==============================================================================
Inputs:
-> lon: longitudes (array)

@dantecn dantecn Jul 12, 2021

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread OceanLab/eof.py Outdated
-> pcs: First nkp Complex Principal Components or amplitudes [time, nkp]
-> t_amp: Temporal amplitude [time, nkp]
-> t_phase: Temporal phase [time, nkp]
==============================================================================

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

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
I just realized a typo.
Comment thread OceanLab/eof.py
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
'''

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this version control is useful here.

  1. github has version control
  2. when we merge these commits, it will be the "actual first version" =P

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread OceanLab/eof.py
coords={'lat':(dims[1], lat), 'lon':(dims[2], lon)})
data_ceof = datxarray.stack(lat_lon=("lat", "lon")).data_latlon
return data_ceof

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to learn where to put my comments o.0

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

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.
@vsilvafelipe vsilvafelipe merged commit 0e08095 into master Oct 5, 2021
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.

3 participants