Opened 4 years ago

Closed 4 years ago

#4016 closed defect (worksforme)

i.modis.download Attribute Error

Reported by: Gabriel De Luca Owned by: grass-dev@…
Priority: normal Milestone:
Component: Addons Version: unspecified
Keywords: Cc:
CPU: Unspecified Platform: Linux

Description

Running GRASS GIS 7.8.2, in Ubuntu 18.04 (bionic).

I have installed pymodis library via pip3 succesfully. Also, I have installed i.modis add-on.

I have created an executable bash file, named import_modis.sh, to download MODIS Land Surface Temperature products:

#!/bin/bash

i.modis.download settings=$HOME/settings \
 product=lst_terra_monthly_5600 \
 tile=h11v05 \
 startday=2015-01-01 endday=2017-12-31 \
 folder=/tmp

Where settings is the name of a text file in my home folder, with one line for my user and one line for my password at earthexplorer site.

When I run: grass78 /home/ga/grassdata/nc_basic_spm_grass7/modis_lst --exec sh import_modis.sh, it returns:

Starting GRASS GIS...
Cleaning up temporary files...
Executing <sh import_modis.sh> ...
WxPython missing, no GUI enabled
Traceback (most recent call last):
  File "/home/ga/.grass7/addons/scripts/i.modis.download", line 274, in <module>
    sys.exit(main())
  File "/home/ga/.grass7/addons/scripts/i.modis.download", line 246, in main
    prod = product(produ).returned()
  File "/home/ga/.grass7/addons/etc/i.modis/rmodislib.py", line 302, in returned
    if self.products.keys().count(self.prod) == 1:
AttributeError: 'dict_keys' object has no attribute 'count'
Execution of <sh import_modis.sh> finished.
Cleaning up default sqlite database ...
Cleaning up temporary files...

I could not find information to help me solve if it is a problem in my implementation. Nor did I find a similar previous report here.

Any detail or clarification that is necessary do not hesitate to ask me.

Change History (6)

comment:1 by Gabriel De Luca, 4 years ago

Summary: i.modis.import Attribute Errori.modis.download Attribute Error

comment:2 by lucadelu, 4 years ago

Hi Gabriel,

I'm sorry but I'm not able to reproduce your error. I copied your script changing the enddate.

grass78 ~/grassdata/utm32N/lucadelu/ --exec sh /tmp/import_modis.sh
Starting GRASS GIS...
Cleaning up temporary files...
Executing <sh /tmp/import_modis.sh> ...
WARNING: GRASS GIS libgis version and date number not available
Downloading MODIS product <lst_terra_monthly_5600>...
All data have been downloaded, continue with i.modis.import with the option
'files=/tmp/listfileMOD11B3.006.txt'
Execution of <sh /tmp/import_modis.sh> finished.
Cleaning up default sqlite database ...
Cleaning up temporary files...
lucadelu@geowork:~/github/grass$ cat /tmp/listfileMOD11B3.006.txt
MOD11B3.A2015001.h11v05.006.2016222155421.hdf
MOD11B3.A2015001.h11v05.006.2016222155421.hdf.xml

comment:3 by Gabriel De Luca, 4 years ago

Hi Luca,

Thanks for trying to reproduce it.

Something in my installation must be missing then, but I can't realize what it is.

comment:4 by lucadelu, 4 years ago

Hi Gabriel,

it seems that you have a old version of the addon.

Instead the line 302 now is

if list(self.products.keys()).count(self.prod) == 1:

instead your line seems to be

if self.products.keys().count(self.prod) == 1:

comment:5 by Gabriel De Luca, 4 years ago

Luca, thank you very much for your help.

Unfortunately I corrupted the GRASS installation in which I was reproducing that project and I am no longer being able to reinstall it correctly.

I think that closing this ticket would be the most convenient, since you have seen that it was an outdated plugin problem.

If I could reproduce the problem in the future, I will likely to start a new ticket on github or add a new comment here.

Thanks again.

Gabriel

comment:6 by lucadelu, 4 years ago

Resolution: worksforme
Status: newclosed

Please reopen if needed

Note: See TracTickets for help on using tickets.