nasa / RHEAS

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

Error in running DSSAT #90

Closed wle0001 closed 6 years ago

wle0001 commented 6 years ago

... addgeometrycolumn

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

INSERT 0 1 CREATE INDEX COMMIT ANALYZE ERROR: Error in crop selected.

Its failing in the try statement in line 180 in nowcast.py: try: crops = options['dssat']['crop'].split(",") for crop in crops: crop = crop.strip() mod = __import__("dssat.{0}".format(crop), fromlist=[crop]) model = mod.Model(dbname, name, res, startyear, startmonth, startday, endyear, endmonth, endday, nens, options['vic'], shapefile, assimilate) model.run() except Exception: log.error("Error in crop selected.") sys.exit()

If i move the code out of the try statement it runs further and hangs at the query on line 39 in maize.py:

sql = "select p1,p2,p5,g2,g3,phint,name from dssat.cultivars as c,{0}.agareas as a where crop='maize' and ensemble={1} and st_intersects(c.geom,a.geom) and a.gid={2}".format(self.name, ens + 1, gid)

the column 'name' in dssat.cultivars is empty....