This forum is shutting down! Please post new discussions at community.naturalcapitalproject.org

Marine quality model

yoavp81yoavp81 Member
edited January 2015 in Marine Models
Hello,

I'm having some difficulty with the marine quality model.
I've tried several approaches but nothing seems to work. What am I doing wrong?

Thank you.

Here is my log:

Initializing...
01/18/2015 15:34:29 root DEBUG PATH: ['D:\\Programs\\InVEST_3_1_0_x86\\invest-3-x86\\.']
01/18/2015 15:34:29 root DEBUG Loading marine_water_quality_biophysical from PATH
Arguments:
adv_uv_points_uri D:/GISdata/Nitrate loading/EEZ/ADV.shp
aoi_poly_uri D:/GISdata/Nitrate loading/EEZ/eez.shp
kps 0.001
land_poly_uri D:/GISdata/Nitrate loading/EEZ/land.shp
layer_depth 1.0
pixel_size 1000
source_point_data_uri D:/GISdata/Nitrate loading/EEZ/1.csv
source_points_uri D:/GISdata/Nitrate loading/EEZ/sourcepoint.shp
tide_e_points_uri D:/GISdata/Nitrate loading/EEZ/test1.shp
workspace_dir D:\GISdata\Nitrate loading\EEZ


01/18/2015 15:34:29 root INFO Logging will be saved to marine_water_quality_biophysical-log-2015-01-18--15_34_29.txt
01/18/2015 15:34:29 root DEBUG Loaded the model from invest_natcap.marine_water_quality.marine_water_quality_biophysical
01/18/2015 15:34:29 root INFO Executing the loaded model
01/18/2015 15:34:29 root INFO Running InVEST version "3.1.0"
01/18/2015 15:34:29 root INFO Python architecture: ('32bit', 'WindowsPE')
01/18/2015 15:34:29 root INFO Disk space remaining for workspace: 72.69 GB
01/18/2015 15:34:31 root INFO Pointing temporary directory at the workspace at D:\GISdata\Nitrate loading\EEZ
01/18/2015 15:34:31 root INFO Updating os.environ["TMP"]=D:\GISdata\Nitrate loading\EEZ\tmp to D:\GISdata\Nitrate loading\EEZ
01/18/2015 15:34:31 root INFO Updating os.environ["TEMP"]=D:\GISdata\Nitrate loading\EEZ\tmp to D:\GISdata\Nitrate loading\EEZ
01/18/2015 15:34:31 root INFO Updating os.environ["TMPDIR"]=D:\GISdata\Nitrate loading\EEZ\tmp to D:\GISdata\Nitrate loading\EEZ
01/18/2015 15:34:31 root INFO Setting tempfile.tempdir to D:\GISdata\Nitrate loading\EEZ\tmp
01/18/2015 15:34:31 root INFO Starting marine_water_quality_biophysical
01/18/2015 15:34:31 marine_water_quality_biophysical INFO Starting MWQ execute
01/18/2015 15:34:31 marine_water_quality_biophysical INFO Creating grid based on the AOI polygon
01/18/2015 15:34:31 marine_water_quality_biophysical INFO Creating grids for the interpolated tide E and ADV uv points
01/18/2015 15:34:31 marine_water_quality_biophysical INFO Calculating the in_water array
01/18/2015 15:34:31 marine_water_quality_biophysical INFO Interpolating kh_km2_day onto raster
01/18/2015 15:34:31 marine_water_quality_biophysical INFO Interpolating U_m_sec_ onto raster
01/18/2015 15:34:32 marine_water_quality_biophysical INFO Interpolating V_m_sec_ onto raster
01/18/2015 15:34:32 marine_water_quality_biophysical INFO Masking Tide E and ADV UV to the land polygon
01/18/2015 15:34:32 marine_water_quality_biophysical INFO Load the point sources
01/18/2015 15:34:32 marine_water_quality_biophysical DEBUG point and id (34.83005849111699, 32.26893827329461, 0.0) 1
01/18/2015 15:34:32 marine_water_quality_biophysical INFO Checking to see if all the points have WPS values
01/18/2015 15:34:32 marine_water_quality_biophysical DEBUG these are the source points {1: {'WPS': 10000.0, 'point': [0, 0]}}
01/18/2015 15:34:32 marine_water_quality_biophysical INFO Solving advection/diffusion equation
01/18/2015 15:34:32 marine_water_quality_biophysical INFO Convert tide E form km^2/day to m^2/day
01/18/2015 15:34:32 marine_water_quality INFO Calculating advection diffusion
01/18/2015 15:34:32 marine_water_quality INFO Building valid index lookup table.
01/18/2015 15:34:32 marine_water_quality INFO Building diagonals for linear advection diffusion system.
01/18/2015 15:34:32 marine_water_quality INFO Building sparse matrix from diagonals.
01/18/2015 15:34:32 root ERROR ---------------------------------------------------
01/18/2015 15:34:32 root ERROR ---------------------- ERROR ----------------------
01/18/2015 15:34:32 root ERROR ---------------------------------------------------
01/18/2015 15:34:32 root ERROR Error: exception found while running marine_water_quality_biophysical
01/18/2015 15:34:32 root DEBUG
01/18/2015 15:34:32 root DEBUG Build details
01/18/2015 15:34:32 root DEBUG Interpreter
01/18/2015 15:34:32 root DEBUG Current temp dir: D:\GISdata\Nitrate loading\EEZ\tmp
01/18/2015 15:34:32 root DEBUG tempfile.tempdir: D:\GISdata\Nitrate loading\EEZ\tmp
01/18/2015 15:34:32 root DEBUG
01/18/2015 15:34:32 root DEBUG System
01/18/2015 15:34:32 root DEBUG OS : Windows-7-6.1.7601-SP1
01/18/2015 15:34:32 root DEBUG Processor architecture: AMD64
01/18/2015 15:34:32 root DEBUG FS encoding : mbcs
01/18/2015 15:34:32 root DEBUG
01/18/2015 15:34:32 root DEBUG Python
01/18/2015 15:34:32 root DEBUG Version : 2.7.3
01/18/2015 15:34:32 root DEBUG Build : ('default', 'Apr 10 2012 23:31:26')
01/18/2015 15:34:32 root DEBUG Compiler : MSC v.1500 32 bit (Intel)
01/18/2015 15:34:32 root DEBUG Implementation : CPython
01/18/2015 15:34:32 root DEBUG Architecture : 32bit
01/18/2015 15:34:32 root DEBUG Linkage format : WindowsPE
01/18/2015 15:34:32 root DEBUG
01/18/2015 15:34:32 root DEBUG Packages
01/18/2015 15:34:32 root DEBUG Cython : ?
01/18/2015 15:34:32 root DEBUG Numpy : 1.7.0
01/18/2015 15:34:32 root DEBUG Scipy : 0.11.0
01/18/2015 15:34:32 root DEBUG OSGEO : 1.10.1
01/18/2015 15:34:32 root DEBUG Shapely : 1.2.18
01/18/2015 15:34:32 root DEBUG InVEST : 3.1.0
01/18/2015 15:34:32 root DEBUG
01/18/2015 15:34:32 root DEBUG
01/18/2015 15:34:32 root DEBUG Exception not environment-related
01/18/2015 15:34:32 root DEBUG Printing traceback
Traceback (most recent call last):
File "invest_natcap\iui\executor.pyc", line 553, in runModel
File "invest_natcap\marine_water_quality\marine_water_quality_biophysical.pyc", line 208, in execute
File "invest_natcap\marine_water_quality\marine_water_quality_core.pyc", line 216, in diffusion_advection_solver
File "scipy\sparse\construct.pyc", line 59, in spdiags
File "scipy\sparse\dia.pyc", line 139, in __init__
ValueError: offset array contains duplicate values
None

01/18/2015 15:34:32 root ERROR Exiting due to failures


Comments

  • Hello,

    I am still struggling with the same error message concerning "duplicate values" in the offset array.
    Is this a known problem? What data layer is responsible for this?

    Thank in advance,
    Yoav

  • RichRich Administrator, NatCap Staff
    Sorry Yoav!  Can you dropbox your data to me at richsharp@stanford.edu and I'll take a look?
  • RichRich Administrator, NatCap Staff
    Hi Yoav, I got your dropbox but it only had your log file in it.  Can you send me your entire data stack you use to run the model?  That way I can recreate the error on my end and fix it if it's a bug.
  • Sorry about that. The files are now in the folder.

    The data are simply an initial test run, just to check if the model works correctly.

    Thank you,
    Yoav
  • RichRich Administrator, NatCap Staff
    Thanks Yoav, I got it and can duplicate the error on my end.  I'll work on this and hopefully get a fix to you soon.
  • RichRich Administrator, NatCap Staff
    Hi Yoav, I think i understand the issue now.  Your AOI is unprojected in lat/lng wgs84 coordinates.  However the model UI asks to specify output pixel sizes in meters.  I never really thought about it before, but the model is really specifying those coordinates in whatever units come in on the AOI.  So since your AOI extends from 32.9 to 35.1 lng, a pixel size of "100 meters" will really be like 100 degrees and the resulting raster would be only 1 pixel big.  

    One thing you could do right now would be to project the AOI into meters and use that.  I've also updated a development version of the model to take in floating point output pixel sizes and indicate the units are in the AOI's projection, and raise a more helpful error message if the user inputs pixel sizes too large.  We're having a bit of an issue with our build servers at the moment, otherwise I'd offer you a new development tip you can try.  In the meanwhile I'd suggest trying the reprojection approach with the AOI.
  • DaveDave Member, Administrator, NatCap Staff
    Hi Rich,

    Just thought it might be useful to mention that the Recreation model works in a similar way. The user can specify the cell size, which is assumed to be in the same units as the AOI. But the Rec model will throw a helpful error about unsupported projections if encounters an unprojected system like lat/lon wgs84.
  • RichRich Administrator, NatCap Staff
    Oh good to know dave, and makes sense in the context of this problem.  Also, Yoav, here's a link to the installer with the patch I was discussing above: http://data.naturalcapitalproject.org/nightly-build/release_tip/invest_natcap-dev258_3.1.0b1_[240ea1596dc8].win32-py2.7.exe
  • Thank for all your help.

    I've reporjected the AOI but encountered a different error.

    Attached is the log file and I've updated the dropbox link containing the reporjected AOI.

    I was not able to intall the development version with the patch. For some reason the installer states that my computer does not contain Python 2.7, although I've installed it.
  • RichRich Administrator, NatCap Staff
    Oh I'm sorry I included the wrong link.  That was for the Python extensions, try this instead for a development version of InVEST: http://data.naturalcapitalproject.org/nightly-build/release_default/InVEST_default_x86_Setup.exe
  • Thank you, Rich.

    The development version works, but I still get an error message:

    Error importing pyamg: you cannot import pyamg while being in pyamg source directory; please exit the pyamg source tree first, and relaunch your python interpreter.


    The error occurs whether I use my own files or the default, case-study files.



  • RichRich Administrator, NatCap Staff
    Hi, we encountered that issue, and fixed it, when we were doing the 3.1.1 release last week.  Could you try the new official version and let me know if that doensn't fix your error?

  • Hi Rich,

    Thanks for all your help! The model works perfectly now.

    Yoav
  • RichRich Administrator, NatCap Staff
    Oh fantastic!  Glad to hear it!
This discussion has been closed.