Closed cmarshak closed 5 months ago
I can confirm capping the gdal
version with 'gdal<3.8'
removes the above problem(s).
However, even so, I am not able to generate products as there is a step in the workflow that does not complete.
The process hangs here:
...
S1A_IW_SLC__1SDV_20240108T232450_20240108T232517_052022_06495E_2EAD/scratch/input_image_test.tif
100 - done.
0...10...20...30...40...50...60...70...80...90... -- Reading /u/aurora-r0/cmarshak/dswx-s1-workflow-pst/out/S1A_IW_SLC__1SDV_20240108T232450_20240108T232517_052022_06495E_2EAD/scratch/input_image_test.tif ... (8347, 9766)
100 - done.
0...10...20...30...40...50...60...70...80...90...Saving dswx product : /u/aurora-r0/cmarshak/dswx-s1-workflow-pst/out/S1A_IW_SLC__1SDV_20240108T232450_20240108T232517_052022_06495E_2EAD/scratch/split_mask_water_masking.tif
100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90... -- Reading /u/aurora-r0/cmarshak/dswx-s1-workflow-pst/out/S1A_IW_SLC__1SDV_20240108T232450_20240108T232517_052022_06495E_2EAD/scratch/intermediate_false_water_candidate.tif ... (8347, 9766)
100 - done.
0...10...20...30...40...50...60...70...80...90...Saving dswx product : /u/aurora-r0/cmarshak/dswx-s1-workflow-pst/out/S1A_IW_SLC__1SDV_20240108T232450_20240108T232517_052022_06495E_2EAD/scratch/false_positive_connected_water.tif
100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90... -- Reading /u/aurora-r0/cmarshak/dswx-s1-workflow-pst/out/S1A_IW_SLC__1SDV_20240108T232450_20240108T232517_052022_06495E_2EAD/scratch/masking_ancillary_darkland_removed.tif ... (8347, 9766)
I have tried this on my local workstation and on the server aurora using the capped gdal
version. I am not sure what the issue is or if there are additional environment constraints that might be needed.
Thank you.
Dear @oberonia78,
Thank you for your help thus far with getting DSWx-S1 running; per your excellent observation (my output hand.tif
had a lot of nodata when using pysheds
). I modified my workflow to pull from ASF tiles as you do. However, I am still having trouble running the workflow. These are the different flavors of the workflow that I have tried:
For 1. and 2., I am still getting the issue I pointed out above, namely, hanging on
0...10...20...30...40...50...60...70...80...90... -- Reading /u/aurora-r0/cmarshak/dswx-s1-workflow-pst/out/S1A_IW_SLC__1SDV_20240108T232450_20240108T232517_052022_06495E_2EAD/scratch/masking_ancillary_darkland_removed.tif ... (8347, 9766)
Weirdly, when I use the VRT in the shared server you provided as in 3., it gets past this "hanging" portion. However, it still fails I will share the output below past that "hanging area":
...
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90... -- Reading /u/aurora-r0/cmarshak/dswx-s1-workflow-pst/out2/S1A_IW_SLC__1SDV_20240108T232450_20240108T232517_052022_06495E_2EAD/scratch/masking_ancillary_darkland_removed.tif ... (8347, 9766)
Saving dswx product : /u/aurora-r0/cmarshak/dswx-s1-workflow-pst/out2/S1A_IW_SLC__1SDV_20240108T232450_20240108T232517_052022_06495E_2EAD/scratch/refine_landcover_binary_VV_VH.tif
100 - done.
0...10...20...30...40...50...60...70...80...90... -- Reading /u/aurora-r0/cmarshak/dswx-s1-workflow-pst/out2/S1A_IW_SLC__1SDV_20240108T232450_20240108T232517_052022_06495E_2EAD/scratch/refine_landcover_binary_VV_VH.tif ... (8347, 9766)
-- Reading /u/aurora-r0/cmarshak/dswx-s1-workflow-pst/out2/S1A_IW_SLC__1SDV_20240108T232450_20240108T232517_052022_06495E_2EAD/scratch/interpolated_landcover.tif ... (8347, 9766)
100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90... -- Reading /u/aurora-r0/cmarshak/dswx-s1-workflow-pst/out2/S1A_IW_SLC__1SDV_20240108T232450_20240108T232517_052022_06495E_2EAD/scratch/merged_removed_false_water_VV.tif ... (8347, 9766)
Saving dswx product : /u/aurora-r0/cmarshak/dswx-s1-workflow-pst/out2/S1A_IW_SLC__1SDV_20240108T232450_20240108T232517_052022_06495E_2EAD/scratch/bimodality_bright_water_VV_VH.tif
100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90... -- Reading /u/aurora-r0/cmarshak/dswx-s1-workflow-pst/out2/S1A_IW_SLC__1SDV_20240108T232450_20240108T232517_052022_06495E_2EAD/scratch/merged_fill_gap_VV_VH.tif ... (8347, 9766)
Saving dswx product : /u/aurora-r0/cmarshak/dswx-s1-workflow-pst/out2/S1A_IW_SLC__1SDV_20240108T232450_20240108T232517_052022_06495E_2EAD/scratch/bimodality_output_binary_VV_VH.tif
100 - done.
0...10...20...30...40...50...60...70...80...90...
/u/aurora-r0/cmarshak/miniforge3/envs/dswx_s1/lib/python3.11/site-packages/dswx_sar/pre_processing.py:32: RuntimeWarning: invalid value encountered in divide
return array1 / array2
>> lee_enhanced_filter
/u/aurora-r0/cmarshak/miniforge3/envs/dswx_s1/lib/python3.11/site-packages/dswx_sar/detect_inundated_vegetation.py:100: RuntimeWarning: divide by zero encountered in log10
cross_db = 10 * np.log10(
>> lee_enhanced_filter
>> lee_enhanced_filter
>> lee_enhanced_filter
>> lee_enhanced_filter
>> lee_enhanced_filter
>> lee_enhanced_filter
>> lee_enhanced_filter
>> lee_enhanced_filter
>> lee_enhanced_filter
>> lee_enhanced_filter
>> lee_enhanced_filter
>> lee_enhanced_filter
>> lee_enhanced_filter
>> lee_enhanced_filter
>> lee_enhanced_filter
>> lee_enhanced_filter
>> lee_enhanced_filter
>> lee_enhanced_filter
>> lee_enhanced_filter
>> lee_enhanced_filter
>> lee_enhanced_filter
>> lee_enhanced_filter
>> lee_enhanced_filter
>> lee_enhanced_filter
>> lee_enhanced_filter
>> lee_enhanced_filter
>> lee_enhanced_filter
100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...
WARNING: product version was not provided.
WARNING: Either the MGRS tile or the MGRS collection database was not provided.
-- Reading /u/aurora-r0/cmarshak/dswx-s1-workflow-pst/out2/S1A_IW_SLC__1SDV_20240108T232450_20240108T232517_052022_06495E_2EAD/scratch/bimodality_output_binary_VV_VH.tif ... (8347, 9766)
-- Reading /u/aurora-r0/cmarshak/dswx-s1-workflow-pst/out2/S1A_IW_SLC__1SDV_20240108T232450_20240108T232517_052022_06495E_2EAD/scratch/no_data_area_VV_VH.tif ... (8347, 9766)
-- Reading /u/aurora-r0/cmarshak/dswx-s1-workflow-pst/out2/S1A_IW_SLC__1SDV_20240108T232450_20240108T232517_052022_06495E_2EAD/scratch/mosaic_layovershadow_mask.tif ... (8347, 9766)
-- Reading /u/aurora-r0/cmarshak/dswx-s1-workflow-pst/out2/S1A_IW_SLC__1SDV_20240108T232450_20240108T232517_052022_06495E_2EAD/scratch/interpolated_hand.tif ... (8347, 9766)
-- Reading /u/aurora-r0/cmarshak/dswx-s1-workflow-pst/out2/S1A_IW_SLC__1SDV_20240108T232450_20240108T232517_052022_06495E_2EAD/scratch/temp_inundated_vegetation_VV_VH.tif ... (8347, 9766)
-- Reading /u/aurora-r0/cmarshak/dswx-s1-workflow-pst/out2/S1A_IW_SLC__1SDV_20240108T232450_20240108T232517_052022_06495E_2EAD/scratch/region_growing_output_binary_VV_VH.tif ... (8347, 9766)
-- Reading /u/aurora-r0/cmarshak/dswx-s1-workflow-pst/out2/S1A_IW_SLC__1SDV_20240108T232450_20240108T232517_052022_06495E_2EAD/scratch/refine_landcover_binary_VV_VH.tif ... (8347, 9766)
100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90... -- Reading /u/aurora-r0/cmarshak/dswx-s1-workflow-pst/out2/S1A_IW_SLC__1SDV_20240108T232450_20240108T232517_052022_06495E_2EAD/scratch/fuzzy_image_VV_VH.tif ... (8347, 9766)
100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...
fail to find the overlapped rtc
100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...
fail to find the overlapped rtc
100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...
fail to find the overlapped rtc
100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...
fail to find the overlapped rtc
100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...100 - done.
0...10...20...30...40...50...60...70...80...90...
I compared the hand
vrt you provided and the one I generated. Mine is slightly smaller (still buffered by 1 degree across the slc extents). When I reproject into the VRT you provided using nearest neighbor interpolation, I get the following difference:
If I see where precisely 0s occur I get this difference where the value of 1
indicates 0 (yellow) and blue the opposite.
Questions:
Hi @cmarshak, Thanks for posting the issues you have. I'll investigate your issues. But before that, I suggest you to process with the database together. I'll share the files with LFT. The problem seems to happen in the last step of making OPERA packages.
dswx_s1.py <your runconfig> --debug_mode
0...10...20...30...40...50...60...70...80...90... -- Reading /u/aurora-r0/cmarshak/dswx-s1-workflow-pst/out/S1A_IW_SLC__1SDV_20240108T232450_20240108T232517_052022_06495E_2EAD/scratch/masking_ancillary_darkland_removed.tif ... (8347, 9766)
This part is taking the HAND data and refining the water boundaries using the height level. So, I investigated your HAND files and found there were many no-data values. By the way, we have a function for downloading HAND and making VRT files. It was not merged yet, but it is still usable. (https://github.com/opera-adt/DSWX-SAR/pull/17)Following up on each:
The main difference I see between the environment you shared (i.e. the text file with conda list > ....txt
and the one I have is that your has gdal
version is 3.7.2
and mine is 3.7.3
. I see the patch versions of numpy
and scipy
are similar. That could be an issue. I could cap gdal
and see how the environment changes further.
Ideally, you could provide instructions to replicate your environment on a new machine.
And just for posterity, the instructions here do not work on either my mac or aurora (the shared server): https://github.com/opera-adt/DSWX-SAR/blob/main/docker/lock_package.lock#L2
dswx_workflow
? I get slightly better error handling if I call the functions directly from python. Specifically, I am running the workflow like this (so I can avoid passing a command to terminal, see the notebook) :run_config_path = out_directory / 'run_config.yml'
with open(run_config_path, 'w') as run_config_yaml:
yaml.dump(input_dict, run_config_yaml)
cfg = RunConfig.load_from_yaml(str(run_config_path), 'dswx_s1', args)
dswx_s1_workflow(cfg)
Would it just be args.debug_mode = True
? Or could I add it somewhere in the runconfig?
from tile_mate import get_raster_from_tiles
X_hand, p_hand = get_raster_from_tiles(bounds_buffered, tile_shortname='hand')
hand_path = out_directory / f'hand.tif'
with rasterio.open(hand_path, 'w', **p_hand) as ds:
ds.write(X_hand)
My hand tif is just slightly smaller.
We can follow up next week.
So to my surprise - 3. (using the VRT provided) does work!
And it saves to sas
folder. The products look good.
So, the HAND and environment issues still need to be sorted out.
Thanks @oberonia78 !!
Dear @oberonia78 and dswx-sar team,
I can confirm that the issue regarding the hanging step related to masking_ancillary_darkland_removed.tif
was solved increasing the hand dataset coverage area. In my case, I used 1 degree around the SLC ID whose bursts I was using. When I increased that to 3 degrees, the error went away. I have a vague understanding that the code takes the bursts and uses all the overlapping MGRS tiles either using a database or the python library mgrs
. Since the MGRS tiles overlapping a given area may be much, much larger, it's unclear how much hand is required.
Not sure if this could be more elegantly solved providing a global vrt with ASF urls but don't know what the code is doing. You mentioned the relevant areas of the code are found in this file.
Thank you, Junkgyo!
This is assuming that gdal<3.8
is used :)
In the latest version the preprocessing routines, I was getting:
At first, I thought it had to do with auxiliary data not having enough buffer since it said that the nodata was being carried over into the reprojected reference water map. However, buffering by 1 degree yielded a similar issue.
Specifically, the function
validate_gtiff
here makes sure there are nonodata
values as indicated here: https://github.com/opera-adt/DSWX-SAR/blob/5f4c3209e1ba4e974f56f55485dce7e1c8fa017e/src/dswx_sar/pre_processing.py#L688-L691. The particular reprojected Pekel occurence map (this reprojection was done running thedswx-s1
workflow) looked like this: .First, I removed the
no_data
in the validation here: https://github.com/opera-adt/DSWX-SAR/blob/5f4c3209e1ba4e974f56f55485dce7e1c8fa017e/src/dswx_sar/pre_processing.py#L688-L691Still same error.
So I went into
dswx_utils
and modifying this line:to
Allowed the code to continue. Not sure if it's correct.
This seems like it could be gdal issue. I am using version
3.8.3
for the above as indicated withconda list | grep gdal
:My issues could be related to the minor release in November and making the runtime environment inconsistent with that which is being developed here. I have not checked this as I had a hard time pinpointing the bug. I am saying this because I had similar issues with DSWx-HLS recently as documented here. It turned out the expected runtime environment required
gdal<3.8
and I was similarly using the latestgdal
.Please let me know:
gdal.GA_Update
in this particular place is intended/acceptable/etc.