Skip to content

Commit 6441f9a

Browse files
yzheng6GitHub Enterprise
authored andcommitted
Add caltool tests (#837)
* Update PTA test and remove obsolete test/data * Add beamformer tests
1 parent 0cb0a4b commit 6441f9a

File tree

4 files changed

+47
-8
lines changed

4 files changed

+47
-8
lines changed

tools/imagesets/centos7conda/distrib_nisar/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ RUN cd /opt \
1111
&& git clone https://[email protected]/NISAR-ADT/QualityAssurance \
1212
&& git clone https://[email protected]/NISAR-ADT/CFChecker \
1313
&& git clone https://[email protected]/NISAR-ADT/calTools \
14-
&& cd /opt/QualityAssurance && git checkout R1.1 && rm -rf .git \
14+
&& cd /opt/QualityAssurance && git checkout cd455fd && rm -rf .git \
1515
&& cd /opt/CFChecker && git checkout R1.1 && rm -rf .git \
16-
&& cd /opt/calTools && git checkout R1.1 && rm -rf .git
16+
&& cd /opt/calTools && git checkout R2 && rm -rf .git
1717

1818
FROM $distrib_img
1919

tools/imagesets/imgset.py

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,15 +404,33 @@ def ptatest(self, tests=None):
404404
testdir = os.path.abspath(pjoin(self.testdir, testname))
405405
os.makedirs(pjoin(testdir, f"output_pta"), exist_ok=True)
406406
log = pjoin(testdir, f"output_pta", "stdouterr.log")
407-
cmd = [f"""time python -m pybind_nisar.workflows.point_target_info \
408-
input_{dataname}/{workflowdata[dataname][0]} 512 256 256 \
409-
--fs-bw-ratio 2 --mlobe-nulls 2 --search-null > output_pta/pta.json"""]
407+
cmd = [f"""time point_target_analysis.py -i input_{dataname}/rslc_ree17.h5\
408+
-f 'A' -p 'HH' -c 3.177 -54.58 0 --fs-bw-ratio 2 --mlobe-nulls 2 \
409+
--search-null --num-lobes 10 --num-search-pix 6 -o output_pta/pta.json"""]
410410
try:
411411
self.distribrun(testdir, cmd, logfile=log, dataname=dataname, nisarimg=True,
412412
loghdlrname=f'wftest.{os.path.basename(testdir)}')
413413
except subprocess.CalledProcessError as e:
414414
raise RuntimeError(f"CalTool point target analyzer tool test {testname} failed") from e
415415

416+
def beamformtest(self, tests=None):
417+
if tests is None:
418+
tests = workflowtests['beamform'].items()
419+
for testname, dataname in tests:
420+
print(f"\nRunning CalTool beamformer test {testname}\n")
421+
testdir = os.path.abspath(pjoin(self.testdir, testname))
422+
os.makedirs(pjoin(testdir, f"output_beamform"), exist_ok=True)
423+
log = pjoin(testdir, f"output_beamform", "stdouterr.log")
424+
for btype, copt in [("tx", ""), ("rx", f"-c input_{dataname[0]}/{dataname[3]}")]:
425+
cmd = [f"""time beamform_{btype}.py -i input_{dataname[0]}/{dataname[1]} \
426+
-a input_{dataname[0]}/{dataname[2]} {copt} \
427+
-o output_beamform/beamform_{btype}_output.txt"""]
428+
try:
429+
self.distribrun(testdir, cmd, logfile=log, dataname=dataname[0], nisarimg=True,
430+
loghdlrname=f"wftest.{os.path.basename(testdir)}")
431+
except subprocess.CalledProcessError as e:
432+
raise RuntimeError(f"CalTool beamformer tool test {testname} failed") from e
433+
416434
def mintests(self):
417435
"""
418436
Only run first test from each workflow
@@ -423,6 +441,7 @@ def mintests(self):
423441
self.insartest(tests=list(workflowtests['insar'].items())[:1])
424442
self.noisesttest(tests=list(workflowtests['noisest'].items())[:1])
425443
self.ptatest(tests=list(workflowtests['pta'].items())[:1])
444+
self.beamformtest(tests=list(workflowtests['beamform'].items())[:1])
426445

427446
def workflowqa(self, wfname, testname):
428447
"""

tools/imagesets/workflowdata.py

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,18 @@
5454
"L0B_RRSD_REE_NOISEST1.h5",
5555
"README.txt",
5656
],
57-
"L0B_RRSD_REE_PTA1":
57+
58+
"L0B_RRSD_REE17_PTA":
59+
[
60+
"rslc_ree17.h5",
61+
],
62+
63+
"L0B_RRSD_REE_beamform":
5864
[
59-
"L0B_RRSD_REE_PTA1.c8",
65+
"REE_L0B_ECHO_DATA.h5",
66+
"REE_ANTPAT_CUTS_DATA.h5",
67+
"instrumentTables_bf_19000101.h5",
68+
"ree_gen_nisar_product.log",
6069
"README.txt",
6170
],
6271

@@ -187,6 +196,16 @@
187196
]},
188197

189198
'pta': {"pta_" + name: "L0B_RRSD_" + name for name in [
190-
"REE_PTA1",
199+
"REE17_PTA",
191200
]},
201+
202+
'beamform': {
203+
"beamform_L0B_RRSD_REE_beamform":
204+
[
205+
"L0B_RRSD_REE_beamform", # input data directory
206+
"REE_L0B_ECHO_DATA.h5", # L0B data
207+
"REE_ANTPAT_CUTS_DATA.h5", # antenna pattern
208+
"instrumentTables_bf_19000101.h5", # instrument tables
209+
],
210+
},
192211
}

tools/run.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def run(*, steps, imgset, **kwargs):
2323
"makedistrib_nisar",
2424
"noisesttest",
2525
"ptatest",
26+
"beamformtest",
2627
"rslcqa",
2728
"gslcqa",
2829
"gcovqa",

0 commit comments

Comments
 (0)