Skip to content

Commit

Permalink
Fix the relative index used to make compressed SLCs (#452)
Browse files Browse the repository at this point in the history
  • Loading branch information
scottstanie authored Oct 15, 2024
1 parent 4ae6918 commit 70b0a95
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/dolphin/workflows/single.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,16 @@ def run_wrapped_phase_single(
# Get the mean to set as pixel magnitudes
abs_stack = np.abs(cur_data[first_real_slc_idx:, in_trim_rows, in_trim_cols])
cur_data_mean, cur_amp_dispersion, _ = calc_ps_block(abs_stack)
# NOTE: the `ministack.compressed_reference_idx` was set relative to *all*
# input images, real and compressed.
# Since we pass in just the first real idx, we have to subtract that off
ref_index_relative = ministack.compressed_reference_idx - first_real_slc_idx
cur_comp_slc = compress(
# Get the inner portion of the full-res SLC data
cur_data[first_real_slc_idx:, in_trim_rows, in_trim_cols],
pl_output.cpx_phase[first_real_slc_idx:, out_trim_rows, out_trim_cols],
slc_mean=cur_data_mean,
reference_idx=ministack.compressed_reference_idx,
reference_idx=ref_index_relative,
)
# TODO: truncate

Expand Down
2 changes: 1 addition & 1 deletion src/dolphin/workflows/wrapped_phase.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def run(
extra_reference_date = cfg.output_options.extra_reference_date
if extra_reference_date:
new_compressed_slc_reference_idx = get_nearest_date_idx(
[dtup[0] for dtup in input_dates], extra_reference_date
[date_tup[0] for date_tup in input_dates], extra_reference_date
)
else:
new_compressed_slc_reference_idx = None
Expand Down

0 comments on commit 70b0a95

Please sign in to comment.