timcera / tsgettoolbox

Command line script and Python package to get weather and hydrologic time-series from Internet services.
BSD 3-Clause "New" or "Revised" License
18 stars 3 forks source link

Getting all 0s for MODIS where values should be different #4

Closed fischhoff closed 5 years ago

fischhoff commented 5 years ago

Thanks for creating this! I'm getting all zeros for land cover, in a location (the desert) that should not have zeros. I'm getting the same results in a Jupyter notebook as from terminal.

#Get land cover for point in Sahara (googled "lat long Sahara")
lat = 23.4162
lon = 25.6628
product = "MCD12Q1"

#https://lpdaac.usgs.gov/dataset_discovery/modis/modis_products_table/mcd12q1_v006
#Land Cover Type 1: Annual International Geosphere-Biosphere Programme (IGBP) classification
#Valid range 1 to 17
#band = "Land_Cover_Type_1"#this is not recognized by the function; error message indicates accepted bands
band = "LC_Type1"
startdate = "2001-01-01"
enddate = "2002-01-01"
output = tsgettoolbox.modis(lat=lat, 
                            lon=lon, 
                            product=product, 
                            band=band, 
                            startdate=startdate, 
                            enddate=enddate)
output

Datetime,MCD12Q1_LC_Type1:class 2001-01-01,0 2002-01-01,0 2003-01-01,0 2004-01-01,0 2005-01-01,0 2006-01-01,0 2007-01-01,0 2008-01-01,0 2009-01-01,0 2010-01-01,0 2011-01-01,0

I get the same results when I try a few other locations in the world and a few other bands. I also notice that I'm getting back results for dates outside the start and end date I'd indicated. Any advice much appreciated, recognizing this may be user error!

timcera commented 5 years ago

Thank you for bringing this to my attention. I have resolved these issues are they are corrected in version 17.35.11.18 currently available from PyPI.

Kindest regards, Tim

fischhoff commented 5 years ago

Hi @timcera thanks for letting me know that I was using an older version of the package. Would you have troubleshooting advice on installing? Installing in a fresh environment, I get an error about a missing file. I got a similar error when installing using pip. Thanks again!

(yourenvname) [16:10:58] ~ // ♥ easy_install tsgettoolbox Searching for tsgettoolbox Reading https://pypi.org/simple/tsgettoolbox/ Downloading https://files.pythonhosted.org/packages/9f/0b/c7d2092c10563e460d11ac87d88795eb973982a5f29047be850c38b64a81/tsgettoolbox-17.35.11.18.tar.gz#sha256=1951765f67c50b5886bf07301c2efb4037f4f55d361002936e3f5ffd466d0deb Best match: tsgettoolbox 17.35.11.18 Processing tsgettoolbox-17.35.11.18.tar.gz Writing /var/folders/0d/qm_pqljx11s_ddc42g1_yscr0000gn/T/easy_install-10keo93c/tsgettoolbox-17.35.11.18/setup.cfg Running tsgettoolbox-17.35.11.18/setup.py -q bdist_egg --dist-dir /var/folders/0d/qm_pqljx11s_ddc42g1_yscr0000gn/T/easy_install-10keo93c/tsgettoolbox-17.35.11.18/egg-dist-tmp-qk6dv67w error: [Errno 2] No such file or directory: 'etc/requirements_bokeh.txt'

timcera commented 5 years ago

Should be fixed and new version posted on PyPI. Please try again. Was able to test on my machine with "pip", hopefully "easy_install" will work also.

fischhoff commented 5 years ago

Thanks again for your help. I tried installing in Google Colab. It appeared to install successfully, but then I wasn't able to import. Showing results with easy_install; result was same with pip.

!easy_install tsgettoolbox

Searching for tsgettoolbox Reading https://pypi.org/simple/tsgettoolbox/ Downloading https://files.pythonhosted.org/packages/c5/05/132037e19f1c2c86d2f99d3e8c9801d581016ad99b3f4c0228841764aeb9/tsgettoolbox-17.36.11.18.tar.gz#sha256=543f99ded58bb5e282d7b486835d06232cf785785732efc6b2d797ca62a272ed Best match: tsgettoolbox 17.36.11.18 Processing tsgettoolbox-17.36.11.18.tar.gz Writing /tmp/easy_install-ccX_o7/tsgettoolbox-17.36.11.18/setup.cfg Running tsgettoolbox-17.36.11.18/setup.py -q bdist_egg --dist-dir /tmp/easy_install-ccX_o7/tsgettoolbox-17.36.11.18/egg-dist-tmp-cL08AI creating /usr/local/lib/python2.7/dist-packages/tsgettoolbox-17.36.11.18-py2.7.egg Extracting tsgettoolbox-17.36.11.18-py2.7.egg to /usr/local/lib/python2.7/dist-packages Adding tsgettoolbox 17.36.11.18 to easy-install.pth file Installing tsgettoolbox script to /usr/local/bin Installed /usr/local/lib/python2.7/dist-packages/tsgettoolbox-17.36.11.18-py2.7.egg Processing dependencies for tsgettoolbox Searching for zeep Reading https://pypi.org/simple/zeep/ Downloading https://files.pythonhosted.org/packages/96/67/1b21bbeb72a3f76839b0fb16941f2592af7289b5b15788446acee7bb8023/zeep-3.3.0-py2.py3-none-any.whl#sha256=a9043f52f9357ff9beafb0f9a9dfa05653b126e9f0d778645a6b1201de3f9e81 Best match: zeep 3.3.0 Processing zeep-3.3.0-py2.py3-none-any.whl Installing zeep-3.3.0-py2.py3-none-any.whl to /usr/local/lib/python2.7/dist-packages writing requirements to /usr/local/lib/python2.7/dist-packages/zeep-3.3.0-py2.7.egg/EGG-INFO/requires.txt Adding zeep 3.3.0 to easy-install.pth file Installed /usr/local/lib/python2.7/dist-packages/zeep-3.3.0-py2.7.egg Searching for tstoolbox>=22.55.29.20 Reading https://pypi.org/simple/tstoolbox/ Downloading https://files.pythonhosted.org/packages/37/12/355622acadd208891c96cb5f8cc56e413cc410c516a05ad4e3bb1ac56eea/tstoolbox-31.80.35.25.tar.gz#sha256=fa78c9844380db887f8a11b79d3308bf98e6220d144d0f2dc4deee0a09bb6401 Best match: tstoolbox 31.80.35.25 Processing tstoolbox-31.80.35.25.tar.gz Writing /tmp/easy_install-UCSUTe/tstoolbox-31.80.35.25/setup.cfg Running tstoolbox-31.80.35.25/setup.py -q bdist_egg --dist-dir /tmp/easy_install-UCSUTe/tstoolbox-31.80.35.25/egg-dist-tmp-MPOfRB warning: no files found matching 'tstoolbox/skill_metrics/README_SkillMetrics.txt' creating /usr/local/lib/python2.7/dist-packages/tstoolbox-31.80.35.25-py2.7.egg Extracting tstoolbox-31.80.35.25-py2.7.egg to /usr/local/lib/python2.7/dist-packages Adding tstoolbox 31.80.35.25 to easy-install.pth file Installing tstoolbox script to /usr/local/bin Installed /usr/local/lib/python2.7/dist-packages/tstoolbox-31.80.35.25-py2.7.egg Searching for suds-jurko Reading https://pypi.org/simple/suds-jurko/ Downloading https://files.pythonhosted.org/packages/d0/88/f3bed9b494e0dae26bd55e5f3d527b8244208125024727267e8109956a11/suds-jurko-0.6.zip#sha256=1cb7252cb13018fc32887c3a834ed7c6648a5b5c4c159be5806da2e1785399e8 Best match: suds-jurko 0.6 Processing suds-jurko-0.6.zip Writing /tmp/easy_install-YkpQu3/suds-jurko-0.6/setup.cfg Running suds-jurko-0.6/setup.py -q bdist_egg --dist-dir /tmp/easy_install-YkpQu3/suds-jurko-0.6/egg-dist-tmp-BI_lKj zip_safe flag not set; analyzing archive contents... Moving suds_jurko-0.6-py2.7.egg to /usr/local/lib/python2.7/dist-packages Adding suds-jurko 0.6 to easy-install.pth file Installed /usr/local/lib/python2.7/dist-packages/suds_jurko-0.6-py2.7.egg Searching for networkx<2.0 Reading https://pypi.org/simple/networkx/ Downloading https://files.pythonhosted.org/packages/d3/2c/e473e54afc9fae58dfa97066ef6709a7e35a1dd1c28c5a3842989322be00/networkx-1.11-py2.py3-none-any.whl#sha256=1b229b54fe9ccb009cee4de02a88552191497a542a7d5d34adab216b9f15c1ff Best match: networkx 1.11 Processing networkx-1.11-py2.py3-none-any.whl Installing networkx-1.11-py2.py3-none-any.whl to /usr/local/lib/python2.7/dist-packages writing requirements to /usr/local/lib/python2.7/dist-packages/networkx-1.11-py2.7.egg/EGG-INFO/requires.txt Adding networkx 1.11 to easy-install.pth file Installed /usr/local/lib/python2.7/dist-packages/networkx-1.11-py2.7.egg Searching for multipledispatch>=0.4.7 Reading https://pypi.org/simple/multipledispatch/ Downloading https://files.pythonhosted.org/packages/3d/a3/3638c2232eb513a9f876bb96e2e400f18d2f5bdc2e7abe84194c8bd38c2d/multipledispatch-0.6.0-py2-none-any.whl#sha256=407e6d8c5fa27075968ba07c4db3ef5f02bea4e871e959570eeb69ee39a6565b Best match: multipledispatch 0.6.0 Processing multipledispatch-0.6.0-py2-none-any.whl Installing multipledispatch-0.6.0-py2-none-any.whl to /usr/local/lib/python2.7/dist-packages writing requirements to /usr/local/lib/python2.7/dist-packages/multipledispatch-0.6.0-py2.7.egg/EGG-INFO/requires.txt Adding multipledispatch 0.6.0 to easy-install.pth file Installed /usr/local/lib/python2.7/dist-packages/multipledispatch-0.6.0-py2.7.egg Searching for isodate Reading https://pypi.org/simple/isodate/ Downloading https://files.pythonhosted.org/packages/9b/9f/b36f7774ff5ea8e428fdcfc4bb332c39ee5b9362ddd3d40d9516a55221b2/isodate-0.6.0-py2.py3-none-any.whl#sha256=aa4d33c06640f5352aca96e4b81afd8ab3b47337cc12089822d6f322ac772c81 Best match: isodate 0.6.0 Processing isodate-0.6.0-py2.py3-none-any.whl Installing isodate-0.6.0-py2.py3-none-any.whl to /usr/local/lib/python2.7/dist-packages writing requirements to /usr/local/lib/python2.7/dist-packages/isodate-0.6.0-py2.7.egg/EGG-INFO/requires.txt Adding isodate 0.6.0 to easy-install.pth file Installed /usr/local/lib/python2.7/dist-packages/isodate-0.6.0-py2.7.egg Searching for html5lib<=0.9999999 Reading https://pypi.org/simple/html5lib/ Downloading https://files.pythonhosted.org/packages/ae/ae/bcb60402c60932b32dfaf19bb53870b29eda2cd17551ba5639219fb5ebf9/html5lib-0.9999999.tar.gz#sha256=2612a191a8d5842bfa057e41ba50bbb9dcb722419d2408c78cff4758d0754868 Best match: html5lib 0.9999999 Processing html5lib-0.9999999.tar.gz Writing /tmp/easy_install-r8JvlC/html5lib-0.9999999/setup.cfg Running html5lib-0.9999999/setup.py -q bdist_egg --dist-dir /tmp/easy_install-r8JvlC/html5lib-0.9999999/egg-dist-tmp-UvMXT9 zip_safe flag not set; analyzing archive contents... Moving html5lib-0.9999999-py2.7.egg to /usr/local/lib/python2.7/dist-packages Adding html5lib 0.9999999 to easy-install.pth file Installed /usr/local/lib/python2.7/dist-packages/html5lib-0.9999999-py2.7.egg Searching for geojson Reading https://pypi.org/simple/geojson/ Downloading https://files.pythonhosted.org/packages/f1/34/bc3a65faabce27a7faa755ab08d811207a4fc438f77ef09c229fc022d778/geojson-2.4.1-py2.py3-none-any.whl#sha256=b2bfb5c8e6b4b0c55dd139996317145aa8526146b3f8570586f9613c527a648a Best match: geojson 2.4.1 Processing geojson-2.4.1-py2.py3-none-any.whl Installing geojson-2.4.1-py2.py3-none-any.whl to /usr/local/lib/python2.7/dist-packages Adding geojson 2.4.1 to easy-install.pth file Installed /usr/local/lib/python2.7/dist-packages/geojson-2.4.1-py2.7.egg Searching for datashape>=0.5.0 Reading https://pypi.org/simple/datashape/ Downloading https://files.pythonhosted.org/packages/a6/5b/95b2ed56b61e649b69c9a5b1ecb32ff0a5cd68b9f69f5aa7774540e6b444/datashape-0.5.2.tar.gz#sha256=2356ea690c3cf003c1468a243a9063144235de45b080b3652de4f3d44e57d783 Best match: datashape 0.5.2 Processing datashape-0.5.2.tar.gz Writing /tmp/easy_install-rF0Eqo/datashape-0.5.2/setup.cfg Running datashape-0.5.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-rF0Eqo/datashape-0.5.2/egg-dist-tmp-XzEjzY UPDATING build/lib.linux-x86_64-2.7/datashape/_version.py set build/lib.linux-x86_64-2.7/datashape/_version.py to '0.5.2' creating /usr/local/lib/python2.7/dist-packages/datashape-0.5.2-py2.7.egg Extracting datashape-0.5.2-py2.7.egg to /usr/local/lib/python2.7/dist-packages Adding datashape 0.5.2 to easy-install.pth file Installed /usr/local/lib/python2.7/dist-packages/datashape-0.5.2-py2.7.egg Searching for appdirs Reading https://pypi.org/simple/appdirs/ Downloading https://files.pythonhosted.org/packages/56/eb/810e700ed1349edde4cbdc1b2a21e28cdf115f9faf263f6bbf8447c1abf3/appdirs-1.4.3-py2.py3-none-any.whl#sha256=d8b24664561d0d34ddfaec54636d502d7cea6e29c3eaf68f3df6180863e2166e Best match: appdirs 1.4.3 Processing appdirs-1.4.3-py2.py3-none-any.whl Installing appdirs-1.4.3-py2.py3-none-any.whl to /usr/local/lib/python2.7/dist-packages Adding appdirs 1.4.3 to easy-install.pth file Installed /usr/local/lib/python2.7/dist-packages/appdirs-1.4.3-py2.7.egg Searching for requests-toolbelt>=0.7.1 Reading https://pypi.org/simple/requests-toolbelt/ Downloading https://files.pythonhosted.org/packages/60/ef/7681134338fc097acef8d9b2f8abe0458e4d87559c689a8c306d0957ece5/requests_toolbelt-0.9.1-py2.py3-none-any.whl#sha256=380606e1d10dc85c3bd47bf5a6095f815ec007be7a8b69c878507068df059e6f Best match: requests-toolbelt 0.9.1 Processing requests_toolbelt-0.9.1-py2.py3-none-any.whl Installing requests_toolbelt-0.9.1-py2.py3-none-any.whl to /usr/local/lib/python2.7/dist-packages writing requirements to /usr/local/lib/python2.7/dist-packages/requests_toolbelt-0.9.1-py2.7.egg/EGG-INFO/requires.txt Adding requests-toolbelt 0.9.1 to easy-install.pth file Installed /usr/local/lib/python2.7/dist-packages/requests_toolbelt-0.9.1-py2.7.egg Searching for cached-property>=1.3.0 Reading https://pypi.org/simple/cached-property/ Downloading https://files.pythonhosted.org/packages/3b/86/85c1be2e8db9e13ef9a350aecd6dea292bd612fa288c2f40d035bb750ded/cached_property-1.5.1-py2.py3-none-any.whl#sha256=3a026f1a54135677e7da5ce819b0c690f156f37976f3e30c5430740725203d7f Best match: cached-property 1.5.1 Processing cached_property-1.5.1-py2.py3-none-any.whl Installing cached_property-1.5.1-py2.py3-none-any.whl to /usr/local/lib/python2.7/dist-packages Adding cached-property 1.5.1 to easy-install.pth file Installed /usr/local/lib/python2.7/dist-packages/cached_property-1.5.1-py2.7.egg Searching for xlsxwriter Reading https://pypi.org/simple/xlsxwriter/ Downloading https://files.pythonhosted.org/packages/6e/57/8c0fe0f6d8a4c57c32528c8b1b31c0daba53af33cd3afedf3fcb0971c75a/XlsxWriter-1.1.5-py2.py3-none-any.whl#sha256=df96eafc3136d9e790e35d6725b473e46ada6f585c1f6519da69b27f5c8873f7 Best match: XlsxWriter 1.1.5 Processing XlsxWriter-1.1.5-py2.py3-none-any.whl Installing XlsxWriter-1.1.5-py2.py3-none-any.whl to /usr/local/lib/python2.7/dist-packages Adding XlsxWriter 1.1.5 to easy-install.pth file Installing vba_extract.py script to /usr/local/bin Installed /usr/local/lib/python2.7/dist-packages/XlsxWriter-1.1.5-py2.7.egg Searching for pint Reading https://pypi.org/simple/pint/ Downloading https://files.pythonhosted.org/packages/15/9d/bf177ebbc57d25e9e296addc14a1303d1e34d7964af5df428a8332349c42/Pint-0.9-py2.py3-none-any.whl#sha256=7ece3f639ad58073ce49982b022d464014e6d91d0b3eaa89c8e8ea9c38e32659 Best match: Pint 0.9 Processing Pint-0.9-py2.py3-none-any.whl Installing Pint-0.9-py2.py3-none-any.whl to /usr/local/lib/python2.7/dist-packages writing requirements to /usr/local/lib/python2.7/dist-packages/Pint-0.9-py2.7.egg/EGG-INFO/requires.txt Adding Pint 0.9 to easy-install.pth file Installed /usr/local/lib/python2.7/dist-packages/Pint-0.9-py2.7.egg Searching for rst2ansi>=0.1.5 Reading https://pypi.org/simple/rst2ansi/ Downloading https://files.pythonhosted.org/packages/3c/19/b29bc04524e7d1dbde13272fbb67e45a8eb24bb6d112cf10c46162b350d7/rst2ansi-0.1.5.tar.gz#sha256=1b17fb9a628d40f57933ad1a3aa952346444be069469508e73e95060da33fe6f Best match: rst2ansi 0.1.5 Processing rst2ansi-0.1.5.tar.gz Writing /tmp/easy_install-JQKzsX/rst2ansi-0.1.5/setup.cfg Running rst2ansi-0.1.5/setup.py -q bdist_egg --dist-dir /tmp/easy_install-JQKzsX/rst2ansi-0.1.5/egg-dist-tmp-vF9CvT zip_safe flag not set; analyzing archive contents... Moving rst2ansi-0.1.5-py2.7.egg to /usr/local/lib/python2.7/dist-packages Adding rst2ansi 0.1.5 to easy-install.pth file Installing rst2ansi script to /usr/local/bin Installed /usr/local/lib/python2.7/dist-packages/rst2ansi-0.1.5-py2.7.egg Searching for mando>=0.4 Reading https://pypi.org/simple/mando/ Downloading https://files.pythonhosted.org/packages/e6/cc/f6e25247c1493a654785e68cd975e479c311e99dafedd49ed17f8d300e0c/mando-0.6.4-py2.py3-none-any.whl#sha256=4ce09faec7e5192ffc3c57830e26acba0fd6cd11e1ee81af0d4df0657463bd1c Best match: mando 0.6.4 Processing mando-0.6.4-py2.py3-none-any.whl Installing mando-0.6.4-py2.py3-none-any.whl to /usr/local/lib/python2.7/dist-packages writing requirements to /usr/local/lib/python2.7/dist-packages/mando-0.6.4-py2.7.egg/EGG-INFO/requires.txt Adding mando 0.6.4 to easy-install.pth file Installed /usr/local/lib/python2.7/dist-packages/mando-0.6.4-py2.7.egg Searching for dateparser Reading https://pypi.org/simple/dateparser/ Downloading https://files.pythonhosted.org/packages/a0/30/5cb8bb214c0b111fb59137c2e19c636a136209dbe45e1c3e9d63f7a76c1a/dateparser-0.7.1-py2.py3-none-any.whl#sha256=78124c458c461ea7198faa3c038f6381f37588b84bb42740e91a4cbd260b1d09 Best match: dateparser 0.7.1 Processing dateparser-0.7.1-py2.py3-none-any.whl Installing dateparser-0.7.1-py2.py3-none-any.whl to /usr/local/lib/python2.7/dist-packages writing requirements to /usr/local/lib/python2.7/dist-packages/dateparser-0.7.1-py2.7.egg/EGG-INFO/requires.txt Adding dateparser 0.7.1 to easy-install.pth file Installed /usr/local/lib/python2.7/dist-packages/dateparser-0.7.1-py2.7.egg Finished processing dependencies for tsgettoolbox

from tsgettoolbox import tsgettoolbox


ModuleNotFoundError Traceback (most recent call last)

in () ----> 1 from tsgettoolbox import tsgettoolbox /usr/local/lib/python3.6/dist-packages/tsgettoolbox/tsgettoolbox.py in () 33 34 from .functions.cdec import cdec ---> 35 from .functions.coops import coops 36 from .functions.cpc import cpc 37 from .functions.darksky import darksky /usr/local/lib/python3.6/dist-packages/tsgettoolbox/functions/coops.py in () 1 2 import mando ----> 3 from tsgettoolbox.odo import odo, resource 4 import pandas as pd 5 /usr/local/lib/python3.6/dist-packages/tsgettoolbox/odo/__init__.py in () 19 from .drop import drop 20 from .temp import Temp ---> 21 from .backends.text import TextFile 22 from .chunks import chunks, Chunks 23 from datashape import discover, dshape ModuleNotFoundError: No module named 'tsgettoolbox.odo.backends' --------------------------------------------------------------------------- NOTE: If your import is failing due to a missing package, you can manually install dependencies using either !pip or !apt. To view examples of installing some common dependencies, click the "Open Examples" button below. --------------------------------------------------------------------------- On Tue, Mar 5, 2019 at 10:06 PM timcera wrote: > Should be fixed and new version posted on PyPI. Please try again. Was able > to test on my machine with "pip", hopefully "easy_install" will work also. > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > , > or mute the thread > > . >
timcera commented 5 years ago

I forgot to make a clean install. Apologies. The new version that I just posted to PyPI should be fixed.

fischhoff commented 5 years ago

Thank you Tim, it worked! Much appreciated. Best Ilya

On Fri, Mar 8, 2019 at 10:25 PM timcera notifications@github.com wrote:

I forgot to make a clean install. Apologies. The new version that I just posted to PyPI should be fixed.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/timcera/tsgettoolbox/issues/4#issuecomment-471141299, or mute the thread https://github.com/notifications/unsubscribe-auth/AH28fNx82S5KTgsYYJN_tAFKxw6uOAzmks5vUym0gaJpZM4bTCVE .