Installation issue of Mintpy

809 views
Skip to first unread message

SK Mustak

unread,
Sep 26, 2022, 10:01:25 AM9/26/22
to MintPy
Dear, 
Zhang Yunjun, I want to use Mintpy but problem I am facing in installation both in anaconda window and Ubuntu. please help how I can successfully install the mintpy in system. 'conda install -c conda-forge mintpy' actually not working. please help.
 can I use Mintpy in windows anaconda or I need mintpy Ubuntu?

Ozzy Tirmizi

unread,
Sep 27, 2022, 1:32:28 PM9/27/22
to MintPy
Without more details, there is no way to assist. We don't know what exactly is happening when you say it's not working.

Where are you typing the command? What error message are you getting?

There are detailed installation instructions available on the github page that also answer your question about the operating system: https://github.com/insarlab/MintPy/blob/main/docs/installation.md

Ozzy

SK Mustak

unread,
Sep 28, 2022, 7:24:26 AM9/28/22
to MintPy
I have install the mintpy in miniconda. However when i start running the example data like
cd WellsEnvD2T399/mintpy 
smallbaselineApp.py ${MINTPY_HOME}/mintpy/data/input_files/WellsEnvD2T399.txt

following error received




downloading weather model data using PyAPS ...
number of grib files to download: 8
------------------------------------------------------------------------------

Traceback (most recent call last):
  File "/home/mustak/tools/miniconda3/envs/insar/bin/smallbaselineApp.py", line 8, in <module>
    sys.exit(main())
  File "/home/mustak/tools/MintPy/mintpy/cli/smallbaselineApp.py", line 208, in main
    run_smallbaselineApp(inps)
  File "/home/mustak/tools/MintPy/mintpy/smallbaselineApp.py", line 1115, in run_smallbaselineApp
    app.run(steps=inps.runSteps)
  File "/home/mustak/tools/MintPy/mintpy/smallbaselineApp.py", line 897, in run
    self.run_tropospheric_delay_correction(sname)
  File "/home/mustak/tools/MintPy/mintpy/smallbaselineApp.py", line 647, in run_tropospheric_delay_correction
    mintpy.cli.tropo_pyaps3.main(iargs)
  File "/home/mustak/tools/MintPy/mintpy/cli/tropo_pyaps3.py", line 161, in main
    run_tropo_pyaps3(inps)
  File "/home/mustak/tools/MintPy/mintpy/tropo_pyaps3.py", line 699, in run_tropo_pyaps3
    inps.grib_files = dload_grib_files(
  File "/home/mustak/tools/MintPy/mintpy/tropo_pyaps3.py", line 425, in dload_grib_files
    check_pyaps_account_config(tropo_model)
  File "/home/mustak/tools/MintPy/mintpy/tropo_pyaps3.py", line 398, in check_pyaps_account_config
    raise ValueError(msg)
ValueError: PYAPS: No account info found for ERA5 in CDS section in file: /home/mustak/tools/PyAPS/src/pyaps3/model.cfg

please help me

Leonardo German Arzamendia

unread,
Sep 28, 2022, 8:07:16 AM9/28/22
to MintPy
Hi! For solve this you have to find that file (/home/mustak/tools/PyAPS/src/pyaps3/model.cfg), open it and complete with your user information, because it's require for download the weather model. 
For that you have to create an account on ECMWF, and set model.cfg as it's indicate. Anyway, once you open it, you can find detailed information about the registration.
I hope this can help you, but it doesn´t, let us know.
Regards!

SK Mustak

unread,
Sep 28, 2022, 9:59:27 AM9/28/22
to min...@googlegroups.com
Dear Leonardo, thank you very much. its helpful

--
You received this message because you are subscribed to the Google Groups "MintPy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mintpy+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mintpy/53e2dc0d-4507-4df4-9b7e-e11ce9dd7eb0n%40googlegroups.com.


--
Thanking You
Yours Faithfully
  Sk. Mustak
........................................................................................................................................

डॉआईआर  सेक  मुस्ताक/Dr. ir. Sk. Mustak

सहायक प्राध्यापक/Assistant Professor,

भूगोल विभाग/Department of Geography,
पर्यावरण और पृथ्वी विज्ञान 
अध्ययनशाला /School of Environment and Earth Science,
पंजाब केंद्रीय विश्वविद्यालय/Central University of Punjab,

बठिण्डा /Bathinda -151001

------------------------------------------------------------------------------------------------------
Previous Status 

Research Coordinator(Ecoinformatics Division)

Ashoka Trust for Research in Ecology and Environment (ATREE)

Royal Enclave, Sriramapura, Jakkur Post, Bangalore 560 064, Karnataka, India

--------------------------------------------------------------------------------------------------

M.S. in Geo-information Science and Earth Observation

ITC, Faculty of Geo-information Science and Earth Observation

University of Twente, Enschede, Netherlands
.........................................................................................................................................
Contact:
Mobile/Whatsapp: 07047680305
Research profiles:
..........................................................................................................................................
"Education is the manifestation of the perfection already in man" — Swami Vivekananda.
...........................................................................................................

SK Mustak

unread,
Sep 28, 2022, 12:52:37 PM9/28/22
to min...@googlegroups.com
Dear Leonardo German Arzamendia, I have edited 'Model.cfg'  with the user ID (highlighted in red) as follows:
Model file edited as follows:

# vim: set filetype=cfg:
#####key for ECMWF in Climate Data Store Application Program Interface
#Get it from https://retostauffer.org/code/Download-ERA5/
#for ERA5
[CDS]
key =  musta...@gmail.com :password # your-uid:your-api-key

#####The key to the new server for ECMWF
#Get it from https://software.ecmwf.int/wiki/display/WEBAPI/Accessing+ECMWF+data+servers+in+batch
#for ERA-Interim [outdated]
[ECMWF]
email = the-email-addre...@ecmwf-website.org
key =

#####Passwd and key for download from ucar
[ERA]
email = the-email-adres...@ucar-website.org
key =

#####No username/password is required for NARR
[NARR]

#####Username and password for download from NASA Earthdata
##pre-authorize the "NASA GESDISC DATA ARCHIVE" application in your account to download MERRA2
[MERRA]
user = the-user-name...@earthdata.nasa.gov
password = the-password-...@earthdata.nasa.gov

after running code on example data, as follows:
wget https://zenodo.org/record/3952950/files/WellsEnvD2T399.tar.xz tar -xvJf WellsEnvD2T399.tar.xz 
cd WellsEnvD2T399/mintpy 
smallbaselineApp.py ${MINTPY_HOME}/mintpy/data/input_files/WellsEnvD2T399.txt

Following error received 

dd/update the following configuration metadata:
['startDate', 'endDate', 'excludeDate', 'polynomial', 'periodic', 'stepDate', 'exp', 'log', 'uncertaintyQuantification', 'timeSeriesCovFile', 'bootstrapCount']
--------------------------------------------------
create HDF5 file: /home/mustak/WellsEnvD2T399/mintpy/velocity.h5 with w mode
create dataset  : intercept    of <class 'numpy.float32'>   in size of (508, 514)           with compression = None
create dataset  : interceptStd of <class 'numpy.float32'>   in size of (508, 514)           with compression = None
create dataset  : velocity     of <class 'numpy.float32'>   in size of (508, 514)           with compression = None
create dataset  : velocityStd  of <class 'numpy.float32'>   in size of (508, 514)           with compression = None
create dataset  : residue      of <class 'numpy.float32'>   in size of (508, 514)           with compression = None
add /intercept    attribute: UNIT = m
add /interceptStd attribute: UNIT = m
add /velocity     attribute: UNIT = m/year
add /velocityStd  attribute: UNIT = m/year
add /residue      attribute: UNIT = m
close  HDF5 file: /home/mustak/WellsEnvD2T399/mintpy/velocity.h5
reading data from file /home/mustak/WellsEnvD2T399/mintpy/timeseries_LOD_ERA5_demErr.h5 ...
skip pixels with zero/nan value in all acquisitions
number of pixels to invert: 1 out of 261112 (0.0%)
estimating time functions via linalg.lstsq ...
estimating time functions STD from time-series fitting residual ...
--------------------------------------------------
open  HDF5 file /home/mustak/WellsEnvD2T399/mintpy/velocity.h5 in a mode
writing dataset /intercept                 block: [0, 508, 0, 514]
close HDF5 file /home/mustak/WellsEnvD2T399/mintpy/velocity.h5.
--------------------------------------------------
open  HDF5 file /home/mustak/WellsEnvD2T399/mintpy/velocity.h5 in a mode
writing dataset /interceptStd              block: [0, 508, 0, 514]
close HDF5 file /home/mustak/WellsEnvD2T399/mintpy/velocity.h5.
--------------------------------------------------
open  HDF5 file /home/mustak/WellsEnvD2T399/mintpy/velocity.h5 in a mode
writing dataset /velocity                  block: [0, 508, 0, 514]
close HDF5 file /home/mustak/WellsEnvD2T399/mintpy/velocity.h5.
--------------------------------------------------
open  HDF5 file /home/mustak/WellsEnvD2T399/mintpy/velocity.h5 in a mode
writing dataset /velocityStd               block: [0, 508, 0, 514]
close HDF5 file /home/mustak/WellsEnvD2T399/mintpy/velocity.h5.
--------------------------------------------------
open  HDF5 file /home/mustak/WellsEnvD2T399/mintpy/velocity.h5 in a mode
writing dataset /residue                   block: [0, 508, 0, 514]
close HDF5 file /home/mustak/WellsEnvD2T399/mintpy/velocity.h5.
time used: 00 mins 0.1 secs.

timeseries2velocity.py /home/mustak/WellsEnvD2T399/mintpy/inputs/ERA5.h5 -t /home/mustak/WellsEnvD2T399/mintpy/smallbaselineApp.cfg -o /home/mustak/WellsEnvD2T399/mintpy/velocityERA5.h5 --update --ref-date 20070709 --ref-yx 403 52
read options from template file: smallbaselineApp.cfg
update mode: ON
1) output file /home/mustak/WellsEnvD2T399/mintpy/velocityERA5.h5 NOT found.
run or skip: run.
open timeseries file: ERA5.h5

Traceback (most recent call last):
  File "/home/mustak/tools/miniconda3/envs/insar/bin/smallbaselineApp.py", line 8, in <module>
    sys.exit(main())
  File "/home/mustak/tools/MintPy/mintpy/cli/smallbaselineApp.py", line 208, in main
    run_smallbaselineApp(inps)
  File "/home/mustak/tools/MintPy/mintpy/smallbaselineApp.py", line 1115, in run_smallbaselineApp
    app.run(steps=inps.runSteps)
  File "/home/mustak/tools/MintPy/mintpy/smallbaselineApp.py", line 912, in run
    self.run_timeseries2velocity(sname)
  File "/home/mustak/tools/MintPy/mintpy/smallbaselineApp.py", line 749, in run_timeseries2velocity
    mintpy.cli.timeseries2velocity.main(iargs)
  File "/home/mustak/tools/MintPy/mintpy/cli/timeseries2velocity.py", line 233, in main
    run_timeseries2time_func(inps)
  File "/home/mustak/tools/MintPy/mintpy/timeseries2velocity.py", line 138, in run_timeseries2time_func
    inps = read_date_info(inps)
  File "/home/mustak/tools/MintPy/mintpy/timeseries2velocity.py", line 92, in read_date_info
    ts_obj.open()
  File "/home/mustak/tools/MintPy/mintpy/objects/stack.py", line 173, in open
    self.get_metadata()
  File "/home/mustak/tools/MintPy/mintpy/objects/stack.py", line 215, in get_metadata
    self.metadata['REF_DATE'] = dateList[0]
IndexError: list index out of range

Please help me how to manage this error. Is this correct entry in the 'model.cfg' file  or what else I have to add there ? Please share some examples.  

Leonardo German Arzamendia

unread,
Sep 28, 2022, 1:24:34 PM9/28/22
to MintPy
Hi! Unfortunately you have comited a mistake setting the user information. For CDS you have to into your account and search your API number. You will find this in your user profile - View- API Key (it has to have 6 digits) and the password. and replace in model.cfg with the following format: 
[CDS]
key = your-uid:your-api-key

And for ECMWF you have to put your registration mail and password.

After that, it´s suposed that you will be able to run the script without any problem. 

Министр

unread,
Sep 28, 2022, 1:44:47 PM9/28/22
to min...@googlegroups.com
Hi Leonardo German Arzamendia, I have edited 'model.cfg' as follows
# vim: set filetype=cfg:
#####key for ECMWF in Climate Data Store Application Program Interface
#Get it from https://retostauffer.org/code/Download-ERA5/
#for ERA5
[CDS]
key =  15xyz6:3f98944b-9d6d-..........-da36576d5cc8  # your-uid:your-api-key


#####The key to the new server for ECMWF
#Get it from https://software.ecmwf.int/wiki/display/WEBAPI/Accessing+ECMWF+data+servers+in+batch
#for ERA-Interim [outdated]
[ECMWF]
email = musta...@gmail.com  #  the-email-addre...@ecmwf-website.org
key = password                


#####Passwd and key for download from ucar
[ERA]
email = the-email-adres...@ucar-website.org
key =

#####No username/password is required for NARR
[NARR]

#####Username and password for download from NASA Earthdata
##pre-authorize the "NASA GESDISC DATA ARCHIVE" application in your account to download MERRA2
[MERRA]
user = the-user-name...@earthdata.nasa.gov
password = the-password-...@earthdata.nasa.gov

following error received:

******************** step - velocity ********************

timeseries2velocity.py /home/mustak/WellsEnvD2T399/mintpy/timeseries_LOD_ERA5_demErr.h5 -t /home/mustak/WellsEnvD2T399/mintpy/smallbaselineApp.cfg -o /home/mustak/WellsEnvD2T399/mintpy/velocity.h5 --update

read options from template file: smallbaselineApp.cfg
update mode: ON
1) output file /home/mustak/WellsEnvD2T399/mintpy/velocity.h5 already exists.
2) output file is newer than input file: /home/mustak/WellsEnvD2T399/mintpy/timeseries_LOD_ERA5_demErr.h5.
3) all key configuration parameters are the same: ['startDate', 'endDate', 'excludeDate', 'polynomial', 'periodic', 'stepDate', 'exp', 'log', 'uncertaintyQuantification', 'timeSeriesCovFile', 'bootstrapCount'].
run or skip: skip.

please help me 


Thanking You
Yours Faithfully
  Sk. Mustak
........................................................................................................................................
Current Status
--
You received this message because you are subscribed to the Google Groups "MintPy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mintpy+un...@googlegroups.com.

SK Mustak

unread,
Sep 29, 2022, 4:11:16 AM9/29/22
to min...@googlegroups.com

please help me. error still there

Leonardo German Arzamendia

unread,
Sep 29, 2022, 7:21:32 AM9/29/22
to MintPy
Hi! Please try deleting your work directory, and run it again. 

SK Mustak

unread,
Sep 29, 2022, 8:51:28 AM9/29/22
to min...@googlegroups.com
dear Leonardo German Arzamendia, after deleting work director I run again but following error received as follows:
------------------------------------------------------------------------------

downloading weather model data using PyAPS ...
number of grib files to download: 8
------------------------------------------------------------------------------

INFO: You are using the latest ECMWF platform for downloading datasets: https://cds.climate.copernicus.eu/api/v2
Downloading 1 of 8: /home/mustak/WellsEnvD2T399/mintpy/ERA5/ERA5_N30_N50_W120_W110_20070709_18.grb
{'product_type': 'reanalysis', 'format': 'grib', 'variable': ['geopotential', 'temperature', 'specific_humidity'], 'pressure_level': ['1', '2', '3', '5', '7', '10', '20', '30', '50', '70', '100', '125', '150', '175', '200', '225', '250', '300', '350', '400', '450', '500', '550', '600', '650', '700', '750', '775', '800', '825', '850', '875', '900', '925', '950', '975', '1000'], 'year': '2007', 'month': '07', 'day': '09', 'time': '18:00', 'area': '50.00/-120.00/30.00/-110.00'}
2022-09-29 18:16:04,095 INFO Sending request to https://cds.climate.copernicus.eu/api/v2/resources/reanalysis-era5-pressure-levels
WARNING: the 1 attampt to download failed, retry it.

INFO: You are using the latest ECMWF platform for downloading datasets: https://cds.climate.copernicus.eu/api/v2
Downloading 1 of 8: /home/mustak/WellsEnvD2T399/mintpy/ERA5/ERA5_N30_N50_W120_W110_20070709_18.grb
{'product_type': 'reanalysis', 'format': 'grib', 'variable': ['geopotential', 'temperature', 'specific_humidity'], 'pressure_level': ['1', '2', '3', '5', '7', '10', '20', '30', '50', '70', '100', '125', '150', '175', '200', '225', '250', '300', '350', '400', '450', '500', '550', '600', '650', '700', '750', '775', '800', '825', '850', '875', '900', '925', '950', '975', '1000'], 'year': '2007', 'month': '07', 'day': '09', 'time': '18:00', 'area': '50.00/-120.00/30.00/-110.00'}
2022-09-29 18:16:04,095 INFO Sending request to https://cds.climate.copernicus.eu/api/v2/resources/reanalysis-era5-pressure-levels
WARNING: the 2 attampt to download failed, retry it.

INFO: You are using the latest ECMWF platform for downloading datasets: https://cds.climate.copernicus.eu/api/v2
Downloading 1 of 8: /home/mustak/WellsEnvD2T399/mintpy/ERA5/ERA5_N30_N50_W120_W110_20070709_18.grb
{'product_type': 'reanalysis', 'format': 'grib', 'variable': ['geopotential', 'temperature', 'specific_humidity'], 'pressure_level': ['1', '2', '3', '5', '7', '10', '20', '30', '50', '70', '100', '125', '150', '175', '200', '225', '250', '300', '350', '400', '450', '500', '550', '600', '650', '700', '750', '775', '800', '825', '850', '875', '900', '925', '950', '975', '1000'], 'year': '2007', 'month': '07', 'day': '09', 'time': '18:00', 'area': '50.00/-120.00/30.00/-110.00'}
2022-09-29 18:16:04,096 INFO Sending request to https://cds.climate.copernicus.eu/api/v2/resources/reanalysis-era5-pressure-levels


**************************************************
WARNING: downloading failed for 3 times, stop trying and continue.
**************************************************


update mode: ON
output file: /home/mustak/WellsEnvD2T399/mintpy/inputs/ERA5.h5
1) output file exists and is newer than all GRIB files.
2) output file does NOT have the same len/wid as the geometry file /home/mustak/WellsEnvD2T399/mintpy/inputs/geometryRadar.h5 or does NOT contain all dates
run or skip: run
open geometry file: geometryRadar.h5
reading incidenceAngle  data from file: /home/mustak/WellsEnvD2T399/mintpy/inputs/geometryRadar.h5 ...
reading height          data from file: /home/mustak/WellsEnvD2T399/mintpy/inputs/geometryRadar.h5 ...
--------------------------------------------------
create HDF5 file: /home/mustak/WellsEnvD2T399/mintpy/inputs/ERA5.h5 with w mode
create dataset  : date       of |S1                       in size of (0,)                 with compression = None
create dataset  : timeseries of <class 'numpy.float32'>   in size of (0, 508, 514)        with compression = None
close  HDF5 file: /home/mustak/WellsEnvD2T399/mintpy/inputs/ERA5.h5

------------------------------------------------------------------------------
calculating absolute delay for each date using PyAPS (Jolivet et al., 2011; 2014) ...
number of grib files used: 0

Traceback (most recent call last):
  File "/home/mustak/tools/miniconda3/envs/insar/bin/smallbaselineApp.py", line 8, in <module>
    sys.exit(main())
  File "/home/mustak/tools/MintPy/mintpy/cli/smallbaselineApp.py", line 208, in main
    run_smallbaselineApp(inps)
  File "/home/mustak/tools/MintPy/mintpy/smallbaselineApp.py", line 1115, in run_smallbaselineApp
    app.run(steps=inps.runSteps)
  File "/home/mustak/tools/MintPy/mintpy/smallbaselineApp.py", line 897, in run
    self.run_tropospheric_delay_correction(sname)
  File "/home/mustak/tools/MintPy/mintpy/smallbaselineApp.py", line 647, in run_tropospheric_delay_correction
    mintpy.cli.tropo_pyaps3.main(iargs)
  File "/home/mustak/tools/MintPy/mintpy/cli/tropo_pyaps3.py", line 161, in main
    run_tropo_pyaps3(inps)
  File "/home/mustak/tools/MintPy/mintpy/tropo_pyaps3.py", line 706, in run_tropo_pyaps3
    calc_delay_timeseries(inps)
  File "/home/mustak/tools/MintPy/mintpy/tropo_pyaps3.py", line 604, in calc_delay_timeseries
    prog_bar = ptime.progressBar(maxValue=num_date, print_msg=~inps.verbose)
  File "/home/mustak/tools/MintPy/mintpy/objects/progress.py", line 53, in __init__
    self.reset()
  File "/home/mustak/tools/MintPy/mintpy/objects/progress.py", line 58, in reset
    self.update_amount(0)  # Build progress bar string
  File "/home/mustak/tools/MintPy/mintpy/objects/progress.py", line 76, in update_amount
    percentDone = (diffFromMin / np.float(self.span)) * 100.0
ZeroDivisionError: float division by zero

Please the error and suggest me how to remove

Leonardo German Arzamendia

unread,
Sep 29, 2022, 9:57:09 AM9/29/22
to MintPy
Ok, don't worry about it because it´s probably that the server is momentaly unavailable. It's happen to me before, and after a few attemps it works correctly.

Министр

unread,
Sep 29, 2022, 3:25:50 PM9/29/22
to min...@googlegroups.com
Thank you for your response

Kurt Feigl

unread,
Nov 27, 2023, 2:21:38 PM11/27/23
to MintPy
This issue occurs when PyAps tries to download weather data (GRIB files) from the ECMWF. Rather than deal with the file named model.cfg, which must be in a special place among the source code for MintPy, you can set up a file named .cdsapirc Note that this filename must include the leading dot and that it must reside in your $HOME directory (folder).  Here is a (fake) example:

key: 12345:abcdefghij-134-abcdefgadf-82391b9d3f

Note that the key should have numbers in the part before the colon and dashes in the part after the colon. Here are more instructions and a way to test: https://github.com/insarlab/PyAPS

Alternatively, if you aren't too concerned about atmospheric artifacts, you can turn off pyaps and use a much simpler approach that models the atmospheric delay as directly proportional to the (negative) of the topographic elevation. 

## need to manually download GACOS products at http://www.gacos.net for all acquisitions before running this step
mintpy.troposphericDelay.method = height_correlation #[pyaps / height_correlation / gacos / no], auto for pyaps


This approach has the (musical;-) nick-name "topo-non-tropo". For more explanation, see Figure 7 of Massonnet, D., and K. L. Feigl (1998), Radar interferometry and its application to changes in the Earth's surface, Reviews of Geophysics, 36, 441-500. https://doi.org/10.1029/97RG03139



Reply all
Reply to author
Forward
0 new messages