Skip to content

Conversation

@dicaearchus
Copy link
Contributor

As shown in the tutorial it is possible to assign date information via the timestamp keyword. However, if a single instance is given, this gave errors. Hence the following adjustments resolve this issue.

Example code snippet:

depth = Field.from_netcdf([f"{elev_dir}/bodem-zunov4.nc"], 'Z',
                          {'lat': 'lat', 'lon': 'lon'},
                          interp_method=interp, time_periodic=True,
                          timestamps=[np.datetime64("2020-01-01")])
depth.name = 'Z'
fieldset.add_field(depth)

Bas Altena added 4 commits January 12, 2024 11:32
fixed import with single timestamp
added test with timestamp as well
make it PEP-8 compliant
@erikvansebille erikvansebille merged commit 9d5c2e4 into Parcels-code:master Jan 15, 2024
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.

2 participants