Skip to content

Commit dd18a84

Browse files
authored
Merge branch 'isce-framework:develop' into develop
2 parents 7c7272f + cc90713 commit dd18a84

File tree

8 files changed

+80
-42
lines changed

8 files changed

+80
-42
lines changed

.github/workflows/build-and-run.yml

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ jobs:
2020
# stage_dem requires AWS permissions to access the S3 bucket containing the DEM data.
2121
# pybind.unwrap.phass occasionally segfaults on GHA runners.
2222

23+
# Default values for optional matrix parameters
24+
env-file: ${{ matrix.deps.env-file || 'environment.yml' }}
25+
ctest-exclude: ${{ matrix.os.ctest_exclude || '-E ".*($ALL_EXCLUDE)"'}}
26+
extra-specs: ${{ matrix.deps.extra-specs || '' }}
27+
build-type: ${{ matrix.build-type || 'RelWithDebInfo' }}
28+
2329
defaults:
2430
run:
2531
shell: bash -l {0}
@@ -29,23 +35,23 @@ jobs:
2935
matrix:
3036
os:
3137
- label: Linux
32-
runner: ubuntu-latest
33-
ctest_exclude: -E ".*($ALL_EXCLUDE)"
34-
- runner: macos-latest
35-
label: macOS
38+
- label: macOS
39+
runner: macos-latest
3640
ctest_exclude: -E ".*($ALL_EXCLUDE|io\.gdal\.raster|unwrap\.snaphu|background)"
3741
# io.gdal.raster and unwrap.snaphu tests fail due to known unresolved issues
3842
# with GDAL memory mapping on macOS.
3943
# background reader/writer test sometimes fails on macOS due to slow runtimes.
4044
deps:
4145
- label: Latest
42-
env-file: environment.yml
43-
extra-specs: ""
4446
build-type: [ Release, Debug ]
45-
47+
include:
48+
- deps:
49+
label: Minimum Python supported
50+
extra-specs: |
51+
python=3.9
4652
4753
name: Build And Test - ${{ matrix.os.label }} ${{ matrix.deps.label }} ${{ matrix.build-type }}
48-
runs-on: ${{ matrix.os.runner }}
54+
runs-on: ${{ matrix.os.runner || 'ubuntu-latest' }}
4955
steps:
5056
# Typical github repo checkout step
5157
- name: Github Repo Checkout
@@ -54,20 +60,20 @@ jobs:
5460
# Prints the variables for this run to simplify debugging
5561
- name: Print Run Variables
5662
run: |
57-
echo Runner OS: ${{ matrix.os.runner }}
58-
echo Environment: ${{ matrix.deps.env-file }}
59-
echo Build Type: ${{ matrix.build-type }}
60-
echo ctest exclude command: ${{ matrix.os.ctest_exclude }}
61-
echo Depenencies: ${{ matrix.deps.extra-specs }}
63+
echo Runner OS: ${{ matrix.os.runner || 'ubuntu-latest' }}
64+
echo Environment: ${{ env.env-file }}
65+
echo Build Type: ${{ env.build-type }}
66+
echo ctest exclude command: ${{ env.ctest_exclude }}
67+
echo Dependencies: ${{ env.extra-specs }}
6268
6369
# Set the conda environment up using Mamba and the dependencies for this run
6470
- name: Setup Environment
6571
uses: mamba-org/setup-micromamba@v2
6672
with:
67-
environment-file: ${{ matrix.deps.env-file }}
73+
environment-file: ${{ env.env-file }}
6874
environment-name: isce3
6975
create-args: >-
70-
${{ matrix.deps.extra-specs }}
76+
${{ env.extra-specs }}
7177
7278
# Fix missing conda command on macOS
7379
- name: macOS conda command fixup
@@ -89,7 +95,7 @@ jobs:
8995
cmake \
9096
-B build \
9197
-G Ninja \
92-
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
98+
-DCMAKE_BUILD_TYPE=${{ env.build-type }} \
9399
-DCMAKE_INSTALL_PREFIX=$ISCE3_PREFIX \
94100
-DCMAKE_PREFIX_PATH=$CONDA_PREFIX \
95101
.
@@ -122,4 +128,4 @@ jobs:
122128
run: |
123129
cd build
124130
export GDAL_MEM_ENABLE_OPEN=YES
125-
ctest --output-on-failure ${{ matrix.os.ctest_exclude }}
131+
ctest --output-on-failure ${{ env.ctest-exclude }}

python/packages/nisar/antenna/pattern.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -400,27 +400,27 @@ def form_pattern(self, tseq, slant_range: Linspace,
400400
if tx_pol == "L":
401401
tx_bmf_pat[tx_pol] = (
402402
self.tx_bmf['H'].form_pattern(
403-
t, slant_range, nearest=nearest,
403+
tseq, slant_range, nearest=nearest,
404404
channel_adj_factors=self.channel_adj_fact_tx['H']) +
405405
1j * self.tx_bmf['V'].form_pattern(
406-
t, slant_range, nearest=nearest,
406+
tseq, slant_range, nearest=nearest,
407407
channel_adj_factors=self.channel_adj_fact_tx['V'])
408408
).astype(np.complex64)
409409

410410
elif tx_pol == "R":
411411
tx_bmf_pat[tx_pol] = (
412412
self.tx_bmf['H'].form_pattern(
413-
t, slant_range, nearest=nearest,
413+
tseq, slant_range, nearest=nearest,
414414
channel_adj_factors=self.channel_adj_fact_tx['H']) -
415415
1j * self.tx_bmf['V'].form_pattern(
416-
t, slant_range, nearest=nearest,
416+
tseq, slant_range, nearest=nearest,
417417
channel_adj_factors=self.channel_adj_fact_tx['V'])
418418
).astype(np.complex64)
419419

420420
else: # other non-compact pol types
421421
adj = self.channel_adj_fact_tx[tx_pol]
422422
tx_bmf_pat[tx_pol] = self.tx_bmf[tx_pol].form_pattern(
423-
t, slant_range, nearest=nearest, channel_adj_factors=adj
423+
tseq, slant_range, nearest=nearest, channel_adj_factors=adj
424424
).astype(np.complex64)
425425

426426
# build two-way pattern for all unique TxRx products obtained from all

python/packages/nisar/workflows/focus.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1816,6 +1816,8 @@ def temp(suffix):
18161816
z[np.isnan(z)] = 0.0
18171817
if cfg.processing.zero_fill_gaps:
18181818
fill_gaps(z, swaths[:, pulse:pulse+nblock, :], 0.0)
1819+
if cfg.processing.nullify_azimuth_mean:
1820+
z -= z.mean(axis=0)
18191821
raw_mm[block_out] = z
18201822

18211823
raw_clean, rfi_likelihood = process_rfi(cfg, raw_mm, temp)

python/packages/nisar/workflows/ionosphere.py

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,16 @@ def compute_differential_phase(phase_first,
461461
The differential phase data is written directly to the specified
462462
output datasets. This function does not return any data.
463463
"""
464+
def _to_complex_if_needed(arr):
465+
"""
466+
Ensure an array is complex. If it's already complex, return as-is.
467+
Otherwise interpret values as phase (radians) and convert with exp(j*phi).
468+
"""
469+
if np.iscomplexobj(arr):
470+
return arr
471+
# Cast to float to avoid integer exponentiation issues
472+
return np.exp(1j * arr)
473+
464474
# Check if reading and writing will happen on the same file
465475
is_same_file_first_output = (phase_first == output_path)
466476
is_same_file_first_second = (phase_first == phase_second)
@@ -521,13 +531,19 @@ def compute_differential_phase(phase_first,
521531
second_data_block = get_raster_block(
522532
phase_second_raster,
523533
block_param_side)
524-
block_param = block_param_side
534+
chosen_block_param = block_param_side
525535
else:
526536
second_data_block = get_raster_block(
527537
phase_second_raster,
528538
block_param_main)
529-
block_param = block_param_main
539+
chosen_block_param = block_param_main
540+
541+
# Ensure complex (convert real-valued phase in radians to
542+
# complex phase)
543+
first_data_block = _to_complex_if_needed(first_data_block)
544+
second_data_block = _to_complex_if_needed(second_data_block)
530545

546+
# Optional resampling of FIRST to SECOND grid
531547
if resampling_flag:
532548
first_data_block = decimate_freq_a_array(
533549
main_slant,
@@ -539,7 +555,7 @@ def compute_differential_phase(phase_first,
539555

540556
# Write result block to output
541557
write_raster_block(output_data_raster,
542-
diff_phase, block_param)
558+
diff_phase, chosen_block_param)
543559
finally:
544560
# Close the output file if it was opened separately
545561
if not is_same_file_first_second:
@@ -826,7 +842,7 @@ def insar_ionosphere_pair(original_cfg, runw_hdf5):
826842
if iono_method == 'main_diff_ms_band':
827843
diff_dir = pathlib.Path(orig_scratch_path,
828844
'ionosphere', 'diff_ms')
829-
phase_first = original_out_paths['RIFG']
845+
phase_first = original_out_paths['RUNW']
830846
if rerun_insar_pairs > 0:
831847
additional_runw = f'{new_scratch}/RUNW.h5'
832848
phase_second = pathlib.Path(orig_scratch_path,
@@ -860,14 +876,16 @@ def insar_ionosphere_pair(original_cfg, runw_hdf5):
860876
pol_list_a = iono_freq_pols['A']
861877
pol_list_b = iono_freq_pols['B']
862878
swath_path = RIFGGroupsPaths().SwathsPath
879+
runw_swath_path = RUNWGroupsPaths().SwathsPath
880+
863881
first_data_path = []
864882
for pol_a in pol_list_a:
865883

866-
dest_freq_path = f"{swath_path}/frequencyA"
884+
dest_freq_path = f"{runw_swath_path}/frequencyA"
867885
dest_pol_path = f"{dest_freq_path}/interferogram/{pol_a}"
868-
rifg_path_freq = f"{dest_pol_path}/wrappedInterferogram"
886+
runw_path_freq = f"{dest_pol_path}/unwrappedPhase"
869887

870-
first_data_path.append(rifg_path_freq)
888+
first_data_path.append(runw_path_freq)
871889
first_slant_path = f"{dest_freq_path}/interferogram/slantRange"
872890
second_data_path = []
873891
for pol_b in pol_list_b:

share/nisar/defaults/focus.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,12 @@ runconfig:
415415
# cal pulses.
416416
zero_fill_gaps: True
417417

418+
# If true, subtract the azimuth mean from the raw data, which is
419+
# useful when the caltone is nearly constant in azimuth but not
420+
# stationary in range. Calculating the mean and subtracting it is
421+
# done in blocks using rangecomp.block_size
422+
nullify_azimuth_mean: True
423+
418424
# Processing stage switches, mostly for debug.
419425
# Any missing stages assumed True
420426
is_enabled:

share/nisar/defaults/insar.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,25 +1184,25 @@ runconfig:
11841184
# (-1 logs the percentages as INFO, but will not trigger a QA failure.)
11851185

11861186
# Percent of NaN pixels per total raster area allowed
1187-
# Default: 95.0
1188-
nan_threshold: 95.0
1187+
# Default: -1
1188+
nan_threshold: -1
11891189

11901190
# Percent of +/- Inf pixels per total raster area allowed
11911191
# Default: 95.0
11921192
inf_threshold: 95.0
11931193

11941194
# Percent of Fill-valued pixels per total raster area allowed
1195-
# Default: 95.0
1196-
fill_threshold: 95.0
1195+
# Default: -1
1196+
fill_threshold: -1
11971197

11981198
# Percent of Near-zero pixels per total raster area allowed
11991199
# Default: -1
12001200
near_zero_threshold: -1
12011201

12021202
# Percent of total invalid pixels per total raster area allowed
12031203
# 'Total invalid pixels' is the sum of NaN, Inf, fill, & (if `zero_is_invalid` is True) near-zero pixels.
1204-
# Default: 95.0
1205-
total_invalid_threshold: 95.0
1204+
# Default: -1
1205+
total_invalid_threshold: -1
12061206

12071207
# Absolute tolerance for determining if a raster pixel is 'near zero'.
12081208
# Default: 1e-06
@@ -1603,25 +1603,25 @@ runconfig:
16031603
# (-1 logs the percentages as INFO, but will not trigger a QA failure.)
16041604

16051605
# Percent of NaN pixels per total raster area allowed
1606-
# Default: 99.0
1607-
nan_threshold: 99.0
1606+
# Default: -1
1607+
nan_threshold: -1
16081608

16091609
# Percent of +/- Inf pixels per total raster area allowed
16101610
# Default: 99.0
16111611
inf_threshold: 99.0
16121612

16131613
# Percent of Fill-valued pixels per total raster area allowed
1614-
# Default: 99.0
1615-
fill_threshold: 99.0
1614+
# Default: -1
1615+
fill_threshold: -1
16161616

16171617
# Percent of Near-zero pixels per total raster area allowed
16181618
# Default: -1
16191619
near_zero_threshold: -1
16201620

16211621
# Percent of total invalid pixels per total raster area allowed
16221622
# 'Total invalid pixels' is the sum of NaN, Inf, fill, & (if `zero_is_invalid` is True) near-zero pixels.
1623-
# Default: 99.0
1624-
total_invalid_threshold: 99.0
1623+
# Default: -1
1624+
total_invalid_threshold: -1
16251625

16261626
# Absolute tolerance for determining if a raster pixel is 'near zero'.
16271627
# Default: 1e-06

share/nisar/schemas/focus.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,12 @@ runconfig:
253253
# If true, fill transmit gaps with zeros to remove loop-back cal pulses.
254254
zero_fill_gaps: bool(required=False)
255255

256+
# If true, subtract the azimuth mean from the raw data, which is useful
257+
# when the caltone is nearly constant in azimuth but not stationary in
258+
# range. Calculating the mean and subtracting it is done in blocks using
259+
# rangecomp.block_size
260+
nullify_azimuth_mean: bool(required=False)
261+
256262
# Processing stage switches, mostly for debug.
257263
# Any missing stages assumed True
258264
is_enabled:

tools/imagesets/oracle8conda/distrib_nisar/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ARG GIT_OAUTH_TOKEN
1111
RUN cd /opt \
1212
&& git clone https://$GIT_OAUTH_TOKEN@github-fn.jpl.nasa.gov/NISAR-ADT/SoilMoisture \
1313
&& git clone https://github.com/isce-framework/nisarqa.git \
14-
&& cd /opt/nisarqa && git checkout v14.0.1 && rm -rf .git \
14+
&& cd /opt/nisarqa && git checkout v15.0.1 && rm -rf .git \
1515
&& cd /opt/SoilMoisture && git checkout v0.3.1 && rm -rf .git
1616

1717
FROM $distrib_img

0 commit comments

Comments
 (0)