nasa / RHEAS

Regional Hydrologic Extremes Assessment System
MIT License
73 stars 54 forks source link

DSSAT nowcast error #47

Closed vks01 closed 8 years ago

vks01 commented 8 years ago

I was following the steps in the 'Running a nowcast' example on ReadDocs. When I try to run the DSSAT portion of the nowcast, I get the following error:

-----ERROR-----------------

dropgeometrycolumn

basin.agareas.geom effectively removed. (1 row)

DROP TABLE BEGIN CREATE TABLE ALTER TABLE

addgeometrycolumn

basin.agareas.geom SRID:4326 TYPE:MULTIPOLYGON DIMS:2 (1 row)

INSERT 0 1 CREATE INDEX COMMIT ANALYZE ERROR: column "type" does not exist at character 102 STATEMENT: select st_value(rast,st_geomfromtext('POINT(35.125 1.125)',4326)) as doy from crops.plantstart where type like 'maize' and st_intersects(rast,st_geomfromtext('POINT(35.125 1.125)',4326)) order by doy Traceback (most recent call last): File "./rheas", line 16, in sys.exit(rheas.run()) File "/home/ksriniva/RHEAS/src/rheas.py", line 81, in run nowcast.execute(dbname, options) File "/home/ksriniva/RHEAS/src/nowcast.py", line 197, in execute runDSSAT(dbname, options) File "/home/ksriniva/RHEAS/src/nowcast.py", line 182, in runDSSAT model.run(dssatexe) File "/home/ksriniva/RHEAS/src/dssat.py", line 729, in run plantdates = self._planting(lat, lon) File "/home/ksriniva/RHEAS/src/dssat.py", line 581, in _planting cur.execute(sql) psycopg2.ProgrammingError: column "type" does not exist LINE 1: ...1.125)',4326)) as doy from crops.plantstart where type like ...

-----ERROR END --------------

kandread commented 8 years ago

16b4cc8216f933110bca54224245a8b026221e6b should fix it. I'll merge it to the master branch after you confirm. You still won't be able to finish the DSSAT simulation since you need to add some soil information (user-defined). We only have them over Africa currently for a project, so you can try using the same with wget https://googledrive.com/host/0B-cBXVuysNV1TXVYd1BwSE05Zlk/dssat_soils.sql.gz gunzip dssat_soils.sql.gz ./bin/psql -d rheas -f dssat_soils.sql

vks01 commented 8 years ago

I tried to do a clean install on my linux box - I downloaded the code, manually edited the buildout.cfg file to include your last edit. But, when I tried to run "python bootstrap.py", I get the following error:

---ERROR---- Downloading https://pypi.io/packages/source/s/setuptools/setuptools-24.0.0.zip Extracting in /tmp/tmpjEness Now working in /tmp/tmpjEness/setuptools-24.0.0 Building a Setuptools egg in /tmp/tmpeGnPIS Traceback (most recent call last): File "setup.py", line 21, in exec(init_file.read(), command_ns) File "", line 11, in File "/tmp/tmpjEness/setuptools-24.0.0/setuptools/init.py", line 14, in from setuptools.extension import Extension File "/tmp/tmpjEness/setuptools-24.0.0/setuptools/extension.py", line 11, in from . import msvc File "/tmp/tmpjEness/setuptools-24.0.0/setuptools/msvc.py", line 244, in class PlatformInfo: File "/tmp/tmpjEness/setuptools-24.0.0/setuptools/msvc.py", line 253, in PlatformInfo current_cpu = safe_env['processor_architecture'].lower() File "/usr/lib/python2.7/UserDict.py", line 23, in getitem raise KeyError(key) KeyError: 'processor_architecture' /tmp/tmpeGnPIS/setuptools-24.0.0-py2.7.egg Traceback (most recent call last): File "bootstrap.py", line 98, in ez'use_setuptools' File "", line 178, in use_setuptools File "", line 129, in _do_download File "", line 75, in _build_egg IOError: Could not build the egg. -------ERROR_END---------

kandread commented 8 years ago

This seems unrelated to the table column missing. What's your distro and python version? Python 2.7 should work assuming that you have installed the requirements (see https://travis-ci.org/nasa/RHEAS/builds/141863922).

vks01 commented 8 years ago

It is Python 2.7.6 running on Ubuntu 14.04.4 LTS (GNU/Linux 3.19.0-64-generic i686)...I'm trying to retrace my steps to see what happened - this was working (I could atleast run VIC) till I edited the buildout.cfg file and tried to re-install RHEAS..

vks01 commented 8 years ago

It turns out, if I force bootstrap.py to use setup-tools version 23.2.0, the setup runs fine. When I run buildout, it goes off an updates setup-tools to version 24.0.2, but looks like something in bootstrap.py does not like 24.0.2. I got everything to work - however, if I use the basin.shp file in the example, I get the following warning, after which execution ends.

--WARNING----

addgeometrycolumn

basin.agareas.geom SRID:4326 TYPE:MULTIPOLYGON DIMS:2 (1 row)

INSERT 0 1 CREATE INDEX COMMIT ANALYZE WARNING! No crop areas found!

-----WARNING END --------

kandread commented 8 years ago

Are you using the same config file as in the documentation?

vks01 commented 8 years ago

Yes.