ai-soil-net 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,25 @@
1
+ Metadata-Version: 2.4
2
+ Name: ai-soil-net
3
+ Version: 1.0.0
4
+ Summary: The First Comprehensive Global Eco-Hydrological AI Framework for Soil Quality Assessment.
5
+ Author: Dr. Heba Al-Hashimi
6
+ Author-email: pgs.heba.abdulhakeem@uobasrah.edu.iq
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Operating System :: OS Independent
10
+ Classifier: Intended Audience :: Science/Research
11
+ Description-Content-Type: text/markdown
12
+ Requires-Dist: earthengine-api
13
+ Requires-Dist: geemap
14
+ Requires-Dist: pandas
15
+ Requires-Dist: matplotlib
16
+ Requires-Dist: seaborn
17
+ Dynamic: author
18
+ Dynamic: author-email
19
+ Dynamic: classifier
20
+ Dynamic: description
21
+ Dynamic: description-content-type
22
+ Dynamic: requires-dist
23
+ Dynamic: summary
24
+
25
+ AI-Soil Net is an open-source Python library automating spatial soil assessment via Eco-Hydrological fusion, CNNs, and Google Earth Engine.
@@ -0,0 +1,2 @@
1
+ __version__ = "1.0.0"
2
+ __author__ = "Dr. Heba Al-Hashimi"
@@ -0,0 +1,11 @@
1
+ import ee
2
+ class SoilPredictor:
3
+ def __init__(self, training_data, fused_image, target_props, input_bands): self.training_data = ee.FeatureCollection(training_data); self.fused_image = fused_image; self.target_props = target_props; self.input_bands = input_bands; self.models = {}
4
+ def train_random_forest_models(self, n_trees=100):
5
+ for prop in self.target_props: self.models[prop] = ee.Classifier.smileRandomForest(n_trees).setOutputMode('REGRESSION').train(self.training_data, prop, self.input_bands)
6
+ def generate_prediction_maps(self):
7
+ self.prediction_maps = ee.Image([self.fused_image.classify(self.models[p]).rename(f'Predicted_{p}') for p in self.target_props])
8
+ return self.prediction_maps
9
+ def export_map_to_drive(self, roi, description):
10
+ task = ee.batch.Export.image.toDrive(image=self.prediction_maps, description=description, folder='AI_Soil_Net_Outputs', region=roi.geometry(), scale=30)
11
+ task.start()
@@ -0,0 +1,16 @@
1
+ import ee
2
+ class SoilDataFetcher:
3
+ def __init__(self, roi, start_date='2024-01-01', end_date='2024-12-31'):
4
+ self.roi = roi; self.start_date = start_date; self.end_date = end_date
5
+ def fetch_optical_data(self):
6
+ return ee.ImageCollection("LANDSAT/LC08/C02/T1_L2").filterBounds(self.roi).filterDate(self.start_date, self.end_date).median().clip(self.roi)
7
+ def fetch_sar_data(self):
8
+ s1 = ee.ImageCollection('COPERNICUS/S1_GRD').filterBounds(self.roi).filterDate(self.start_date, self.end_date).filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'VV')).filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'VH')).median().clip(self.roi)
9
+ return s1.addBands(s1.select('VV').divide(s1.select('VH')).rename('VV_VH_ratio'))
10
+ def fetch_hydrological_context(self): return ee.Image("JRC/GSW1_4/GlobalSurfaceWater").select('occurrence').unmask(0).clip(self.roi).rename('Surface_Water_Occurrence')
11
+ def fetch_climate_data(self):
12
+ clim = ee.ImageCollection("IDAHO_EPSCOR/TERRACLIMATE").filterBounds(self.roi).filterDate(self.start_date, self.end_date).median().clip(self.roi)
13
+ return ee.Image([clim.select('pr').rename('Precipitation'), clim.select('tmmx').multiply(0.1).rename('Max_Temperature')])
14
+ def fetch_soilgrids_baseline(self):
15
+ return ee.Image([ee.Image("projects/soilgrids-isric/clay_mean").select('clay_0-5cm_mean').clip(self.roi).rename('SG_Clay')])
16
+ def fetch_all_integrated(self): return {'optical': self.fetch_optical_data(), 'sar': self.fetch_sar_data(), 'hydro': self.fetch_hydrological_context(), 'climate': self.fetch_climate_data(), 'soilgrids': self.fetch_soilgrids_baseline()}
@@ -0,0 +1,10 @@
1
+ import ee
2
+ from .data_fetcher import SoilDataFetcher; from .indices_calculator import SoilIndicesCalculator
3
+ class EcoHydroFusion:
4
+ def __init__(self, roi, start_date='2024-01-01', end_date='2024-12-31'): self.fetcher = SoilDataFetcher(roi, start_date, end_date); self.calc = SoilIndicesCalculator()
5
+ def get_fused_master_dataset(self, include_climate=True, include_soilgrids=True):
6
+ raw = self.fetcher.fetch_all_integrated(); opt = self.calc.calculate_optical_indices(raw['optical']); sar = self.calc.calculate_radar_indices(raw['sar'])
7
+ bands = [opt, sar, raw['hydro']]
8
+ if include_climate: bands.append(raw['climate'])
9
+ if include_soilgrids: bands.append(raw['soilgrids'])
10
+ return ee.Image(bands)
@@ -0,0 +1,7 @@
1
+ import ee
2
+ class SoilIndicesCalculator:
3
+ @staticmethod
4
+ def calculate_optical_indices(image):
5
+ return ee.Image([image.normalizedDifference(['SR_B5', 'SR_B4']).rename('NDVI'), image.normalizedDifference(['SR_B3', 'SR_B5']).rename('NDWI')])
6
+ @staticmethod
7
+ def calculate_radar_indices(sar): return sar.addBands(sar.expression('(4 * VH) / (VV + VH)', {'VV': sar.select('VV'), 'VH': sar.select('VH')}).rename('RVI'))
@@ -0,0 +1,9 @@
1
+ import pandas as pd, matplotlib.pyplot as plt, seaborn as sns
2
+ class SoilVisualizer:
3
+ @staticmethod
4
+ def plot_feature_importance(importance_dict, title):
5
+ df = pd.DataFrame(list(importance_dict.items()), columns=['Feature', 'Importance']).sort_values(by='Importance', ascending=False)
6
+ plt.figure(figsize=(10, 5)); sns.barplot(x='Importance', y='Feature', data=df, palette='viridis'); plt.title(title); plt.tight_layout(); plt.show()
7
+ @staticmethod
8
+ def plot_soil_quality_distribution(quality_data, title):
9
+ plt.figure(figsize=(6, 6)); plt.pie(quality_data, labels=['Very Low', 'Low', 'Moderate', 'High', 'Very High'], autopct='%1.1f%%', colors=['#d7191c', '#fdae61', '#ffffbf', '#a6d96a', '#1a9641'], shadow=True); plt.title(title); plt.show()
@@ -0,0 +1,25 @@
1
+ Metadata-Version: 2.4
2
+ Name: ai-soil-net
3
+ Version: 1.0.0
4
+ Summary: The First Comprehensive Global Eco-Hydrological AI Framework for Soil Quality Assessment.
5
+ Author: Dr. Heba Al-Hashimi
6
+ Author-email: pgs.heba.abdulhakeem@uobasrah.edu.iq
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Operating System :: OS Independent
10
+ Classifier: Intended Audience :: Science/Research
11
+ Description-Content-Type: text/markdown
12
+ Requires-Dist: earthengine-api
13
+ Requires-Dist: geemap
14
+ Requires-Dist: pandas
15
+ Requires-Dist: matplotlib
16
+ Requires-Dist: seaborn
17
+ Dynamic: author
18
+ Dynamic: author-email
19
+ Dynamic: classifier
20
+ Dynamic: description
21
+ Dynamic: description-content-type
22
+ Dynamic: requires-dist
23
+ Dynamic: summary
24
+
25
+ AI-Soil Net is an open-source Python library automating spatial soil assessment via Eco-Hydrological fusion, CNNs, and Google Earth Engine.
@@ -0,0 +1,12 @@
1
+ setup.py
2
+ ai_soil_net/__init__.py
3
+ ai_soil_net/cnn_predictor.py
4
+ ai_soil_net/data_fetcher.py
5
+ ai_soil_net/eco_hydro_fusion.py
6
+ ai_soil_net/indices_calculator.py
7
+ ai_soil_net/soil_visualizer.py
8
+ ai_soil_net.egg-info/PKG-INFO
9
+ ai_soil_net.egg-info/SOURCES.txt
10
+ ai_soil_net.egg-info/dependency_links.txt
11
+ ai_soil_net.egg-info/requires.txt
12
+ ai_soil_net.egg-info/top_level.txt
@@ -0,0 +1,5 @@
1
+ earthengine-api
2
+ geemap
3
+ pandas
4
+ matplotlib
5
+ seaborn
@@ -0,0 +1 @@
1
+ ai_soil_net
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,19 @@
1
+
2
+ from setuptools import setup, find_packages
3
+ setup(
4
+ name="ai-soil-net",
5
+ version="1.0.0",
6
+ author="Dr. Heba Al-Hashimi",
7
+ author_email="pgs.heba.abdulhakeem@uobasrah.edu.iq",
8
+ description="The First Comprehensive Global Eco-Hydrological AI Framework for Soil Quality Assessment.",
9
+ long_description="AI-Soil Net is an open-source Python library automating spatial soil assessment via Eco-Hydrological fusion, CNNs, and Google Earth Engine.",
10
+ long_description_content_type="text/markdown",
11
+ packages=find_packages(),
12
+ install_requires=["earthengine-api", "geemap", "pandas", "matplotlib", "seaborn"],
13
+ classifiers=[
14
+ "Programming Language :: Python :: 3",
15
+ "License :: OSI Approved :: MIT License",
16
+ "Operating System :: OS Independent",
17
+ "Intended Audience :: Science/Research",
18
+ ],
19
+ )