nansencenter / nansat

Scientist friendly Python toolbox for processing 2D satellite Earth observation data.
http://nansat.readthedocs.io
GNU General Public License v3.0
181 stars 66 forks source link

Generic solution to reprojection of grids with currents (winds) components #65

Open akorosov opened 10 years ago

akorosov commented 10 years ago

Problem

Ocean currents or winds are usually presented as two grids with U and V components of the vector. And usually these components are related to the grid system of coordinates. E.g. ROMS model grid has stereographic projection with center at 60N, 70E. V is 'y_sea_water_velocity', U is 'x_sea_water_velocity'. So when we calculate direction of this current (using atan2) we calculate it relative to the direction of the X-axis of the model grid. The problem appears when we try to reproject this data. After changing projection of the grid we keep values of U and V but they are not valid anymore since direction of X/Y-axes of the new grid do not coincide with direction of X/Y-axes of the original grid. Solution is not trivial:

  1. calculate direction (and speed) of ocean current relative to X-axis from U,V
  2. calcluate azimuth of Y-axis direction (azimuth_up)
  3. calculate direction of current relative to North (azimuth of ocean current)
  4. Add bands with speed and ocean current azimuth to Nansat object
  5. Reproject
  6. calcluate azimuth of Y-axis direction (azimuth_up) on the new grid
  7. calculate direction of ocean current relative to X-axis of the new grid
  8. Calcluate U,V from speed and relative direction

    Question

How to implement this solution in Nansat and make it generic?

mortenwh commented 7 years ago

Following the CF conventions, the parameter names either start with x_/y_ or eastward_/northward_. If these parameters are projected (i.e., x_<param>/y_<param> ), shouldn't it then be enough to simply calculate eastward and northward components before reprojection, then use these new bands for calculation of speed and direction?

mortenwh commented 7 years ago

This issue can be closed and left to be handled by users. In general, it is important to follow the CF-conventions and focus on eastward/northward vs x/y directed velocities.

korvinos commented 5 years ago

@mortenwh and @akorosov I am just wondering if there is any tool could help me to make this correction/transformation? I am not quite sure how it works, so if you could share a link or navigate me a little bit there it would be great.