@@ -48,6 +48,7 @@ given criterias
4848
4949``` {code-cell}
5050from fcollections.implementations import NetcdfFilesDatabaseSwotLRL2
51+
5152fc = NetcdfFilesDatabaseSwotLRL2(path)
5253fc.list_files(cycle_number=1)
5354```
@@ -83,6 +84,8 @@ ds = fc.query(selected_variables=['ssha'])
8384list(ds.variables)
8485```
8586
87+ ### Filter types
88+
8689Each implementation has its own filters. By order of availability, the user
8790should consult:
8891
@@ -95,23 +98,42 @@ should consult:
9598fc.query?
9699```
97100
101+ ### Filter values
102+
103+ Possible values for a given filter can be displayed
104+
105+ ``` {code-cell}
106+ fc.filter_values('version')
107+ ```
108+
109+ Only filters whose information are contained in the intermediated folders can be
110+ scanned in a quick way, other will trigger a full scan. As such, to ensure
111+ optimal performance, this method should be called with the layouts enabled, with
112+ files organized with folders (see the [ advanced section] ( #disable-layouts ) ), and
113+ on filters whose information is encoded in the folders.
114+
98115## Access metadata
99116
100117The database can display information about the variables and attributes
101118contained in the files' collection using the `` variables_info `` method
102119
103120``` {code-cell}
104- fc.variables_info(subset='Expert')
121+ # Use the enumeration name for filtering a specific subset
122+ fc.variables_info()
105123```
106124
107125It will offer a simple collapsible tree view with multiple levels of nesting
108126depending on the data you manipulate
109127
110- In order to return consistent metadata, the method ensures that only one
111- homogeneous subset is selected. In case you handle unmixable data (for example
112- Expert and Unsmoothed datasets), you must give proper filters on the subset
113- partitioning keys `` fc.unmixer.partition_keys `` . If these filters are missing,
114- an error with the possible choices will be raised.
128+ ## Subsets
129+
130+ ### Errors on mixed subsets
131+
132+ In order to return consistent results, most methods must work on an homogeneous
133+ subset of data. In case multiple subsets are mixed (for example Expert and
134+ Unsmoothed datasets), proper filters matching the partitioning keys must be
135+ given. If these filters are missing, an error with the possible choices will be
136+ raised.
115137
116138``` {code-cell}
117139:tags: [raises-exception]
@@ -123,7 +145,32 @@ ds.to_netcdf(f'{path}/SWOT_L2_LR_SSH_Unsmoothed_001_012_20240101T030000_20240101
123145fc.variables_info()
124146```
125147
148+ ### Compatibility matrix
149+
150+ The following table summarizes which methods can work on mixed data. Most
151+ methods need homogeneous data and will require filtering the subset.
152+
153+ | Method | Works on mixed data ? |
154+ | --------------------| -----------------------|
155+ | `` list_files `` | Yes |
156+ | `` variables_info `` | No |
157+ | `` filter_values `` | No |
158+ | `` query `` | No |
159+ | `` map `` | No |
160+
161+ ### Listing subsets
162+
163+ Subsets that are on the file system can be listed using the
164+ {meth}` subsets <fcollections.core.FilesDatabase.subsets> ` property.
165+
166+ ``` {code-cell}
167+ fc.subsets
168+ ```
169+
170+ One of the returned choices must be selected and used as a filter to work on an
171+ homogeneous dataset.
172+
126173``` {code-cell}
127- # Use the enumeration name for filtering
174+ # Use the enumeration name for filtering a specific subset
128175fc.variables_info(subset='Expert')
129176```
0 commit comments