Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaoEcohydroRS authored Jun 7, 2021
1 parent c02aeb4 commit b4d019f
Showing 1 changed file with 32 additions and 37 deletions.
69 changes: 32 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,60 +29,55 @@ B) Supervised Classification
# Data


# How to start
# How to start and Requirements
1) Download PolSARpro v6.0 (Biomass Edition) Software:
We have tried to download and install the Linux version of PolSARpro (https://github.com/EO-College/polsarpro) in UNC longleaf HPC, however, this HPC does not support this software.

So We turn to download Windows 64 bits Version follow the instruction as this website: https://ietr-lab.univ-rennes1.fr/polsarpro-bio/
After installed the PolSARpro v6.0, we tested it with manully running a test by extracting and decompositing a PolSAR data.

2) Batch mode:
Since we are performing analysis on four different flightlines and each flightline has 4-5 observations, it will be fast to have a batch mode. Thus, we developed a python script use 'subprocess' function to Exclude exe Program, which is the similar idea as how PolSARpro v6.0 windows version tcl GUI works.

```
#uavsar_convert_MLC
#-hf input annotation file
#-mem Allocated memory for blocksize determination(in Mb)
try:
ExcludeProgram=softDir+'data_import\\'+'uavsar_convert_MLC.exe'
subprocess.call(ExcludeProgram + " -hf \"" + Parameter_hf + \
"\" -if1 \"" + Parameter_if1 + \
"\" -if2 \"" + Parameter_if2 + \
"\" -if3 \"" + Parameter_if3 + \
"\" -if4 \"" + Parameter_if4 + \
"\" -if5 \"" + Parameter_if5 + \
"\" -if6 \"" + Parameter_if6 + \
"\" -od \"" + Parameter_od_T3 + \
"\" -odf T3 -inr "+str(grd_rows)+" -inc "+str(grd_cols)+\
" -ofr 0 -ofc 0 -fnr "+str(grd_rows)+" -fnc "+str(grd_cols)+\
" -nlr 1 -nlc 1 -ssr 1 -ssc 1 -mem 4000 -errf \""+ Parameter_errf+"\"")
except subprocess.CalledProcessError as e:
raise RuntimeError("uavsar_convert_MLC command '{}' "+\
"return with error (code {}): {}".format(e.cmd, e.returncode, e.output))
2) Batch mode with Python:
Find the right version for your setup of Anaconda3 platform for running python scripts. In this study, we used Spyder IDE.
Since we are performing analysis on four different flightlines and each flightline has 4-5 observations, it will be fast to have a batch mode. Thus, we developed a python script use 'subprocess' function to Exclude Exe Program, which is the similar idea as how PolSARpro v6.0 windows version tcl GUI works.

```For instance, extract UAVSAR data as T3 matrix: Select Polarimetric Matrix Generation
#uavsar_convert_MLC
#-hf input annotation file
#-mem Allocated memory for blocksize determination(in Mb)
try:
ExcludeProgram=softDir+'data_import\\'+'uavsar_convert_MLC.exe'
subprocess.call(ExcludeProgram + " -hf \"" + Parameter_hf + \
"\" -if1 \"" + Parameter_if1 + \
"\" -if2 \"" + Parameter_if2 + \
"\" -if3 \"" + Parameter_if3 + \
"\" -if4 \"" + Parameter_if4 + \
"\" -if5 \"" + Parameter_if5 + \
"\" -if6 \"" + Parameter_if6 + \
"\" -od \"" + Parameter_od_T3 + \
"\" -odf T3 -inr "+str(grd_rows)+" -inc "+str(grd_cols)+\
" -ofr 0 -ofc 0 -fnr "+str(grd_rows)+" -fnc "+str(grd_cols)+\
" -nlr 1 -nlc 1 -ssr 1 -ssc 1 -mem 4000 -errf \""+ Parameter_errf+"\"")
except subprocess.CalledProcessError as e:
raise RuntimeError("uavsar_convert_MLC command '{}' "+\
"return with error (code {}): {}".format(e.cmd, e.returncode, e.output))
```
# Requirements



Find the right version for your setup of Anaconda3 platform for running python scripts. In this study, we used Spyder IDE. In addition, for this pipeline to work you will need to have a GEE configured python installation ready to go.

## Installation
## Other Python Packages Installation
Check the file of 'requirements.txt'. For install GEE python API, please check 'GEE Python Instructions'.

# GEE Python Instructions

In addition, for this pipeline to work you will need to have a GEE configured python installation ready to go.
Explaining exactly how to do this is beyond the scope of this package but Google provides detailed installation instructions [here](https://developers.google.com/earth-engine/python_install).


## Usage
The main interface is the script named 'MainFunction.py'.

Step1:
Local processing:
1)
1) 'ExtractPolarimetricSAR_1.py'
2) 'ConvertHH_HV_VV2Geotiff_1.py'
3) 'PolarimetricDecomposition_1.py'

```javascript
// Store in a variable (see below).

```
Step2:
Upload input metrics raster files (here, we used Cloud Optimized GeoTIFF, please see detailed at https://www.cogeo.org/), because we processed lots of raster data so that we prefer to use Google Cloud Storage(GCS, https://developers.google.com/earth-engine/Earth_Engine_asset_from_cloud_geotiff?hl=en).
Of course, you can upload to GEE assets instead of GCS.
Expand Down

0 comments on commit b4d019f

Please sign in to comment.