OpenSenseAction / poligrain

Simplify common tasks for working with point, line and gridded sensor data, focusing on rainfall observations.
https://poligrain.readthedocs.io
BSD 3-Clause "New" or "Revised" License
2 stars 10 forks source link

define names and structure of module files #9

Open cchwala opened 5 months ago

cchwala commented 5 months ago

Here is a first draft of a potential structure and naming of the Python module files (as well as very preliminary function names inside the modules) in src/poligrain:

validation.py
|── describe_dataset() <-- print some statistics, maybe also plot some statistics, e.g. count of gaps etc 
|── evaluate_vs_reference() <-- do aggregation, apply rain-rate-threshold, calculate metrics, do standard scatter or hexbin plot
|── separate_rainevents()
|── correlation_with_neighbors() <-- this should use the functions from spatial.py to find the nearest neighbors

vis.py or maybe visualization.py
|── plot_cml_paths()
|── plot_sml_paths()
|── plot_line_collection() <-- this can be used by the two functions above
|── plot_dataset() <-- infers geometry (point, line or grid) from dataset and plots on map (using functions from above or standard matplotlib)
|── hexbin() <-- using plt.hexbin but with nice defaults, can be used in validation.py
|── get_cmap() <-- return a matplotlib colormap with some meaningful defaults for rain rates and rainfall sums

spatial.py
|── find_closest_points_to_line()
|── find_closest_lines_to_line()
|── get_line_grid_intersections()
|── get_line_grid_intersection_timeseries()
|── SensorAtGrid() <-- absract base class similar to RawAtObs from wradlib, but more generic so that it can also handle line-grid
|── LineAtGrid() <-- subclass of base class above, doing grid intersection (can also be provided as arg or be cached in object) and extraction of path-averages 
|── PointAtGrid() <-- subclass of base class above

io.py
|── load_example_cml_data()
|── load_example_sml_data()
|── load_example_pws_data()
|── load_example_radar_data()
|── ...note sure how we load and store the different reference datasets for different CML, PWS and SML example data from different regions...
|── download_example_notebooks <-- download all our notebooks which will not be in a pip installed package
|── download_OS_datasets() <-- to be discussed what this should cover
cchwala commented 5 months ago

Maybe all things related to fixed example datasets (where no transformation etc. is reguqired) could live in a module called datasets.py (scipy does it like that)