{"action":"created","issue":{"url":"https://api.github.com/repos/ceholden/yatsm/issues/94","repository_url":"https://api.github.com/repos/ceholden/yatsm","labels_url":"https://api.github.com/repos/ceholden/yatsm/issues/94/labels{/name}","comments_url":"https://api.github.com/repos/ceholden/yatsm/issues/94/comments","events_url":"https://api.github.com/repos/ceholden/yatsm/issues/94/events","html_url":"https://github.com/ceholden/yatsm/issues/94","id":171515163,"number":94,"title":"Cache error: TypeError: long() argument must be a string or a number, not 'NoneType'","user":{"login":"johanna-bernal","id":20731813,"avatar_url":"https://avatars.githubusercontent.com/u/20731813?v=3","gravatar_id":"","url":"https://api.github.com/users/johanna-bernal","html_url":"https://github.com/johanna-bernal","followers_url":"https://api.github.com/users/johanna-bernal/followers","following_url":"https://api.github.com/users/johanna-bernal/following{/other_user}","gists_url":"https://api.github.com/users/johanna-bernal/gists{/gist_id}","starred_url":"https://api.github.com/users/johanna-bernal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johanna-bernal/subscriptions","organizations_url":"https://api.github.com/users/johanna-bernal/orgs","repos_url":"https://api.github.com/users/johanna-bernal/repos","events_url":"https://api.github.com/users/johanna-bernal/events{/privacy}","received_events_url":"https://api.github.com/users/johanna-bernal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-16T20:54:14Z","updated_at":"2016-08-25T02:24:32Z","closed_at":null,"body":"When I run the cache function in the terminal of Ubuntu I get this error: TypeError: long() argument must be a string or a number, not 'NoneType'.\r\nI do not know how to fix it. I have tried different options like change the job number the total jobs, the locations and directories where I have the .csv, the input images (Landsat 7. Envi BSQ), the folder of the output and also the parameter called prediction. But it has not worked. Thanks in advance for your help\r\n\r\n[p007r059yaml.txt](https://github.com/ceholden/yatsm/files/421268/p007r059yaml.txt)\r\n\r\n(yatsm_venv)ideam@ideam-Precision-WorkStation-T7500:~$ yatsm cache /home/ideam/yatsm/7_59/p007r059/p007r059.yaml 1 8\r\n/home/ideam/yatsm_venv/local/lib/python2.7/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.\r\n  warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')\r\nTraceback (most recent call last):\r\n  File \"/home/ideam/yatsm_venv/bin/yatsm\", line 9, in <module>\r\n    load_entry_point('yatsm==0.6.1', 'console_scripts', 'yatsm')()\r\n  File \"/home/ideam/yatsm_venv/local/lib/python2.7/site-packages/click/core.py\", line 716, in __call__\r\n    return self.main(*args, **kwargs)\r\n  File \"/home/ideam/yatsm_venv/local/lib/python2.7/site-packages/click/core.py\", line 696, in main\r\n    rv = self.invoke(ctx)\r\n  File \"/home/ideam/yatsm_venv/local/lib/python2.7/site-packages/click/core.py\", line 1060, in invoke\r\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\r\n  File \"/home/ideam/yatsm_venv/local/lib/python2.7/site-packages/click/core.py\", line 889, in invoke\r\n    return ctx.invoke(self.callback, **ctx.params)\r\n  File \"/home/ideam/yatsm_venv/local/lib/python2.7/site-packages/click/core.py\", line 534, in invoke\r\n    return callback(*args, **kwargs)\r\n  File \"/home/ideam/yatsm_venv/local/lib/python2.7/site-packages/click/decorators.py\", line 17, in new_func\r\n    return f(get_current_context(), *args, **kwargs)\r\n  File \"/home/ideam/yatsm/yatsm/cli/cache.py\", line 108, in cache\r\n    Y = io.gdal_reader.read_row(df['filename'], job_line)\r\n  File \"/home/ideam/yatsm/yatsm/io/stack_line_readers.py\", line 155, in read_row\r\n    return self._read_row(row)\r\n  File \"/home/ideam/yatsm/yatsm/io/stack_line_readers.py\", line 138, in _read_row\r\n    data[n_b, i, :] = band.ReadAsArray(0, row, self.n_col, 1)\r\nTypeError: long() argument must be a string or a number, not 'NoneType'\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ceholden/yatsm/issues/comments/242264427","html_url":"https://github.com/ceholden/yatsm/issues/94#issuecomment-242264427","issue_url":"https://api.github.com/repos/ceholden/yatsm/issues/94","id":242264427,"user":{"login":"ceholden","id":3585769,"avatar_url":"https://avatars.githubusercontent.com/u/3585769?v=3","gravatar_id":"","url":"https://api.github.com/users/ceholden","html_url":"https://github.com/ceholden","followers_url":"https://api.github.com/users/ceholden/followers","following_url":"https://api.github.com/users/ceholden/following{/other_user}","gists_url":"https://api.github.com/users/ceholden/gists{/gist_id}","starred_url":"https://api.github.com/users/ceholden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceholden/subscriptions","organizations_url":"https://api.github.com/users/ceholden/orgs","repos_url":"https://api.github.com/users/ceholden/repos","events_url":"https://api.github.com/users/ceholden/events{/privacy}","received_events_url":"https://api.github.com/users/ceholden/received_events","type":"User","site_admin":false},"created_at":"2016-08-25T02:24:32Z","updated_at":"2016-08-25T02:24:32Z","body":"Hi Johanna\r\n\r\nThanks for providing the additional information. Unfortunately I'm still at a loss for an explanation. What's really curious to me is that I've tried substituting `None` into both the assignment (`data[n_b, i, :]`) and the GDAL call (`band.ReadAsArray(0, row, self.n_col, 1)`) and putting `None` into any of the possible argument values never produces the error you've described.\r\n\r\nThe metadata you see in QGIS is probably okay -- I think it's just information that ENVI has added into the header of its file format to describe what it should show in its user interface. The bands aren't actually TIF files but ENVI keeps track of the names of the TIF files the bands came from.\r\n\r\nI have three proposals for continuing to debug this issue:\r\n\r\n1. I added some debugging logging statements to the line in question and committed these changes to the branch \"johanna\". You could use git to retrieve these changes, re-run the same command, and then post the results. If you want to go this route, you would run the following commands (assuming you have the `yatsm` repository downloaded into your home folder as the TSTools VM does):\r\n    * `cd ~/yatsm`\r\n    * `git fetch --all`\r\n    * `git checkout johanna`\r\n    * `pip install -e .`\r\n    * `yatsm -v cache /home/ideam/yatsm/7_59/p007r059/p007r059.yaml 1 8`\r\n    * I didn't change any other code, so it should reach the same failure point. This time, however, there will be even more information to check.\r\n2. It might be easiest to debug if you could send a few of the images to me via FTP. Unfortunately I think our university department's incoming \"drop\" server is closed for good, but I'd be able to download the images via FTP, Dropbox, Google Drive, or other hosting solutions.\r\n3. If not option 2, then it might be helpful to use the `gdalinfo` tool to ensure that all of the images you're trying to use were stacked and output by ENVI in the same way. The script checks to make sure that all of the images have the same attributes, like the same number of rows/columns, upper left coordinates, number of bands, etc. If you want to go this route, download the script I've attached (`debug_94.txt`) and run it as follows:\r\n    * Open the terminal and navigate to the location of the downloaded script\r\n    * `bash debug_94.txt /home/ideam/yatsm/7_59/p007r059/landsat_stack/p007r059/subset/images > debug_94.log`\r\n    * The `> debug_94.log` bit of the command will \"redirect\" the output of the script into a text file instead of showing it in your terminal. When the script completes, you should have a new file, `debug_94.log`, that holds the results. Upload this in a reply to this ticket\r\n\r\nSorry for the trouble -- wish I had a better way of debugging remotely! If this doesn't work I'll be out of ideas, but I hope we can get you and IDEAM up and running somehow.\r\n\r\n[debug_94.txt](https://github.com/ceholden/yatsm/files/436050/debug_94.txt)\r\n\r\n"}}
{"actor":{"display_login":"ceholden"}}