Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the relative index used to make compressed SLCs #452

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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