Skip to content

Commit

Permalink
New year changes (#300)
Browse files Browse the repository at this point in the history
* update history file

* complete

* api with llcrearrange

* unpin xesmf

* unpin binder env

* unpin python

* add description to module

* improve funcs definitions

* improve definitions to appear in api

* formatting

* improve documentation on the transformation api

* formatting

* formatting

* improve description arctic_crown

* api

* move description to arctic_crown

* clarify discontinuity at 180 degrees East

* formatting

* grammar

* add reference

* add reference from xarray

* documentation

* fix spacing

* improve docs

* improve notes

* improve docs

* improve text

* improve text

* include p= `str` as argument - other option from pos_viewer

* pass tests now

* this is now default

* fix failing test

* remove unused

* create grid to inter lat/lons

* remove unnecessary code - prescribed vars

* interp angles with non-periodic grid

* add rot metrics to mates

* correct import

* rotate cosine angle

* not cos but sine

* reverse sign arct face2

* rotate angles

* sine correction

* rotate angles

* flip angles in facets

* split if

* remove sign change

* flip sign sine

* apply sign change

* rotate arc face 7 sign angle

* do not flip sign on cos

* remove sign change

* rotate vector fields with angles

* reverse orientation of vector

* fix bug

* fix more

* fix typo

* fix bug

* point to right var

* again fix var

* only apply to multi-dim datavars

* use the mate var

* keep original assert attrs

* use dict for attrs

* removed fn, now in llc_rearrange

* always drop

* make sure proper grid locations

* formatting

* update docs

Co-authored-by: Miguel Jimenez <mjimen17@jhu.edu>
  • Loading branch information
Miguel Jimenez and Mikejmnez committed Dec 30, 2022
1 parent 5663338 commit 29b38c2
Show file tree
Hide file tree
Showing 11 changed files with 288 additions and 182 deletions.
5 changes: 5 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
History
=======

v0.3.1 (2022-12-14)
-------------------
Fix tarball and wheel for new release (PR 295 by `Filipe Fernandes`_).

v0.3.0 (2022-12-12)
-------------------
Migrated master to main (PR 239 by `Mattia Almansi`_). Allow oceandataset to have dict-style access to
Expand All @@ -27,4 +31,5 @@ Initial release published in the `Journal of Open Source Software`_.
.. _`Ali Siddiqui`: https://github.com/asiddi24
.. _`Miguel Jimenez Urias`: https://github.com/Mikejmnez
.. _`Wenrui Jiang`: https://github.com/MaceKuailv
.. _`Filipe Fernandes`: https://github.com/ocefpaf
.. _`Journal of Open Source Software`: https://joss.theoj.org
4 changes: 2 additions & 2 deletions binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: rise-environment
channels:
- conda-forge
dependencies:
- python < 3.10
- python
- numpy
- matplotlib
- pandas
Expand All @@ -12,7 +12,7 @@ dependencies:
- distributed
- bottleneck
- netCDF4
- xarray < 2022.6
- xarray
- cartopy < 0.20
- esmpy
- intake-xarray
Expand Down
2 changes: 1 addition & 1 deletion ci/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies:
- intake-xarray
- geopy
- xesmf
- esmf < 8.4
- esmf
- xgcm < 0.7
- Ipython
- tqdm
Expand Down
Binary file modified docs/.DS_Store
Binary file not shown.
22 changes: 22 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -217,3 +217,25 @@ Functions
utils.densjmd95
utils.densmdjwf
utils.Coriolis_parameter

LLC-transformation
==================
.. autosummary::
:toctree: generated/

llc_rearrange


Class
---------
.. autosummary::
:toctree: generated/

llc_rearrange.LLCtransformation

.. Classmethod
.. ---------
.. .. autosummary::
.. :toctree: generated/
.. llc_rearrange.LLCtransformation.arctic_crown
31 changes: 0 additions & 31 deletions oceanspy/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
geographical_aligned_velocities=["U_zonal", "V_merid"],
survey_aligned_velocities=["rot_ang_Vel", "tan_Vel", "ort_Vel"],
missing_horizontal_spacing=["dxF", "dxV", "dyF", "dyU"],
missing_cs_sn=["CS", "SN"],
)


Expand Down Expand Up @@ -2834,36 +2833,6 @@ def salt_budget(od):
return _ospy.OceanDataset(ds).dataset


def missing_cs_sn(od):
"""
Compute missing grid orientaioon.
Parameters
----------
od: OceanDataset
oceandataset used to compute
Returns
-------
od: OceanDataset
| CS: cosine of the orientation angle
| SN: sine of the orientation angle
"""
xc = _np.deg2rad(_np.array(od._ds.XC))
yc = _np.deg2rad(_np.array(od._ds.YC))
cs = _np.zeros_like(xc)
sn = _np.zeros_like(xc)
cs[0], sn[0] = _utils.find_cs_sn(yc[0], xc[0], yc[1], xc[1])
cs[-1], sn[-1] = _utils.find_cs_sn(yc[-2], xc[-2], yc[-1], xc[-1])
cs[1:-1], sn[1:-1] = _utils.find_cs_sn(yc[:-2], xc[:-2], yc[2:], xc[2:])
od._ds["CS"] = od._ds["XC"]
od._ds["CS"].values = cs

od._ds["SN"] = od._ds["XC"]
od._ds["SN"].values = sn
return od


def missing_horizontal_spacing(od):
"""
Compute missing horizontal spacing.
Expand Down
Loading

0 comments on commit 29b38c2

Please sign in to comment.