|
1 | 1 | # Geoscience-Data-Quality-for-Machine-Learning |
2 | 2 |
|
| 3 | +A Python package for assessing geoscience data quality for machine learning. |
| 4 | + |
3 | 5 | A problem exists when building broad scale models, for example, Australia. |
| 6 | +Disparate datasets from many domains need to be assessed for quality before |
| 7 | +being combined into machine learning pipelines. This package provides tools |
| 8 | +to quantify and map data quality across geoscience datasets. |
| 9 | + |
| 10 | +## Installation |
| 11 | + |
| 12 | +```bash |
| 13 | +pip install -e . |
| 14 | +``` |
| 15 | + |
| 16 | +With optional dependencies: |
| 17 | + |
| 18 | +```bash |
| 19 | +# For Excel file support |
| 20 | +pip install -e ".[excel]" |
| 21 | + |
| 22 | +# For gravity point-density analysis (verde, xarray, pooch) |
| 23 | +pip install -e ".[gravity]" |
| 24 | + |
| 25 | +# For visualization (matplotlib) |
| 26 | +pip install -e ".[viz]" |
| 27 | + |
| 28 | +# Everything |
| 29 | +pip install -e ".[all]" |
| 30 | + |
| 31 | +# Development (includes tests) |
| 32 | +pip install -e ".[dev]" |
| 33 | +``` |
| 34 | + |
| 35 | +## Package Modules |
| 36 | + |
| 37 | +### `geoscience_data_quality.quality_model` |
| 38 | +Quality scoring model for geoscience datasets. Load quality models from |
| 39 | +CSV/Excel, compute resolution scores, final quality scores, and filter |
| 40 | +by domain or sub-domain. |
| 41 | + |
| 42 | +```python |
| 43 | +from geoscience_data_quality import load_quality_model, compute_final_score, compute_resolution_score |
| 44 | + |
| 45 | +model = load_quality_model("DataQuality_Models.csv") |
| 46 | +res_score = compute_resolution_score(90.0) # finer resolution → higher score |
| 47 | +final = compute_final_score(score=3, presence=1.0, resolution_score=res_score) |
| 48 | +``` |
4 | 49 |
|
5 | | -## Disparate datasets, breaking them down into broad domains: |
| 50 | +### `geoscience_data_quality.vector` |
| 51 | +Analyze quality fields (confidence, observation method, positional accuracy, |
| 52 | +metadata) in geological vector datasets. |
| 53 | + |
| 54 | +```python |
| 55 | +from geoscience_data_quality import analyze_quality_fields, get_quality_summary |
| 56 | + |
| 57 | +results = analyze_quality_fields(geology_gdf, fields=["confidence", "obsmethod"]) |
| 58 | +summary = get_quality_summary(geology_gdf) |
| 59 | +``` |
| 60 | + |
| 61 | +### `geoscience_data_quality.survey` |
| 62 | +Fetch, filter, and fix geophysical survey metadata from WFS services such |
| 63 | +as Geoscience Australia's GADDS. |
| 64 | + |
| 65 | +```python |
| 66 | +from geoscience_data_quality import fetch_ga_survey_metadata, filter_surveys, fix_survey_geometry |
| 67 | + |
| 68 | +surveys = fetch_ga_survey_metadata() |
| 69 | +mag_line = filter_surveys(surveys, measure_type="magnetic", dataset_type="line") |
| 70 | +gdf = fix_survey_geometry(mag_line, swap_coordinates=True) |
| 71 | +``` |
| 72 | + |
| 73 | +### `geoscience_data_quality.rasterize` |
| 74 | +Rasterize vector quality attributes onto reference grids or new grids |
| 75 | +defined by bounds and resolution. |
| 76 | + |
| 77 | +```python |
| 78 | +from geoscience_data_quality import rasterize_vector_attribute |
| 79 | + |
| 80 | +array = rasterize_vector_attribute( |
| 81 | + gdf, column="max_line_spacing_m", |
| 82 | + reference_raster="model_raster.tif", |
| 83 | + output_path="survey_quality.tif", |
| 84 | + sort_ascending=False, # smallest (best) value wins in overlaps |
| 85 | +) |
| 86 | +``` |
| 87 | + |
| 88 | +### `geoscience_data_quality.point_density` |
| 89 | +Compute observation point density for datasets like gravity stations |
| 90 | +(requires the `gravity` optional dependencies). |
| 91 | + |
| 92 | +```python |
| 93 | +from geoscience_data_quality.point_density import compute_point_density |
| 94 | + |
| 95 | +coords, counts = compute_point_density((longitude, latitude), spacing=0.1) |
| 96 | +``` |
| 97 | + |
| 98 | +## Disparate datasets, breaking them down into broad domains |
6 | 99 |
|
7 | 100 | - Geophysics (Gravity, Magnetics, Radiometrics, Seismic, Electromagnetic, Induced Polarisation, Magnetotelluric...) |
8 | 101 | - Geology (Lithology, Stratigraphy, Structure, Hydro..) |
9 | 102 | - Remote Sensing (Landsat, ASTER, Sentinel...) |
10 | 103 | - Geochemistry (Rock, Soil, Water, Assay techniques...) |
11 | 104 |
|
12 | | -## Variety of data layers: |
| 105 | +## Variety of data layers |
13 | 106 |
|
14 | 107 | - Direct observations |
15 | 108 | - Gridded Data |
@@ -57,8 +150,9 @@ How, thinking in a raster fashion, to get a combined per-pixel Data Quality rati |
57 | 150 | - Simple qualitative (3/2/1, Good/Average/Bad, High/Medium/Low or other ordinals). |
58 | 151 | - Exists / Missing |
59 | 152 |
|
60 | | - # Reference |
61 | | - - [https://www.researchgate.net/profile/Alan_Aitken/publication/326193704/figure/fig1/AS:646297606443016@1531100765653/](https://www.researchgate.net/publication/326193704_A_role_for_data_richness_mapping_in_exploration_decision_making) |
| 153 | +## Reference |
| 154 | + |
| 155 | +- [A role for data richness mapping in exploration decision making (Aitken et al)](https://www.researchgate.net/publication/326193704_A_role_for_data_richness_mapping_in_exploration_decision_making) |
62 | 156 |
|
63 | 157 |  |
64 | 158 |
|
|
0 commit comments