FESOM / pyfesom

python library and tools for pre and post processing of the FESOM ocean model files
http://pyfesom.readthedocs.io/en/latest/index.html
MIT License
11 stars 6 forks source link

problems with processing velocity data #17

Closed auroralin0408 closed 1 year ago

auroralin0408 commented 1 year ago

I did't find examples about processing FESOM velocity data using pyfesom, and I met some problems I coudn't figure out:

  1. u, elem_no_nan = pf.get_data(f.variables['u'][time_id,:],mesh,lv_dep) the output u is 2-d, not like temp whose output is 1-d and is the same size as mesh.x2. What's the corresponding grid of the u?
  2. If I use pf.fesom2regular(u, mesh, lonn, latt, how='idist', k=10) directly, is the output right for me to use in lon/lat grid? Is there a need to use pf.vec_rotate_r2g ?
koldunovn commented 1 year ago

Hi

Are you trying to use FESOM1.4 data (e.g. CMIP6 output) or FESOM2? In the first case I would need an example of files, since there might be differences in output formats.

The answer to the second question is probably yes, as the output in most of the cases is on rotated grid.

auroralin0408 commented 1 year ago

Thanks for your quick reply! @koldunovn I'm using FESOM 1.4 data, and I just found out what's wrong with my code that led to the first question...

As for the second question, should I use pf.vec_rotate_r2g after pf.get_data and before pf.fesom2regular, and plot with u_idw? or there is no need to use pf.fesom2regular, and I can interpolate u1 on my own and plot the results? image

auroralin0408 commented 1 year ago

And, if I want to plot the w, is the process the same as plotting temp and no need for pf.vec_rotate_r2g ?

koldunovn commented 1 year ago

@auroralin0408 you have to get the data and then rotate, yes. You can then interpolate or plot original data on triangular mesh, this choice is on you :) You can totally interpolate U1 by yourself with the method you find best.

auroralin0408 commented 1 year ago

ok, I understand. Thanks a lot!