Trouble with particle times and variable extraction #1363
Replies: 3 comments 9 replies
-
Thanks for reporting, @amargolskee. It could be that the calendar isn't parsed well when you create the fieldset, do you get any warnings about that? And what if you print |
Beta Was this translation helpful? Give feedback.
-
Thanks for getting back to me. The fieldset.U.grid.time_full and fieldset.U.grid.time dates appear identical. Both are in units of seconds (0... 432000... up to 432000*511) and seemingly correspond to the amount of time since "2012-12-01" as in the netcdf file. Should these instead have been converted to datetime somewhere? |
Beta Was this translation helpful? Give feedback.
-
I see. I didn't prepare these files myself: I am using B-SOSE output. The fielsdet.U.grid.time_origin is 2013-01-05T00:00:00.000000000 My python is a little shaky. Is there a quick fix I can use to convert the fieldset.U.grid.time* fields? |
Beta Was this translation helpful? Give feedback.
-
Thanks in advance to anyone who helps with this.
I'm having an issue with reading variables in at specific particle times. I want to evaluate variables for each particle at their initial seeding location at the their initial seeding time. I tried to follow one of the tutorials to do that.
First I read in x,y,z,t particle locations from a csv file. The times for particle seeding iterate from 1 to 67 in intervals of 6. I've checked that the fieldset time (set as fieldset.U.grid.time) produces particle times that are (0...2592000...51840360... and so on), as I expected.
However, when I run my code, I get this error:
2013-02-04 is definitely well within the runtime for the netcdf file that I'm reading from, so I'm very confused by this error. There are 511 5-day timesteps in the file. Here's a snippet of the netcdf structure. I would have thought that 2013-02-04 should just be 35 days into the model output. Is it necessary to set allow_time_extrapolation to True in this case? And if so, why?
It seems to run if I comment out the pset.execute() calls that have dt=0.. but it would be great to be able to get the initial variable reads to work at each particle's initial location.
Here is the full file I'm using, in case that's helpful.
Beta Was this translation helpful? Give feedback.
All reactions