Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jul fe netcdf #576

Merged
merged 16 commits into from
May 15, 2021
Merged

Jul fe netcdf #576

merged 16 commits into from
May 15, 2021

Conversation

Boorhin
Copy link
Contributor

@Boorhin Boorhin commented Apr 8, 2021

Just some typos wrong time axis dimension and
use of CRS (Coordinate Reference system) instead of SRS

@knutfrode
Copy link
Collaborator

The failing tests are not due to your commit, but an issue with Xhistogram/Dask: xgcm/xhistogram#27
This should be circumvented by pinning of versions in 9bbc60b, but perhaps some CircleCI caching prevents this to happen.

Anyway, you probably want to add more to this PR before merging should be considered.

@knutfrode knutfrode requested a review from gauteh April 8, 2021 10:49
Mainly n the Selafin file reader
@gauteh
Copy link
Member

gauteh commented Apr 10, 2021

Thanks for the PR. Do you have the chance to either include a small telemac file or somehow make it available online? Then it will be easier to write unit-tests for the new reader and the converter scripts. What extra dependencies are required for the telemac-converter? This script should probably go in the scripts dir, but maybe this can be made part of the reader if it does not take too long to run.

I understand this is still in draft-mode, is there anything in particular you would like feedback on now? I can try to skim through the code the coming week, it would be helpful to have the original and converted files to test with in that case.

@Boorhin
Copy link
Contributor Author

Boorhin commented Apr 11, 2021 via email

@gauteh
Copy link
Member

gauteh commented Apr 14, 2021 via email

from os import path, environ, sep
from scipy.spatial import cKDTree
#Activating PYTEL
dir = environ['HOMETEL']+'{}scripts{}python3'.format(sep,sep)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using environment variable (HOMETEL) is not a good solution for all users, can this be solved another way to work out of the box?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable comes straight from Telemac configuration I don't really know how to improve that.
Or we have to request to duplicate their code

#Activating PYTEL
dir = environ['HOMETEL']+'{}scripts{}python3'.format(sep,sep)
sys.path.append(path.join( path.dirname(sys.argv[0]),dir))#pytel path use environment variables
from data_manip.formats.selafin import Selafin
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this line can be added to environment.yml under the pip section for automatic installation of this package:
git://github.com/CNR-Engineering/PyTelTools.git#egg=pyteltools

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure pyteltools is actually developed by the Telemac team. It is unclear if the two projects are linked. I can ask

@@ -6,11 +6,11 @@
'y_wind': {'valid_min': -50, 'valid_max': 50, 'units': 'm/s',
'long_name': 'Component of wind along y-direction (northwards if '
'projection is lonlat/Mercator)'},
'x_sea_water_velocity': {'valid_min': -10, 'valid_max': 10,
'x_sea_water_velocity': {'valid_min': -20, 'valid_max': 20,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is in the meantime changed also in master, so should be removed from this PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok not too sure how to do that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tried to restore the original state with checkout -- Tell me if it looks better

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that the two unused file were deleted, which is good. There is one conflict due to the valid_min/max-limits, but I believe this can be resolved in the browser as seen below (but probably this has to be done by yourself?).

Then we also need to find a solution for installation without users needing to set environment variables. But it could be that this environment variable is not needed anyway(?)

Eventually we would also like to have a unit-test for this reader, though then one would need a stable thredds server with an available dataset. However, in the meantime, a placeholder test could be made to simply check that it works well to import this reader and the selafin-tool.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok I don't really know how to discard my version.
regarding the environmental variables they are needed in Telemac to run the python scripts and other things. It would not run without it.
For the test I have something from Telemac itself but since it has no coordinate and I wasn't sure about how to setup proj4 in that case, I gave up

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done it I think

@knutfrode
Copy link
Collaborator

This PR does not interfere with anything else, so perhaps we can just merge this now, and eventually try later to make the installation automatic.

But you'd might like to insert your name as author in the the reader, after a common header as in other readers/files:
https://github.com/OpenDrift/opendrift/blob/master/opendrift/readers/reader_netCDF_CF_generic.py#L1

@coveralls
Copy link

coveralls commented May 13, 2021

Coverage Status

Coverage decreased (-0.7%) to 56.863% when pulling f1e1946 on Boorhin:jul_FE_netcdf into 9aa126f on OpenDrift:master.

julien added 2 commits May 15, 2021 13:12
added a scipy version test for query arguments (python >=3.8)
added header
@knutfrode
Copy link
Collaborator

Then I can merge this one now, if ok by you?

@Boorhin
Copy link
Contributor Author

Boorhin commented May 15, 2021

I think it looks workable for now?
At least it seems to do what is needed on my computer

@knutfrode knutfrode merged commit e94b618 into OpenDrift:master May 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants