This forum is shutting down! Please post new discussions at

Wave Energy Model run error

malinpinskymalinpinsky Member
edited February 2016 in Marine Models
Hi all,

I'm trying to run the wave model for the east coast of North America (North Carolina to Labrador) using the Global Wave data, and the output is strangely clipped to a single grid square. I've attached my AOI file along with the NPV output to show the strange clipping. The log file didn't show any obvious problems to my eyes (also attached).

I dug through the intermediate files to see if I could diagnose the problem, and I found that these files appropriately covered the full AOI:
  • aoi_proj_to_extract.shp
  • npv_not_clipped.tif
  • projected_wave_data.shp
  • WEM_InputOutput_Pts.shp
On the other hand, these files only covered a single grid square (similar to the final output):
  • wp_kw_unclipped.tif
  • aoi_clip_proj_uri.shp
  • aoi_clipped_to_extract_uri.shp
  • capwe_mwh_unclipped.tif
I take this to mean that the error happened in between, but I don't know enough of the details to know where it went wrong.

On a related note, I've also tried running with the data for the East Coast of North America and Puerto Rico. This works fine, but the wave data don't cover my full area of interest (misses eastern Canada), so this isn't a full solution. So it seems that the wave data somehow are the problem? I find it therefore strange that projected_wave_data.shp covers the full AOI.

Any thoughts? Many thanks for any help or advice.

Post edited by malinpinsky on


  • DougDoug Administrator, NatCap Staff
    Hi Malin,

    Sorry for this, it is definitely a bug. I just spent awhile looking at the outputs produced with your AOI. I have located that in the model there is indeed a clipping bug. I just prototyped a fix / solution and it seems to work great.

    I'm going to work on getting this patch into a development build that I can then pass along to you. In the meantime, if you want to hack your way around this bug you can. One way to do it: 
        - copy the "intermediate/aoi_proj_to_extract.shp/dbf/prj/shx" files for your run and save them in the "C:\InVEST_3_2_0_x86\WaveEnergy\input\WaveData\" folder
        - Delete the "C:\InVEST_3_2_0_x86\WaveEnergy\input\WaveData\Global_extract.shp/dbf/prj/shx/*" files.
        - Rename "C:\InVEST_3_2_0_x86\WaveEnergy\input\WaveData\aoi_proj_to_extract.shp/dbf/etc" to "C:\InVEST_3_2_0_x86\WaveEnergy\input\WaveData\Global_extract.shp/dbf/etc"

    Then run the model as before. This should ensure that the clipping portion does not cause any issues. Let me know if that set of instructions is not clear. I will hopefully get you a working version by the end of the day.


  • Hi Doug,

    Wonderful! I got the model to run with your work-around, and it no longer has the clipping problem.

    As a note to anyone else thinking of implementing this, I moved the original Global_extract.shp/db/etc files to another folder, rather than deleting it, since I may use it again in the future.

    Thanks so much for the quick and very helpful responses! Hope the bug is easy to fix in the program, too.

  • DougDoug Administrator, NatCap Staff
    That's great Malin, glad it worked.

    Here is a link to a development version of InVEST that has a patch for this bug in wave energy:

This discussion has been closed.