traj: add trajectories method to iterate over trajectories (rather than groupby which expects unique traj ids)#188
Conversation
| polygon = Polygon([(lon[0], lat[0]), (lon[1], lat[1]), (lon[2], lat[2]), (lon[3], lat[3])]) | ||
| lon = [ | ||
| lons[i, j], lons[i, j + 1], lons[i + 1, j + 1], lons[i + 1, j] | ||
| ] |
There was a problem hiding this comment.
Veit ikkje om eg heilt likar denne automatiske lintinga :-)
There was a problem hiding this comment.
Nei.. det kan du sei, hadde nok valgt annleis sjølv, men det er betre å halde seg til auto-formatering og standardane.. ellers vil ein ikkje kunne bruke det automatisk og konsistent andre stadar i fila uten at det alltid blir oppdatert.
| warnings.simplefilter("ignore", category=DeprecationWarning) | ||
| azimuth_forward, a2, distance = geod.inv(lonfrom, latfrom, lonto, latto) | ||
| azimuth_forward, a2, distance = geod.inv(lonfrom, latfrom, lonto, | ||
| latto) |
There was a problem hiding this comment.
ikkje akkurat meir lesbart....
There was a problem hiding this comment.
Ikkje so veldig mykje mindre heller, og då held ein seg innafor linjelengda. lange linjer er vanskeligare å lese. Men ja, eg meiner det heilt klart er betre å halde seg til automatisk standard slik at ein berre kan køyre gjennom eit konsistent verktøy og det blir null sjarm og forskjellige preferansar :)
| >>> import lzma | ||
| >>> b = lzma.open('examples/barents.nc.xz') | ||
| >>> ds = xr.open_dataset(b) | ||
| >>> p = ds.traj.trajectories().map(lambda t: t.mean('obs')) |
There was a problem hiding this comment.
is this different from p = ds.traj.mean(dim='obs') ?
There was a problem hiding this comment.
no.. not the best example, couldn't think of a better one right now.
…an groupby which expects unique traj ids)
303c992 to
fa906b3
Compare
No description provided.