Skip to content

Commit

Permalink
Merge branch 'release/1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Cesare Rossi committed Feb 18, 2015
2 parents c4d436e + bbfb226 commit 7c87872
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 22 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Cloud processing with Envisat ASAR data and ROI_PAC

<a href="http://dx.doi.org/10.5281/zenodo.10015"><img src="https://zenodo.org/badge/doi/10.5281/zenodo.10015.png"></a>

This repository contains the application files and scripts to process a pair of Envisat ASAR data with [ROI_PAC](http://www.openchannelfoundation.org/projects/ROI_PAC) (Repeat Orbit Interferometry PACkage), a software package jointly created by the Jet Propulsion Laboratory division of NASA and CalTech for processing SAR data to create InSAR (Interferometric synthetic aperture radar) images, or 'interferograms'. This geodetic method uses two or more synthetic aperture radar (SAR) scenes to generate maps of surface deformation or digital elevation models, using differences in the phase of the waves returning to the radar sensor. The technique can potentially measure centimetre-scale changes in deformation over spans of days to years. It has applications for geophysical monitoring of natural hazards, for example earthquakes, volcanoes and landslides, and in structural engineering, in particular monitoring of subsidence and structural stability.
This repository contains the application files and scripts to process a pair (Master and Slave) of Envisat ASAR data with [ROI_PAC](http://www.openchannelfoundation.org/projects/ROI_PAC) (Repeat Orbit Interferometry PACkage), a software package jointly created by the Jet Propulsion Laboratory division of NASA and CalTech for processing SAR data to create InSAR (Interferometric synthetic aperture radar) images, or 'interferograms'. This geodetic method uses two or more synthetic aperture radar (SAR) scenes to generate maps of surface deformation or digital elevation models, using differences in the phase of the waves returning to the radar sensor. The technique can potentially measure centimetre-scale changes in deformation over spans of days to years. It has applications for geophysical monitoring of natural hazards, for example earthquakes, volcanoes and landslides, and in structural engineering, in particular monitoring of subsidence and structural stability.

### Getting Started

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<packaging>rpm</packaging>
<name>InSAR-ROI_PAC</name>
<description>InSAR-ROI_PAC</description>
<version>1.0</version>
<version>1.1</version>

<scm>
<connection>scm:git:[email protected]:Terradue/InSAR-ROI_PAC.git</connection>
Expand Down
11 changes: 7 additions & 4 deletions src/main/app-resources/application.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<streamingExecutable>/application/aux/run.sh</streamingExecutable>
<defaultParameters>
<parameter id="aux_catalogue">http://catalogue.terradue.int/catalogue/search</parameter>
<parameter id="slave" title="ASAR Slave product catalogue entry" abstract="Define the Slave ASAR product. The product is passed by references to catalogue entries"/>
</defaultParameters>
<defaultJobconf>
<property id="ciop.job.max.tasks">1</property>
Expand Down Expand Up @@ -34,19 +35,21 @@
</defaultJobconf>
</jobTemplate>
</jobTemplates>
<workflow id="roi_pac" title="ROI_PAC on a sandbox" abstract="This application invokes ROI_PAC on Envisat ASAR data">
<workflow id="roi_pac" title="Repeat Orbit Interferometry Package (ROI_PAC)" abstract="Data processing software allowing researchers in the area of topography and surface displacements studies to apply Interferometric Synthetic Aperture Radar (InSAR) methods.">
<workflowVersion>1.0</workflowVersion>
<node id="node_aux">
<job id="aux" />
<sources>
<source scope="runtime" id="Level0_ref" title="ASAR product catalogue entry in RDF format" abstract="Define the list of two ASAR products to generate a DEM for each input product. The products are passed by references to catalogue entries in RDF format" refid="string:list">http://catalogue.terradue.int/catalogue/search/ASA_IM__0P/ASA_IM__0CNPDE20100502_175016_000000172089_00084_42723_0354.N1/rdf,http://catalogue.terradue.int/catalogue/search/ASA_IM__0P/ASA_IM__0CNPDE20100328_175019_000000162088_00084_42222_9504.N1/rdf</source>
<source scope="runtime" id="Level0_ref" title="ASAR Master product catalogue entry" abstract="Define the Master ASAR product. The product is passed by references to catalogue entries " refid="string:list">http://catalogue.terradue.int/catalogue/search/ASA_IM__0P/ASA_IM__0CNPDE20100502_175016_000000172089_00084_42723_0354.N1/rdf</source>
</sources>
<parameters />
<parameters>
<parameter id="slave" scope="runtime">http://catalogue.terradue.int/catalogue/search/ASA_IM__0P/ASA_IM__0CNPDE20100328_175019_000000162088_00084_42222_9504.N1/rdf</parameter>
</parameters>
</node>
<node id="node_dem">
<job id="dem" />
<sources>
<source id="Level0_ref" title="ASAR master product catalogue entry in RDF format" abstract="ASAR slave product passed by reference to catalogue entries in RDF format" refid="string:list" scope="runtime">http://catalogue.terradue.int/catalogue/search/ASA_IM__0P/ASA_IM__0CNPDE20100328_175019_000000162088_00084_42222_9504.N1/rdf</source>
<source id="Level0_ref" title="ASAR master product catalogue entry in RDF format" abstract="ASAR slave product passed by reference to catalogue entries in RDF format" refid="string:list" scope="runtime">http://catalogue.terradue.int/catalogue/search/ASA_IM__0P/ASA_IM__0CNPDE20100502_175016_000000172089_00084_42723_0354.N1/rdf</source>
</sources>
<parameters />
</node>
Expand Down
32 changes: 23 additions & 9 deletions src/main/app-resources/aux/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,24 @@ trap cleanExit EXIT
# get the catalogue access point
cat_osd_root="`ciop-getparam aux_catalogue`"


function getAUXref() {
local rdf=$1
local ods=$2
ciop-log "INFO" "rdf is $rdf"
ciop-log "INFO" "ods is $ods"
startdate="`ciop-casmeta -f "ical:dtstart" $rdf | tr -d "Z"`"
stopdate="`ciop-casmeta -f "ical:dtend" $rdf | tr -d "Z"`"
ciop-log "INFO" "ods is $ods"
startdate=`opensearch-client $rdf startdate | tr -d "Z"`
[ -z "$startdate" ] && exit $ERR_NOSTARTDATE
stopdate=`opensearch-client $rdf enddate | tr -d "Z"`
[ -z "$stopdate" ] && exit $ERR_NOSTOPDATE
ciop-log "INFO" "startdate is $startdate"
ciop-log "INFO" "stopdate is $stopdate"
ciop-log "INFO" "opensearch-client -f Rdf -p time:start=$startdate -p time:end=$stopdate $ods"

opensearch-client -f Rdf -p "time:start=$startdate" -p "time:end=$stopdate" $ods
}



while read input
do
ciop-log "INFO" "dealing with $input"
function runAux() {
input=$1

for aux in ASA_CON_AX ASA_INS_AX ASA_XCA_AX ASA_XCH_AX
do
Expand All @@ -70,4 +69,19 @@ do

# pass the SAR reference to the next node
echo "sar=$input" | ciop-publish -s
}

#main
while read master
do
ciop-log "INFO" "Master: $master"
slave="`ciop-getparam slave`"
ciop-log "INFO" "Slave: $slave"
runAux $master
resMaster=$?
[ "$resMaster" -ne 0 ] && exit $resMaster
runAux $slave
resSlave=$?
exit $resSlave
done

19 changes: 12 additions & 7 deletions src/main/app-resources/roipac/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ done

# retrieve the DEM
mkdir -p $TMPDIR/workdir/dem
wps_result="$( ciop-browseresults -r ${CIOP_WF_RUN_ID} -j node_dem -w | tr -d '\r' | tr -d '\n')"
ciop-log "DEBUG" "dem wps results is ${wps_result}z"
wps_result="$( ciop-browseresults -r ${CIOP_WF_RUN_ID} -j node_dem -w | tr -d '\r' | tr '\n' ';')"
ciop-log "DEBUG" "dem wps results 1 is ${wps_result}"
wps_result=`echo $wps_result | cut -d ";" -f 1`
ciop-log "DEBUG" "dem wps results is ${wps_result}"

# extract the result URL
curl -L -o $TMPDIR/workdir/dem/dem.tgz "${wps_result}" 2> /dev/null
Expand All @@ -97,23 +99,26 @@ roipac_proc=$TMPDIR/workdir/roi_pac.proc

for input in `cat $TMPDIR/input | grep 'sar='`
do
sar_url=`echo $input | cut -d "=" -f 2`
#sar_url=`echo $input | cut -d "=" -f 2`

sar_url=`echo $input | sed "s/^sar=//"`

# get the date in format YYMMDD
sar_date=`ciop-casmeta -f "ical:dtstart" $sar_url | cut -c 3-10 | tr -d "-"`
sar_date=`opensearch-client $sar_url startdate | cut -c 3-10 | tr -d "-"`
sar_date_short=`echo $sar_date | cut -c 1-4`

ciop-log "DEBUG" "SAR input ${sar_url}"
ciop-log "INFO" "SAR date: $sar_date and $sar_date_short"

# get the dataset identifier
sar_identifier=`ciop-casmeta -f "dc:identifier" $sar_url`
sar_identifier=`opensearch-client $sar_url identifier`
ciop-log "INFO" "SAR identifier: $sar_identifier"

sar_folder=$TMPDIR/workdir/$sar_date
mkdir -p $sar_folder

# get ASAR products
sar_url=`opensearch-client $sar_url enclosure`
sar="`ciop-copy -o $sar_folder $sar_url`"

cd $sar_folder
Expand Down Expand Up @@ -184,7 +189,7 @@ process_2pass.pl $roipac_proc 1>&2
cd int_${intdir}

ciop-log "INFO" "Geocoding the wrapped interferogram"
cpx2rmg.pl filt_${intdir}-sim_HDR_4rlks.int filt_${intdir}-sim_HDR_4rlks.int.hgt
cpx2rmg filt_${intdir}-sim_HDR_4rlks.int filt_${intdir}-sim_HDR_4rlks.int.hgt
geocode.pl geomap_4rlks.trans filt_${intdir}-sim_HDR_4rlks.int.hgt geo_${intdir}.int

ciop-log "INFO" "Creating geotif files for interferogram phase and magnitude"
Expand Down Expand Up @@ -233,6 +238,6 @@ ciop-publish -m $TMPDIR/workdir/int_${intdir}/$intdir.int
ciop-publish -m $TMPDIR/workdir/int_${intdir}/$intdir.int.rsc


#rm -fr $UUIDTMP
rm -fr $UUIDTMP

ciop-log "INFO" "That's all folks"

0 comments on commit 7c87872

Please sign in to comment.