insarlab / MintPy

Miami InSAR time-series software in Python
https://mintpy.readthedocs.io
Other
575 stars 252 forks source link

tropo_gacos: can not convert NaN to integer #1086

Closed NMoghaddam closed 8 months ago

NMoghaddam commented 11 months ago

Description of the problem

In order to use GACOS for tropospheric correction, I downloaded the .ztd files for my AOI; I managed to run the MintPy on the S1 time series with GACOS .zdt files; however, it seems there is something wrong with the data values. I haven't requested GACOS files for every single scene but selected three for each year (a total of nine .zdt files in Tiff format). The warnings are just for the missing GACOS files but the error came up after reading the first .ztd file as such:

Full script that generated the error

correct_tropo = "Perform" in tropo_choice.value or "Rerun" in tropo_choice.value
era5_path = mint_path/"ERA5"
timeseries_era5_path = mint_path/"timeseries_ERA5.h5"
inputs_era5_path = mint_path/"inputs/ERA5.h5"

if "Delete" in tropo_choice.value:
    for f in [timeseries_era5_path, inputs_era5_path]:
        try:
            f.unlink()
        except FileNotFoundError:
            pass
    try:
        shutil.rmtree(era5_path)
    except FileNotFoundError:
        pass

if correct_tropo:
    set_troposhperic_correction_mintpy(config_path, "gacos")
    !smallbaselineApp.py $config_path --work-dir {mint_path} --dostep load_data
    !smallbaselineApp.py $config_path --work-dir {mint_path} --dostep correct_troposphere
else:
    set_troposhperic_correction_mintpy(config_path, "no")
    !smallbaselineApp.py $config_path --work-dir {mint_path} --dostep load_data

Full error message

Potential bug with data values in GACOS tiff files [as attached]

System information

image image (1)

welcome[bot] commented 11 months ago

👋 Thanks for opening your first issue here! Please filled out the template with as much details as possible. We appreciate that you took the time to contribute! Make sure you read our contributing guidelines.

yunjunz commented 11 months ago

I am not sure why this error is happening. Could you debug at tropo_gacos.py#L43, or plot/print the delay, length, width variables?

NMoghaddam commented 10 months ago

I added the print command for delay,length and width in the tropo_gacos.py#L43 and run the workflow for GACOS... it seems that I can not get the value for each of those parameters, but a different error to the previous reported one as below.

ChangetoCode ERRORMessageA

I am not sure whether it has anything to do with the calculate_delay_timeseries and the following part:

error

and if so what it does mean?!

yunjunz commented 8 months ago

The new issue should be due to the empty hdf5 file generated in the previous run. Removing it and re-run should get rid of this latter issue.