![]() ![]() ![]() support the -1 inside a "meas_map/mie_map_of_l1b_meas_used/which_l2b_wind_id" and have this split into a.allow the C library to support ranged reads as in "foo/bar/bla" this requires that we construct complete data trees within the C domain and then translate that to Python, which would require a huge change to the C library.removing the option to provide -1 as parameter.If we want to make things consistent as you request then as far as I can see it, this can only be done in three ways, and none of them are preferable in my opinion: It is just a function that provides some wrapping around all of this to make it a bit easier. In other words, coda.fetch() is not doing things any more efficiently than you can do yourself with cursors. ![]() a coda.fetch(fh) will read the whole product and a coda.fetch(fh, "mph") will read the whole MPH). Whatever position the cursor points to at the end of the list of parameters is read recursively into a python structure (e.g. when you pass -1 as parameter then coda.fetch() will internally just use a python for-loop in which a CODA cursor is run over all elements (and the results as combined into single array).it is translated to a coda.cursor_goto_array_element_by_index(cursor, index) if it is a non-negative number.it is translated to a coda.cursor_goto(cursor, path) if it is a string (which can only navigate to a single position, so it doesn't support ranges).If you have specific cases that you want assistance with (in terms of how to best optimise it) then let us know by sending an email to important thing to remember is that each parameter passed to coda.fetch() is handled as follows: The aux_met_12.py example that is online provides a nice showcase of this. With CODA cursors you can still relatively efficiently get the data out of the product. This means that multidimensional array slicing, which is a common approach for hdf/netcdf, is just intrinsically not feasible for products such as the AEOLUS products. hdf/netcdf files in that they combine fields from the same measurement close together instead of combining all instances of a single field close together. There exists partial-read functionality of arrays within the CODA C library, but this is limited to offset+length range specification and only works on arrays of scalars.Įspecially if you are running into performance problems, knowing about the lower level CODA Python functions and how CODA cursors work will be rather important.Īlso be aware that the AEOLUS products are internally structured very differently from e.g. The coda.fetch() is actually a Python function that internally constructs a CODA cursor and then navigates through the product to read the elements that are requested. This functionality is implemented purely in Python (but also in the IDL and MATLAB interfaces of CODA). The C interface itself does not support the -1 style operation to group individually read values into a single target array. ![]() The important thing to consider here is that we are dealing with a python wrapping of a C interface. '' would give you array elements with index values 5 up to, but not including 10. I would suggest to implement a mechanism similar to the slice known in python. Especially for large files getting the full array can take a very long time, and calling coda fetch inside a nested for loop to extract a partial 2D array, can take even longer. coda only allows extracting a single number or the full array. I would suggest to also allow the special value ':' in the python interface to extract the full array. This value in python usually gives you the last item of an array or list.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |