Giter VIP home page Giter VIP logo

wavy's Introduction

wavy

Tests (python) Lint Coverage Status Documentation Status

Main developer and moderation:

Patrik Bohlinger, Norwegian Meteorological Institute, [email protected]

Purpose

Package to aid the collocation of observations and wave model output as well as subsequent wave model validation. Observational sources can be satellite altimetry or in-situ data. A variety of open source alternatives is implemented.

Docs

For more information about the package as well as documentation please refer to the documentation.

Credits

When using wavy please give credit by citing: Bohlinger et al. 2019

wavy's People

Contributors

bohlinger avatar gauteh avatar konstantinchri avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

wavy's Issues

cci not accessible due to technical issues

ceda changed their password policy which resulted in an error when reading the password from .netrc using urllib. It seems that the new policy at ceda introduced special characters that need to be escaped.

Release workflow

Remove checkout action and remove the line referencing environment.yml. see the release section of metocean-api for an example.

Trouble with L2 download

L2 seems not to download anymore. The reason might be of external nature (e.g. at colhub), investigate!

Errors when running for fedjeosen: resturcture_xr branch

❯ python sat.py
# -----
 ### Initializing insitu_class object ###

 Given kwargs:
{'nID': 'fedjeosen', 'name': 'SFY', 'sd': '2023-07-01', 'ed': '2023-10-04 ', 'varalias': 'Hs'}
Chosen period: 2023-07-01 00:00:00 - 2023-10-04 00:00:00

 ### insitu_class object initialized ###
# -----
 ### Read files and populate insitu_class object
 ## Find and list files based on given path...
1 valid files found

Choosing reader..
#
Environmental variable for WAVY_DIR not defined
Defaults are chosen
#
Chosen reader: insitu_readers.get_nc_thredds_static_coords_single_file

Reading..
 Get filevarname for
stdvarname: sea_surface_wave_significant_height
varalias: Hs
 Variable defined in *_cfg.yaml is:
Hs = hm0
 Get filevarname for
stdvarname: longitude
varalias: lons
 !!! variable not defined nor available in nc-file !!!
 Get filevarname for
stdvarname: latitude
varalias: lats
 !!! variable not defined nor available in nc-file !!!
 Get filevarname for
stdvarname: time
varalias: time
 Variable defined in *_cfg.yaml is:
time = time
 Get filevarname for
stdvarname: sea_surface_wave_significant_height
varalias: Hs
 Variable defined in *_cfg.yaml is:
Hs = hm0
 Get filevarname for
stdvarname: time
varalias: time
 Variable defined in *_cfg.yaml is:
time = time
/home/gauteh/met/misc/wavy/wavy/insitu_module.py:351: UserWarning: rename 'time' to 'time' does not create an index anymore. Try using swap_dims instead or use set_index after rename to create an indexed coordinate.
  self.vars = self.vars.rename({ncvar: c})\
 Get filevarname for
stdvarname: longitude
varalias: lons
 !!! variable not defined nor available in nc-file !!!
ERROR:wavy.insitu_module:cannot rename None because it is not a variable or dimension in this dataset
Traceback (most recent call last):
  File "/home/gauteh/met/misc/wavy/wavy/insitu_module.py", line 351, in _change_varname_to_aliases
    self.vars = self.vars.rename({ncvar: c})\
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gauteh/.mconda3/envs/sfy/lib/python3.11/site-packages/xarray/core/dataset.py", line 3737, in rename
    return self._rename(name_dict=name_dict, **names)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gauteh/.mconda3/envs/sfy/lib/python3.11/site-packages/xarray/core/dataset.py", line 3678, in _rename
    raise ValueError(
ValueError: cannot rename None because it is not a variable or dimension in this dataset
 Get filevarname for
stdvarname: latitude
varalias: lats
 !!! variable not defined nor available in nc-file !!!
ERROR:wavy.insitu_module:cannot rename None because it is not a variable or dimension in this dataset
Traceback (most recent call last):
  File "/home/gauteh/met/misc/wavy/wavy/insitu_module.py", line 351, in _change_varname_to_aliases
    self.vars = self.vars.rename({ncvar: c})\
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gauteh/.mconda3/envs/sfy/lib/python3.11/site-packages/xarray/core/dataset.py", line 3737, in rename
    return self._rename(name_dict=name_dict, **names)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gauteh/.mconda3/envs/sfy/lib/python3.11/site-packages/xarray/core/dataset.py", line 3678, in _rename
    raise ValueError(
ValueError: cannot rename None because it is not a variable or dimension in this dataset

 ## Summary:
6487 values retrieved.
Time used for retrieving data:
4.94 seconds

 ### insitu_class object populated ###
# -----
# -----
 ### Initializing poi_class object ###

 Given kwargs:
{'nID': 'fedjeosen', 'name': 'SFY', 'varalias': 'Hs'}
Chosen period: 2023-07-01 00:21:08.772900 - 2023-10-03 22:58:22.457382

 ### insitu_class object initialized ###
# -----
# -----
 ### Initializing satellite_class object ###

 Given kwargs:
{'nID': 'cmems_L3_NRT', 'name': 's3a', 'sd': '2023-07-01', 'ed': '2023-10-04 ', 'region': 'fedjeosen'}

 ### satellite_class object initialized ###
# -----
# -----
 ### Initializing satellite_class object ###

 Given kwargs:
{'nID': 'cmems_L3_NRT', 'name': 's3b', 'sd': '2023-07-01', 'ed': '2023-10-04 ', 'region': 'fedjeosen'}

 ### satellite_class object initialized ###
# -----
# -----
 ### Initializing satellite_class object ###

 Given kwargs:
{'nID': 'cmems_L3_NRT', 'name': 'c2', 'sd': '2023-07-01', 'ed': '2023-10-04 ', 'region': 'fedjeosen'}

 ### satellite_class object initialized ###
# -----
# -----
 ### Initializing satellite_class object ###

 Given kwargs:
{'nID': 'cmems_L3_NRT', 'name': 'j3', 'sd': '2023-07-01', 'ed': '2023-10-04 ', 'region': 'fedjeosen'}

 ### satellite_class object initialized ###
# -----
# -----
 ### Initializing satellite_class object ###

 Given kwargs:
{'nID': 'cmems_L3_NRT', 'name': 'h2b', 'sd': '2023-07-01', 'ed': '2023-10-04 ', 'region': 'fedjeosen'}

 ### satellite_class object initialized ###
# -----
# -----
 ### Initializing satellite_class object ###

 Given kwargs:
{'nID': 'cmems_L3_NRT', 'name': 'cfo', 'sd': '2023-07-01', 'ed': '2023-10-04 ', 'region': 'fedjeosen'}

 ### satellite_class object initialized ###
# -----
# -----
 ### Initializing satellite_class object ###

 Given kwargs:
{'nID': 'cmems_L3_NRT', 'name': 'al', 'sd': '2023-07-01', 'ed': '2023-10-04 ', 'region': 'fedjeosen'}

 ### satellite_class object initialized ###
# -----
# -----
 ### Initializing satellite_class object ###

 Given kwargs:
{'nID': 'cmems_L3_NRT', 'name': 's6a', 'sd': '2023-07-01', 'ed': '2023-10-04 ', 'region': 'fedjeosen'}

 ### satellite_class object initialized ###
# -----
 ### Read files and populate satellite_class object
 ## Find and list files ...
path is None -> checking config file
Object is iterable
0 valid files found
source template: /home/patrikb/tmp_altimeter/L3/name/%Y/%m

Checking variables..
Traceback (most recent call last):
  File "/home/gauteh/met/papers/sfy-paper/data/2023-fedjeosen/sat.py", line 50, in <module>
    s3a = s3a.populate().crop_to_poi(poi=pco, distlim=100, twin=10)
          ^^^^^^^^^^^^^^
  File "/home/gauteh/met/misc/wavy/wavy/satellite_module.py", line 494, in populate
    self.meta = ncdumpMeta(self.pathlst[0])
                           ~~~~~~~~~~~~^^^
IndexError: list index out of range

where to place configuration files

When the wavy package is installed as a package you can assume that the wavy source root is no longer writable or practical to put files edited by the user in. I suggest the following approach so that you can have user-wide config, project-wide config and default-config:

  • check if there is an environment variable set (WAVY_CONFIG) for project-wide config, you could do this via .dot-env, but that would require you to be in the correct directory.
  • use xdg (https://pypi.org/project/xdg/) to look for user-wide config (will evaluate to ca. ~/.config/wavy on linux)
  • use pkg_resources to get default configs (as is done in wconfig.py now ca)

looking in the current directoy without any WAVY_CONFIG is most likely not a good idea for this project.

Include fireworks

Would be great to include fireworks from satellite SAR NRT. Obtainable variables would be:

sea_surface_wave_significant_height (SWH)
sea_surface_wave_period_at_variance_spectral_density_maximum (MWT)
sea_surface_wave_from_direction_at_variance_spectral_density_maximum (VMDR)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.