-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ADD: Auto Read Function #205
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #205 +/- ##
==========================================
+ Coverage 92.84% 92.97% +0.12%
==========================================
Files 26 27 +1
Lines 5004 5079 +75
==========================================
+ Hits 4646 4722 +76
+ Misses 358 357 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
@syedhamidali Checking if a file can be opened with one of our backends and return the dataset/datatree is indeed a nice idea and a useful feature. Thanks for tackling this to make xradar more user-friendly. For the implementation we might think about using the We would have to implement such function for our backends first, but this would be a great opportunity to do this finally. In the long run we should think about implementing @openradar/xradar More thoughts here? |
@kmuehlbauer That’s a great idea, especially in terms of aligning with the xarray model. I do have a few questions, though. What would you typically open as a dataset—would it be a single sweep? In our case, we often work with datatree as the file structure. I was thinking of implementing something like open_datatree and I’ve done something similar with the imd_data model in radarx. You can check out an example at radarx-rtd. Moving forward, the read_imd function will be integrated into the xradar package, and the radarx package itself will be contributed to the openradar community. I’ve been focusing on radarx primarily for visualization (both traditional and interactive) and potentially some microphysics retrievals, and I’d be happy to contribute these efforts. |
@syedhamidali Thanks for sharing your efforts here. Great to hear that the IMD backend will find it's way into I like the idea behind |
@kmuehlbauer Sorry for the late response, as I am currently at the AMS SLS conference. radarx will indeed act as a companion to xradar, addressing most of the features mentioned in that comment. However, I’m also considering adding additional functionality such as retrieving DSDs and performing thermodynamic calculations like the evaporative cooling rate etc. For this, we would need temperature profiles, which could be sourced from ERA5 data or nearby soundings. |
history.md
Description: Enhanced Radar File Reading Functionality with Timeout Support
Summary:
This PR introduces the
auto_read.py
module, which provides an enhancedread
function designed to improve the radar file reading process in thexradar
library. Theread
function iterates over all available file-opening functions withinxradar.io
to attempt to read radar files, with added support for georeferencing and verbose output. A key feature of this function is its ability to handle timeouts, ensuring that long-running file reads do not block execution indefinitely.Key Features:
read
function attempts to open the provided radar file using all availableopen_
functions in thexradar.io
module, automatically selecting the correct file format.timeout
parameter. If specified, the file read operation is wrapped in a timeout handler, raising aTimeoutException
if the read operation exceeds the allowed time.georeference
parameter is set toTrue
.verbose
option is available to print detailed processing information, aiding in debugging and providing insights into which file-opening method was successful.ValueError
if the file cannot be opened by any supported format, providing clear feedback in cases of unsupported file types or corrupted files.Usage:
Other tests