Skip to content

Commit

Permalink
add back first interferogram pipeline
Browse files Browse the repository at this point in the history
add back first interferogram pipeline

changes for better browse data and geotiffs

import glob

fix mdx path comment

how did this change

restore unw_xml

better browse files back to normal

syntax issues

fix migration issues

do nothing to phsig

creation of these not needed
  • Loading branch information
shitong01 committed Nov 28, 2020
1 parent 266db85 commit 33ae9ec
Show file tree
Hide file tree
Showing 4 changed files with 437 additions and 20 deletions.
112 changes: 112 additions & 0 deletions docker/hysds-io.json.sciflo-s1-ifg
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
"label" : "Sentinel-1 Interferogram Product",
"recommended-queues" : [ "grfn-job_worker-large" ],
"allowed_accounts": [ "ops" ],
"params" : [
{
"name": "dataset_tag",
"from": "submitter",
"type": "text",
"default": "standard",
"placeholder": "A value to append to the dataset identifier"
},
{
"name": "project",
"from": "submitter",
"type": "enum",
"default": "grfn",
"enumerables": ["aria", "grfn", "mem", "urgent-response", "dwr", "chevron", "floodmap"]
},
{
"name": "singlesceneOnly",
"from": "submitter",
"type": "boolean",
"default": "true"
},
{
"name": "preReferencePairDirection",
"from": "submitter",
"type": "enum",
"default": "backward",
"enumerables": ["backward", "forward", "both", "none"]
},
{
"name": "postReferencePairDirection",
"from": "submitter",
"type": "enum",
"default": "none",
"enumerables": ["backward", "forward", "both", "none"]
},
{
"name": "temporalBaseline",
"from": "submitter",
"type": "number",
"lambda": "lambda x: int(x)",
"default": "24"
},
{
"name": "minMatch",
"from": "submitter",
"type": "number",
"lambda": "lambda x: int(x)",
"default": "2"
},
{
"name": "covth",
"from": "submitter",
"type": "number",
"default": "0.95"
},
{
"name": "auto_bbox",
"from": "value",
"type": "boolean",
"value": "true"
},
{
"name": "precise_orbit_only",
"from": "submitter",
"type": "boolean",
"default": "false"
},
{
"name": "azimuth_looks",
"from": "submitter",
"type": "number",
"lambda": "lambda x: int(x)",
"default": "11"
},
{
"name": "range_looks",
"from": "submitter",
"type": "number",
"lambda": "lambda x: int(x)",
"default": "33"
},
{
"name": "filter_strength",
"from": "submitter",
"type": "number",
"default": "0.5"
},
{
"name": "dem_type",
"from": "submitter",
"type": "enum",
"default": "SRTM+v3",
"enumerables": ["SRTM+v3", "NED1", "NED13", "NED13-downsampled"]
},
{
"name": "query",
"from": "passthrough"
},
{
"name": "name",
"from": "passthrough"
},
{
"name": "username",
"from": "passthrough"
}
]
}
91 changes: 91 additions & 0 deletions docker/job-spec.json.sciflo-s1-ifg
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
"command": "/home/ops/ariamh/interferogram/sentinel/sciflo_create_ifg.sh",
"imported_worker_files": {
"$HOME/.netrc": ["/home/ops/.netrc"],
"$HOME/.aws": ["/home/ops/.aws", "ro"],
"$HOME/verdi/etc/settings.conf": "/home/ops/ariamh/conf/settings.conf"
},
"recommended-queues" : [
"grfn-job_worker-small",
"aria-job_worker-small",
"mem-job_worker-small",
"dwr-job_worker-small",
"chevron-job_worker-small",
"floodmap-job_worker-small",
"urgent-response-job_worker-small"
],
"disk_usage":"50GB",
"soft_time_limit": 8000,
"time_limit": 8400,

"params" : [
{
"name": "dataset_tag",
"destination": "context"
},
{
"name": "project",
"destination": "context"
},
{
"name": "singlesceneOnly",
"destination": "context"
},
{
"name": "preReferencePairDirection",
"destination": "context"
},
{
"name": "postReferencePairDirection",
"destination": "context"
},
{
"name": "temporalBaseline",
"destination": "context"
},
{
"name": "minMatch",
"destination": "context"
},
{
"name": "covth",
"destination": "context"
},
{
"name": "auto_bbox",
"destination": "context"
},
{
"name": "precise_orbit_only",
"destination": "context"
},
{
"name": "azimuth_looks",
"destination": "context"
},
{
"name": "range_looks",
"destination": "context"
},
{
"name": "filter_strength",
"destination": "context"
},
{
"name": "dem_type",
"destination": "context"
},
{
"name": "query",
"destination": "context"
},
{
"name": "name",
"destination": "context"
},
{
"name": "username",
"destination": "context"
}
]
}
58 changes: 38 additions & 20 deletions interferogram/sentinel/create_ifg.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from lxml.etree import parse
import numpy as np
from datetime import datetime

from utils.UrlUtils import UrlUtils
from check_interferogram import check_int
from create_input_xml import create_input_xml
Expand Down Expand Up @@ -463,30 +462,49 @@ def main():

# create browse images
os.chdir(prod_merged_dir)
from utils.isce2geotiff_unw import intf2browse
intf2browse('.')
mdx_app_path = "{}/applications/mdx.py".format(os.environ['ISCE_HOME'])
mdx_path = "{}/bin/mdx".format(os.environ['ISCE_HOME'])
import isce
from utils.createImage import createImage
import xml.etree.ElementTree as ET
from iscesys.Dumpers.XmlDumper import XmlDumper
unw_file = "filt_topophase.unw.geo"
#unwrapped image at different rates
createImage("{} -P {}".format(mdx_app_path, unw_file),unw_file)
createImage("{} -P {} -wrap {}".format(mdx_app_path, unw_file, rad),unw_file + "_5cm")
createImage("{} -P {} -wrap 20".format(mdx_app_path, unw_file),unw_file + "_20rad")
#amplitude image
unw_xml = "filt_topophase.unw.geo.xml"
rt = parse(unw_xml)
size = eval(rt.xpath('.//component[@name="coordinate1"]/property[@name="size"]/value/text()')[0])
rtlr = size * 4
logger.info("rtlr value for amplitude browse is: {}".format(rtlr))
createImage("{} -P {} -s {} -amp -r4 -rtlr {} -CW".format(mdx_path, unw_file, size, rtlr),'amplitude.geo')
#coherence image
top_file = "topophase.cor.geo"
createImage("{} -P {}".format(mdx_app_path, top_file),top_file)
#should be the same size as unw but just in case
top_xml = "topophase.cor.geo.xml"
rt = parse(top_xml)
size = eval(rt.xpath('.//component[@name="coordinate1"]/property[@name="size"]/value/text()')[0])
rhdr = size * 4
createImage("{} -P {} -s {} -r4 -rhdr {} -cmap cmy -wrap 1.2".format(mdx_path, top_file,size,rhdr),"topophase_ph_only.cor.geo")
# fix image type in unwrap for the later steps
with open(unw_xml) as f:
root = ET.ElementTree(file=f).getroot()
child = ET.SubElement(root,"property",name="image_type")
ET.SubElement(child, 'value').text = "unw"
ET.SubElement(child, 'doc').text = "Image type used for displaying."
XD = XmlDumper()
XD.indent(root)
testxml = "test.xml"
etObj = ET.ElementTree(root)
fp = open(testxml,'wb')
etObj.write(fp)
fp.close()
call_noerr("mv {} {}".format(testxml, unw_xml))
# unwrapped image at different rates
createImage("{} -P {}".format(mdx_app_path, unw_file),unw_file)
# createImage("{} -P {} -wrap {}".format(mdx_app_path, unw_file, rad),unw_file + "_5cm")
# createImage("{} -P {} -wrap 20".format(mdx_app_path, unw_file),unw_file + "_20rad")
# #amplitude image
# rt = parse(unw_xml)
# size = eval(rt.xpath('.//component[@name="coordinate1"]/property[@name="size"]/value/text()')[0])
# rtlr = size * 4
# logger.info("rtlr value for amplitude browse is: {}".format(rtlr))
# createImage("{} -P {} -s {} -amp -r4 -rtlr {} -CW".format(mdx_path, unw_file, size, rtlr),'amplitude.geo')
# #coherence image
# top_file = "topophase.cor.geo"
# createImage("{} -P {}".format(mdx_app_path, top_file),top_file)
# #should be the same size as unw but just in case
# top_xml = "topophase.cor.geo.xml"
# rt = parse(top_xml)
# size = eval(rt.xpath('.//component[@name="coordinate1"]/property[@name="size"]/value/text()')[0])
# rhdr = size * 4
# createImage("{} -P {} -s {} -r4 -rhdr {} -cmap cmy -wrap 1.2".format(mdx_path, top_file,size,rhdr),"topophase_ph_only.cor.geo")


'''
Expand Down
Loading

0 comments on commit 33ae9ec

Please sign in to comment.