Skip to content

Commit

Permalink
update example script with new from_ds command in sarxarray
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerkuou committed Oct 21, 2024
1 parent ecbd7be commit 1edd912
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions examples/scripts/script_ps_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,10 @@ def get_free_port():

# Load the SLC data
logger.info("Loading data ...")
slcs = xr.open_zarr(path_slc_zarr)

# Construct the three datavariables: complex, amplitude, and phase
# This should be removed after fixing: https://github.com/TUDelftGeodesy/sarxarray/issues/55
slcs['complex'] = slcs['real'] + 1j*slcs['imag']
slcs = slcs.slcstack._get_amplitude()
slcs = slcs.slcstack._get_phase()
slcs = slcs.drop_vars(["real", "imag"])
ds = xr.open_zarr(path_slc_zarr) # Load the zarr file as a xr.Dataset
# Construct SLCs from xr.Dataset
# this construct three datavariables: complex, amplitude, and phase
slcs = sarxarray.from_ds(slcs)

# A rechunk might be needed to make a optimal usage of the resources
# Uncomment the following line to apply a rechunk after loading the data
Expand Down

0 comments on commit 1edd912

Please sign in to comment.