A Python tool for fetching and analyzing Synthetic Aperture Radar (SAR) data from Copernicus Sentinel-1. This tool allows for data acquisition based on coordinates, processing the imagery, and applying signal processing techniques to detect subsurface anomalies.
-
Fetch SAR data from Copernicus Open Access Hub or Copernicus Data Space Ecosystem
-
Define areas of interest using geographic coordinates
-
Download and process SAR imagery
-
Apply preprocessing techniques including speckle filtering
-
Detect potential subsurface features using edge detection and morphological operations
-
Visualize results with original data, processed data, and detected features
export KEYCLOAK_TOKEN=$(curl -s -X POST -H "Content-Type: application/x-www-form-urlencoded" \
--data 'client_id=<client_id>' \
--data 'client_secret=<client_secret>' \
--data 'grant_type=client_credentials' \
'https://identity.dataspace.copernicus.eu/auth/realms/CDSE/protocol/openid-connect/token' | jq -r .access_token)You can use setup.py
python setup.py installor
pip install -r requirements.txt- Python 3.7+
- pip (Python package installer)
- Clone this repository:
git clone https://github.com/yourusername/sentinel-sar-analysis.git
cd sentinel-sar-analysis-
Set up a virtual environment (recommended):
Using venv (Python's built-in virtual environment):
# Create a virtual environment python3 -m venv .venv # Activate the virtual environment # On macOS/Linux: source .venv/bin/activate # On Windows: # .venv\Scripts\activate
Using conda (if you prefer Anaconda/Miniconda):
# Create a conda environment conda create -n sentinel-env python=3.9 # Activate the conda environment conda activate sentinel-env
-
Install the required dependencies:
pip install -r requirements.txt
-
Set up environment variables (optional):
Create a
.envfile in the project root directory with your Copernicus credentials:CLIENT_ID=your_copernicus_client_id CLIENT_SECRET=your_copernicus_client_secret API_URL=https://catalogue.dataspace.copernicus.eu/api/hubThis step is optional but recommended if you plan to use the example script.
- Run the script:
python sentinel_sar_analysis.py- Enter your Copernicus Open Access Hub credentials when prompted
- Specify the area of interest by entering coordinates (or use the default Giza, Egypt coordinates)
- Enter the date range for SAR data acquisition
- The script will download and analyze the data, then display and save the results
The default coordinates are set to the Giza Plateau in Egypt, which is known for its archaeological significance. The script will search for SAR data in this area and analyze it to detect potential subsurface features.
- You need a registered account at the Copernicus Open Access Hub
- The script downloads SAR data which can be large files (several GB)
- Processing SAR data is computationally intensive and may take time depending on your hardware
- The results are saved in a 'data' directory created in the current working directory