|
4 | 4 |
|
5 | 5 | General information about eddies storage. |
6 | 6 |
|
7 | | -All eddies files have same structure with more or less field and a way of ordering. |
| 7 | +All files have the same structure, with more or less fields and possible different order. |
8 | 8 |
|
9 | 9 | There are 3 class of files: |
10 | 10 |
|
11 | | -- Eddies collections which contains a list of eddies without link between observations |
12 | | -- Track eddies collections which manage eddies when there are merged in trajectory |
13 | | - (track field allow to separate each track) |
14 | | -- Network eddies collections which manage eddies when there are merged in network |
15 | | - (track/segment field allow to separate observations) |
| 11 | +- **Eddies collections** : contain a list of eddies without link between them |
| 12 | +- **Track eddies collections** : manage eddies associated in trajectories, the ```track``` field allows to separate each trajectory |
| 13 | +- **Network eddies collections** : manage eddies associated in networks, the ```track``` and ```segment``` fields allow to separate observations |
16 | 14 | """ |
17 | 15 |
|
18 | 16 | import py_eddy_tracker_sample |
|
23 | 21 | from py_eddy_tracker.observations.tracking import TrackEddiesObservations |
24 | 22 |
|
25 | 23 | # %% |
26 | | -# Eddies could be store in 2 formats with same structures: |
| 24 | +# Eddies can be stored in 2 formats with the same structure: |
27 | 25 | # |
28 | 26 | # - zarr (https://zarr.readthedocs.io/en/stable/), which allow efficiency in IO,... |
29 | 27 | # - NetCDF4 (https://unidata.github.io/netcdf4-python/), well-known format |
|
32 | 30 | # array field like contour/profile are 2D column. |
33 | 31 |
|
34 | 32 | # %% |
35 | | -# Eddies files (zarr or netcdf) could be loaded with `load_file` method: |
| 33 | +# Eddies files (zarr or netcdf) could be loaded with ```load_file``` method: |
36 | 34 | eddies_collections = EddiesObservations.load_file(get_path("Cyclonic_20160515.nc")) |
37 | 35 | eddies_collections.field_table() |
38 | 36 | # offset and scale_factor are used only when data is stored in zarr or netCDF4 |
39 | 37 |
|
40 | 38 | # %% |
41 | 39 | # Field access |
42 | 40 | # ------------ |
| 41 | +# To access the total field, here ```amplitude``` |
43 | 42 | eddies_collections.amplitude |
44 | 43 |
|
| 44 | +# To access only a specific part of the field |
| 45 | +eddies_collections.amplitude[4:15] |
| 46 | + |
45 | 47 | # %% |
46 | 48 | # Data matrix is a numpy ndarray |
47 | 49 | eddies_collections.obs |
|
52 | 54 | # %% |
53 | 55 | # Contour storage |
54 | 56 | # --------------- |
55 | | -# Contour are stored to fixed size for all, contour are resample with an algorithm before to be store in object |
56 | | - |
| 57 | +# All contours are stored on the same number of points, and are resampled if needed with an algorithm to be stored as objects |
57 | 58 |
|
58 | 59 | # %% |
59 | | -# Tracks |
60 | | -# ------ |
61 | | -# Tracks add several field like: |
| 60 | +# Trajectories |
| 61 | +# ------------ |
| 62 | +# Tracks eddies collections add several fields : |
62 | 63 | # |
63 | | -# - track : ID which allow to identify path |
64 | | -# - observation_flag : True if it's an observation to filled a missing detection |
65 | | -# - observation_number : Age of eddies |
66 | | -# - cost_association : result of cost function which allow to associate the observation with eddy path |
| 64 | +# - **track** : Trajectory number |
| 65 | +# - **observation_flag** : Flag indicating if the value is interpolated between two observations or not (0: observed eddy, 1: interpolated eddy)" |
| 66 | +# - **observation_number** : Eddy temporal index in a trajectory, days starting at the eddy first detection |
| 67 | +# - **cost_association** : result of the cost function to associate the eddy with the next observation |
67 | 68 | eddies_tracks = TrackEddiesObservations.load_file( |
68 | 69 | py_eddy_tracker_sample.get_path("eddies_med_adt_allsat_dt2018/Cyclonic.zarr") |
69 | 70 | ) |
70 | | -# In this example some field are removed like effective_contour_longitude, ... in order to save time for doc building |
| 71 | +# In this example some fields are removed (effective_contour_longitude,...) in order to save time for doc building |
71 | 72 | eddies_tracks.field_table() |
72 | 73 |
|
73 | 74 | # %% |
74 | | -# Network |
75 | | -# ------- |
76 | | -# Network files use some specific field: |
| 75 | +# Networks |
| 76 | +# -------- |
| 77 | +# Network files use some specific fields : |
77 | 78 | # |
78 | | -# - track : ID of network (ID 0 are for lonely eddies/trash) |
79 | | -# - segment : ID of path in network (from 0 to N) |
80 | | -# - previous_obs : Index of the previous observation in the full dataset, if -1 there are no previous observation |
81 | | -# - next_obs : Index of the next observation in the full dataset, if -1 there are no next observation |
82 | | -# - previous_cost : Result of cost_function (1 good <> 0 bad) with previous observation |
83 | | -# - next_cost : Result of cost_function (1 good <> 0 bad) with next observation |
| 79 | +# - track : ID of network (ID 0 correspond to lonely eddies) |
| 80 | +# - segment : ID of a segment within a network (from 1 to N) |
| 81 | +# - previous_obs : Index of the previous observation in the full dataset, if -1 there are no previous observation (the segment starts) |
| 82 | +# - next_obs : Index of the next observation in the full dataset, if -1 there are no next observation (the segment ends) |
| 83 | +# - previous_cost : Result of the cost function (1 is a good association, 0 is bad) with previous observation |
| 84 | +# - next_cost : Result of the cost function (1 is a good association, 0 is bad) with next observation |
84 | 85 | eddies_network = NetworkObservations.load_file( |
85 | 86 | get_remote_sample( |
86 | 87 | "eddies_med_adt_allsat_dt2018_err70_filt500_order1/Anticyclonic_network.nc" |
|
103 | 104 | ] |
104 | 105 | ] |
105 | 106 | ) |
| 107 | + |
| 108 | +# %% |
| 109 | +# Networks are ordered by increasing network number (`track`), then increasing segment number, then increasing time |
| 110 | + |
0 commit comments