Skip to content
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

autoRIFT-ISCE3 workflow for Sentinel-1 processing #288

Draft
wants to merge 19 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The HyP3-autoRIFT plugin provides a set of workflows for feature tracking proces
1. Ensure that conda is installed on your system (we recommend using [mambaforge](https://github.com/conda-forge/miniforge#mambaforge) to reduce setup times).
2. Clone the `hyp3-autorift` repository and navigate to the root directory of this project
```bash
git clone https://github.com/ASFHyP3/hyp3-autorift.git
git clone https://github.com/mfangaritav/hyp3-autorift.git
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jhkennedy githhub path points to Mario's private repo

cd hyp3-autorift
```
3. Create and activate your Python environment
Expand All @@ -19,9 +19,24 @@ The HyP3-autoRIFT plugin provides a set of workflows for feature tracking proces
mamba env create -f environment.yml
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

environment.yml needs to change the name of "build" package to "python-build" for the environment to build successfully

mamba activate hyp3-autorift
```
4. Finally, install a development version of HyP3 autoRIFT
4. Install a development version of HyP3 autoRIFT
```bash
python -m pip install -e .
cd ..
```
5. Clone the `COMPASS` repository and navigate to the root directory of this project and install it.
```bash
git clone https://github.com/mfangaritav/COMPASS.git
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jhkennedy are we going to use Mario's forked COMPASS github repo from this point on?

cd COMPASS
python -m pip install -e .
cd ..
```
6. Clone the `autoRIFT` repository and navigate to the root directory of this project and install it.
```bash
git clone https://github.com/mfangaritav/autoRIFT.git
cd autoRIFT
python setup.py install
cd ..
```

## Usage
Expand Down Expand Up @@ -52,11 +67,11 @@ For example:

```
hyp3_autorift \
"S2B_MSIL1C_20200612T150759_N0209_R025_T22WEB_20200612T184700" \
"S2A_MSIL1C_20200627T150921_N0209_R025_T22WEB_20200627T170912"
"S1_105606_IW1_20230612T025537_VV_3F09-BURST" \
"S1_105606_IW1_20230624T025538_VV_8279-BURST"
```

This command will run autorift for a pair of Sentinel-2 images.
This command will run autorift for a pair of Sentinel-1 bursts.

> [!IMPORTANT]
> Credentials are necessary to access Landsat and Sentinel-1 data. See the Credentials section for more information.
Expand Down
40 changes: 30 additions & 10 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,58 @@
name: hyp3-autorift
name: hyp3-autorift-radar
channels:
- hyp3
# - hyp3
- conda-forge
- nodefaults
dependencies:
- boto3
- botocore
- python>=3.9,<3.10 # Top pin to fix ISCE2 incompatibility: https://github.com/isce-framework/isce2/issues/458
- python>=3.9
- pip
# For packaging, and testing
- build
- flake8
- flake8-import-order
- flake8-blind-except
- flake8-builtins
- pillow
- pillow>=7.0
- pluggy
- pytest
- pytest-console-scripts
- pytest-cov
- pytest-order
- responses
- setuptools>=61
- setuptools_scm>=6.2
# For running
- eigen
- gdal>=3
- h5netcdf
- h5py>=3.5
- hyp3lib>=3,<4
- isce2=2.6.1.dev7
- autorift=1.5.0
- isce3>=0.14
- opencv
- boto3
- matplotlib-base
- netCDF4
- numpy<1.24 # https://github.com/isce-framework/isce2/pull/639
- pyproj
- requests
- scipy
- numpy>=1.20,<2.0
- pyproj>=3.3
- pysolid>=0.3
- ruamel.yaml>=0.15
- scipy>=1.0,<1.13
- yamale>=4.0
- requests>=2.0
- s1reader=0.2.2
- shapely>=2
- scikit-image
- xarray
- packaging>=21.0
- lxml>=4.8
- tifffile>=2024.0.0
- asf_search
- dateparser!=1.1.0
- dem_stitcher
- burst2safe #get the develop version so it doesn't look for iw2
- pandas>=1.4
- progressbar
- rasterio
- gxx_linux-64>=9,<10
38 changes: 38 additions & 0 deletions environment_isce2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: hyp3-autorift
channels:
- hyp3
- conda-forge
- nodefaults
dependencies:
- boto3
- botocore
- python>=3.9,<3.10 # Top pin to fix ISCE2 incompatibility: https://github.com/isce-framework/isce2/issues/458
- pip
# For packaging, and testing
- build
- flake8
- flake8-import-order
- flake8-blind-except
- flake8-builtins
- pillow
- pytest
- pytest-console-scripts
- pytest-cov
- responses
- setuptools>=61
- setuptools_scm>=6.2
# For running
- gdal>=3
- h5netcdf
- hyp3lib>=3,<4
- isce2=2.6.1.dev7
- autorift=1.5.0
- opencv
- boto3
- matplotlib-base
- netCDF4
- numpy<1.24 # https://github.com/isce-framework/isce2/pull/639
- pyproj
- requests
- scipy
- xarray
12 changes: 9 additions & 3 deletions src/hyp3_autorift/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ def least_precise_orbit_of(orbits):


def get_datetime(scene_name):
if 'BURST' in scene_name:
return datetime.strptime(scene_name[14:29], '%Y%m%dT%H%M%S')
if scene_name.startswith('S1'):
return datetime.strptime(scene_name[17:32], '%Y%m%dT%H%M%S')
if scene_name.startswith('S2') and len(scene_name) > 25: # ESA
Expand All @@ -194,6 +196,8 @@ def get_datetime(scene_name):


def get_platform(scene: str) -> str:
if 'BURST' in scene:
return 'GS1'
if scene.startswith('S1') or scene.startswith('S2'):
return scene[0:2]
elif scene.startswith('L') and scene[3] in ('4', '5', '7', '8', '9'):
Expand Down Expand Up @@ -359,9 +363,11 @@ def process(
platform = get_platform(reference)

if platform == 'S1':
from hyp3_autorift.s1_isce2 import process_sentinel1_with_isce2
netcdf_file = process_sentinel1_with_isce2(reference, secondary, parameter_file)

from hyp3_autorift.s1_isce3 import process_sentinel1_with_isce3_slc
netcdf_file = process_sentinel1_with_isce3_slc(reference, secondary)
elif platform == 'GS1':
from hyp3_autorift.s1_isce3 import process_burst_sentinel1_with_isce3_radar
netcdf_file = process_burst_sentinel1_with_isce3_radar(reference, secondary)
else:
# Set config and env for new CXX threads in Geogrid/autoRIFT
gdal.SetConfigOption('GDAL_DISABLE_READDIR_ON_OPEN', 'EMPTY_DIR')
Expand Down
Loading
Loading