Open zssherman opened 3 months ago
@zssherman Great initiative! It looks like MPL is also some binary format with neat header structures.
The sigmet/iris reader heavily uses these kind of structured decoding. This is also what #158 is trying to achieve for nexrad level2.
Maybe we can discuss on next open radar meeting which steps are necessary to get a prototype reader ready.
@kmuehlbauer That sounds good to me!
@zssherman Since there wasn't much time yesterday I'll follow up with some ideas/pointers here.
I'm not really sure how to handle the sidecar files, but we might just search/recognize them and directly read/decode as binary blobs (when without header).
For the main file the idea would be to use np.memmap
for easy reading large data. See
Then the header could be directly extracted using the machinery from the iris/sigmet reader:
For this the header structure needs some special layout, where decoding information can be attached into the OrderedDict
:
The actual data might be read with dedicated functions (eg names like get_data
or similar), which uses header information about file offset, size and dtype. See the following for a (not so nice example):
This get_data
function is used in the ArrayWrapper to retrieve the data in a lazy manner, whereas header data is used to provide the information to create the DataArrays/Dataset.
This is then used in the XarrayStore to provide Variables/Coordinates
I hope this does at least make some sense and you could give it a try.
After the ACT dev call, we discussed on how moving the MPL reader to xradar would be more fitting: https://github.com/ARM-DOE/ACT/issues/806
I can give this a shot. I will just need to learn the backends of Xarray first.