GithubHelp home page GithubHelp logo

Comments (16)

maucollu avatar maucollu commented on June 3, 2024 1

Well, you're more than welcome, but it is I that should thank you for the quick reaction!
I suppose the results are in meter per seconds, right?

from pytmd.

maucollu avatar maucollu commented on June 3, 2024 1

Ahhh, that's why...I was getting some pretty big numbers if they were in m/s...thanks a lot.

from pytmd.

tsutterley avatar tsutterley commented on June 3, 2024 1

This is all in the recently released v2.1.1. Thanks for your help on this!
-ts

from pytmd.

tsutterley avatar tsutterley commented on June 3, 2024

I believe that is for backwards compatibility for when TPXO9-atlas models had served the u and v currents in separate files (see #258). I only have access to the binary (OTIS) file type, so I don't know how the netCDF files are currently provided. I can edit the io.model class for TPXO9-atlas-v5 if each netCDF4 file provides both the zonal and meridional currents.

In the compute.tide_currents function, the binary OTIS file type only reads from the u part of the dictionary. So in the mean time, using the binary files should (hopefully) work fine.

from pytmd.

maucollu avatar maucollu commented on June 3, 2024

Many thanks, @tsutterley , for helping with this.
Unfortunately, I changed the setting to ATLAS_FORMAT='OTIS'. and it is still looking for the "v_*" types as well, more precisely in:
pyTMD\io\model.py:842 in current

I was trying to identify, in the code, where it actually reads the two components of the velocity, but got a bit lost ;).

Many thanks for the help with this.

Kind Regards

Maurizio

from pytmd.

tsutterley avatar tsutterley commented on June 3, 2024

you're right that is a problem. It's in the pathfinder function within the io.model class. There's a file check to make sure everything exists. I need to fix this.

from pytmd.

tsutterley avatar tsutterley commented on June 3, 2024

I'm working on this now. Can you verify for me that the TPXO9-atlas-v5 netCDF4 files have both components?

from pytmd.

maucollu avatar maucollu commented on June 3, 2024

I checked, and it seems so.
I quickly did a data = ncinfo('u_2n2_tpxo9_atlas_30_v5.nc') in MATLAB, and in data.Variables I can see:

  • uRe
  • uIm
  • vRe
  • vIm
    so I suppose these are the real and imaginary parts of the u and v velocities.
    I'm checking tha tthe same can be seen in python

from pytmd.

maucollu avatar maucollu commented on June 3, 2024

Yes, it seems so:
<class 'netCDF4._netCDF4.Dataset'> root group (NETCDF3_CLASSIC data model, file format NETCDF3): type: OTIS transport file title: TPXO9-ATLAS-v5 1/30 x 1/30 tidal SN and WE transports file dimensions(sizes): nx(10800), ny(5401), nct(4) variables(dimensions): |S1 con(nct), float64 lon_u(nx), float64 lat_u(ny), float64 lon_v(nx), float64 lat_v(ny), int32 uRe(nx, ny), int32 uIm(nx, ny), int32 vRe(nx, ny), int32 vIm(nx, ny)

from pytmd.

tsutterley avatar tsutterley commented on June 3, 2024

Perfect thanks! I'll get this in as part of a PR I started earlier and will put out a release today. Thanks for your help on this. I don't really work with the current files.
And, yes. Those are the real and imaginary parts of the current constituents.

from pytmd.

tsutterley avatar tsutterley commented on June 3, 2024

should be in cm/s

from pytmd.

maucollu avatar maucollu commented on June 3, 2024

Hi, apologies for the "noob" question - but would be 2.1.1 available through the install mode "conda install -c conda-forge pytmd", or do I need to do the git and then python setup.py install? I tried both, but i do not seem to be able to use the new version....

For context, this is what I tried (on top of the git clone + setup):
`conda update pyTMD
Channels:
Note: you may need to restart the kernel to use updated packages.

  • conda-forge
  • scikit-learn
  • bioconda
  • nrel
  • defaults
    Platform: win-64
    Collecting package metadata (repodata.json): ...working... done
    Solving environment: ...working... done

All requested packages already installed.

conda install -c conda-forge pytmd=2.1.1
Channels:

  • conda-forge
  • scikit-learn
  • bioconda
  • nrel
  • defaults
    Platform: win-64
    Collecting package metadata (repodata.json): ...working... done
    Solving environment: ...working... failed

Note: you may need to restart the kernel to use updated packages.

PackagesNotFoundError: The following packages are not available from current channels:

  • pytmd=2.1.1*

Current channels:

To search for alternate channels that may provide the conda package you're
looking for, navigate to

https://anaconda.org

and use the search bar at the top of the page.`

from pytmd.

tsutterley avatar tsutterley commented on June 3, 2024

I think you should be able to do either (depending on your current installation):
conda update pyTMD
or
pip install --upgrade pyTMD
as both of the providers (conda-forge and pypi) are up-to-date with v2.1.1.

from pytmd.

maucollu avatar maucollu commented on June 3, 2024

Which version of python is necessary?

from pytmd.

tsutterley avatar tsutterley commented on June 3, 2024

We test against Python 3.11 and I currently run Python 3.12. But on my old machine I was running an earlier version of python3. I think I have included the imports necessary for earlier versions to work (from 3.6+).

from pytmd.

maucollu avatar maucollu commented on June 3, 2024

It works! Many thanks.

from pytmd.

Related Issues (20)

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.