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

Timber Model - Illegal Field Request

Hi NatCap Team,

I've been working with the Managed Timber model and the Carbon Storage model during the past weeks, gathering data, preparing input, etc. Today I wanted to give the Timber model a first try to see how it looks. Unfortunately, the run produced an error: ValueError: Illegal field requested in GetField().
I used a shapefile of the area and modified the attribute table according to the user guide so I could use the .dbf-file for the plantation production table input. I'm not really familiar with reading the log-file so I wanted to ask if someone could help me out with my problem? (I attached two log files with slightly different input, but the error remained the same)
I double-checked the column-names and, I think, all the variables I put in should be working, too. Or could there be a problem with, e.g. using comma-values in some of the columns (I used "double" as data type where I knew there would be comma-values).

One more thing: I want to use several scenarios for the same AoI. So this time I used the base map, which also contains parcels which are not harvest / do not contain timber. Since I want to use the same AoI with regards to spatial extent for every run, I just filled the "non-timber" parcels with 0-values (For BCEF: 1; for Immed_harv: No, etc.).

Thank you and best regards,
Marius

PS: I used both InVEST versions, 3.0.1. and 3.1.1
Tagged:

Comments

  • RichRich Administrator, NatCap Staff
    Ooo sorry that's not working.  Any chance you can dropbox us your data stack so we can take a look?
  • mvemve Member
    Hi,

    Yeah, I could do that! What exactly do you need? Just the input files (Managed Area Map + Plantation Production Table)?

    /Marius
  • RichRich Administrator, NatCap Staff
    Yep that's exactly what we'd need!
  • mvemve Member
    Alright, so here is the link. I hope it works like this: https://www.dropbox.com/sh/d2n15kfbff4jepz/AADXrPEshEl_UKkpleY-58Lxa?dl=0

    The shapefile represents the AoI and I used the .dbf for the production table.

    So far it's more of a test-run, so data isn't very refined. Plus I look at cork oak forests. That's why the harvested mass is low, the price is high and harvesting occurs quite frequently.

    Thanks again,
    Marius
  • mvemve Member
    Hi all,

    I don't mean to be annoying, but I thought of pushing this topic again and ask if maybe someone has an idea why the model isn't running?

    Thanks again for your help!
    /Marius
  • RichRich Administrator, NatCap Staff
    Hi Marius, sorry for the delay.  Our annual symposium is next week and we're all scrambling to last minute stuff.  

    Your shapefile has the field 'Parcel_ID' that should be confusingly spelled 'Parcl_ID'.  This is an old model that used to run in ArcGIS so I'm wondering if the choice was made to do that so it didn't conflict with the 'Parcel_ID' field in the .dbf.

    You'll notice once you fix that you'll get a divide by 0 error because some of your Freq_Harv fields are 0.  Not sure what you should do there that makes sense for you if they're not harvested, but maybe set them to 1 but put percent harvested to 0?

    I hope that fixes all your issues, please let us know if not!
  • mvemve Member
    Hi Rich,

    No worries at all and thanks for the reply!
    Thanks for the "divide by 0" warning, I think it makes sense to change it the way you suggested.

    I tried to change Parcel_ID to Parcl_ID (Actually, I didn't change it, but deleted the old field and added a new one - GIS-style...). But, when I start InVEST now and put in the plantation production table, it gives me the instant warning that the required field "Parcel_ID" couldn't be found among the fields in the .dbf-table (see picture attached). Either I just don't get it right now or there is some sort of internal wording mistake for this instance...

    Any ideas?

    Thanks and good luck with the symposium!
    /Marius
    1089 x 272 - 55K
  • RichRich Administrator, NatCap Staff
    Hi Marius, the model was designed to have a separate shapefile input and harvest database.  Don't know why we didn't combine those into one thing, but the shapefile needs a "Parcel_ID" but the database needs "Parcl_ID".  Since you're using the .dbf from the shapefile you'll have to have both fields.  I hope that fixes things and let me know if it doesn't.
  • mvemve Member
    Hi Rich,

    Thanks again for the feedback. It was very helpful because I could run the model after adding both fields, Parcel and Parcl ID.

    I had some problems with the results at first, but after some fiddling around I think I managed that, too. So for now I need to analyze the results and run the model with some different scenario-maps.

    Thank you and best regards,
    Marius
  • mvemve Member
    Hello again,

    I was having a look at the equations in the UserGuide and saw that many variables are linked to yr_cur or yr_fut. I was wondering how yr_cur and yr_fut are defined, because I can't find any option to directly provide these years in the model. So, I guess these numbers are somehow indirectly derived.
    Since I apply my model to a cork oak forest, I put 100% harvest rate for each parcel and a frequency of 9 years. I used a T-value of '1' because the harvest is a "clearcut" in the sense that all trees within the parcel are harvested at the same time. But, looking at the equations again, I think by setting T = 1, I tell the model that the whole parcel is actually cut clear and not able to 'prodcue' anything after that, is that right? But, according to the UserGuide text, I can't increase T either because that would conflict with my 100% harvest rate, correct? So, what my results show me for now, is a TBiomass (and NPV, etc.) for only one harvest.
    The TNPV in the results now does only account for 2 years of maintenance cost. Since one harvest cycle is 9 years, there are quite some costs not included. Is there I way I can make the model include the full 9 year cycle in the calculation or should I circumvent the problem by adjusting the maint_cost to a higher value so that 2 years actually reflect the value of the 9-year cycle?

    Sorry for the long post again, I hope this will finally settle things for me :-)

    Thanks in advance!
    Cheers,
    Marius
  • DougDoug Administrator, NatCap Staff
    Hi Marius,

    Glad you got the model running. I'll try and take a stab at your questions above, but will look for some confirmation from other NatCappers more familiar with the model. The input T, for yr_cur / yr_fut is the lifetime of the farm. So if you're looking to harvest the farm for 50 years, the value of T should be 50. To do an immediate harvest starting at year 1, the 'Immed_harv' column should be set to 'YES'. This will do an immediate harvest for the farm, and to do a clear cut, 'Perc_harv' should be set to 100%. If your frequency is 9, then a clear cut will be done for year 1, and every 9 years following for 50 years. 

    If you're just looking to do one clear cut, then you could set T = 1 with the 'Immed_harv' set to 'YES'. The maintenance cost is annual, and I believe, that if T = 1 it only accounts one year of maintenance cost. So for one year of clear cut, you could set T = 9, that way, maintenance cost would be calculated for each of the 9 year frequency but only one clear cut would be done.

    Not sure if that helps, and I'll try to get some other folks to take a look!

    Doug 
  • mvemve Member
    Hi Doug,

    I changed the T-value to a higher value and the results make much more sense now! They also align with my manual calculations. So, I guess I just misunderstood what the T-value is about and how it influences the results.

    Thank you very much for all the help!

    Cheers,
    Marius
  • DougDoug Administrator, NatCap Staff
    No problem Marius! Glad to hear it's working for you.

    Let us know of any other problems
This discussion has been closed.