-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create biome map mask/ Selection of biomes map #59
Comments
Sorry for the delayed response on this. I'm not sure I understand the technical challenge. I do think that rethinking biome classification is in order, but will require a bit of rearranging of some parameters, so it's not a very simple task. Lets talk about it today. I'll need to spend some time looking into it. |
I need to work on this issue more, but wanted to modify this previous post because I realize that my previous posts here were off track. 1- I agree that SYNMAP is a good starting place. I think we should use it as the first cut for determining which ecosystem types may be present in a given location. What I need to work on is figuring out the best biome categories for default values and how these can map to SYNMAP. David, does this generally sounds like a good working plan? |
The following are instructions for the revised biomes mapping. The new vegetation types will be associated with revised default values, which I will provide. Please contact me if you have any questions. The new biomes mapping scheme will draw upon several maps:
Each of these maps will be associated to major vegetation types as indicated in the file VegTypeAssociations.csv. (in Box/gcs/Revised Biomes Mapping (2016)). Those vegetation types are as follows:
New biome default values will be described/ tracked in issue #64 |
Can someone either upload SynMap to box or provide a link to it? I don't see it on Box right now, and the download link I found through google just downloads a file saying that the service is unavailable. Thanks. |
I added it in the "Map to be added to Calculator" folder in the box. It is called Hurtt_SYNMAP_Global_HD_2010.nc |
First thanks @ValentineHerr for adding the synmap! Also - I'm not entirely sure I understand what needs to happen here. I'm not really familiar with biome data in general, but I think what I've parse together is the following:
Just a thought - this will potentially be slower, since (in R at least) you can only get one variable at a time, so we'll have to get the value for each variable as ~12 separate calls to the file. An alternative would be to set the biome as a dimension, and then for a given lat/lon we could query the netcdf file once and return a vector of If I'm missing a step or if I have the configuration wrong please let me know. Thanks. |
I can't advise on the best way to program this. Are my instructions on the desired functionality clear? |
Okay, as of commit 94bf9b5, a working example of biome loading is here. The calculation of said biomes doesn't work yet because various changes in the biome_defaults have to be taken into account in the calculator, but at least you can see the biome selection process. It would probably be good to walk through this with someone so that we can address any potential errors. Also see the notes below.
Major Notes
Minor Notes
|
Thanks. I will review thoroughly as soon as possible and provide feedback as I go. If it would be helpful to walk through with me via phone or videoconference, I could be available most of the afternoon or evening starting in about half an hour. Regarding the two major needs, @ValentineHerr created the FAO/gez file and may be able to help with that. |
|
Besides IBIS, are the other rules for revised biome mapping fully implemented in this version? That is, is it ready for review? |
I believe so. Let me summarize how it works in the code:
If any of those steps are wrong, just let me know and it's not worth Nicholas Potter On Mon, Aug 22, 2016 at 10:10 AM, Kristina Anderson-Teixeira <
|
Steps 1 and 5 require modification.
|
Okay, awesome. So just to clarify, you'd like me to concatenate all of the vegetation types available from all of the synmap, koppen, fao, ibis, ramankutty values to create the list of vegetation types for which to lookup biomes? Also - @dlebauer, I also don't know where the ramankutty map file is. So the things I need to fill the above are:
I think that's it. |
Also, I think there's maybe a copy/paste error here:
Is the only difference the addition of for crops, OM_SOM = 0? If so was already the case so it's all set. |
Yes, that is correct.
|
On 5), the difference is the addition of "for natural ecosystem types or pasture, if..." and "for crops, ...". It sounds like it may all be correct already. |
t_oc is the %SOM in the top 0-30 cm layer; s_oc is %SOM in the 30-70 cm layer The variable you want SOC = t_oc * 0.3 + s_oc * 0.7 |
NO; we do not want %SOM, we want SOC in units of total mass (tons C ha-1 to 1 m). I believe the file has the variables SOCSUB and SOCTOP. So we want SOC=SOCSUB + SOCTOP. @ValentineHerr can look at the file to verify the variable name. |
We must be looking at different files - the hwsd.nc file has %SOM as mentioned above and bulk density in units of kg / dm3. With appropriate conversions we can compute the SOC as tons C ha-1 to 1 m. Let me know if you want me to work out the conversion, but the first step will be: t_oc * 0.3 * t_ref_bulk+ s_oc * 0.7 * s_ref_bulk |
Percent cover for different crops is here: netcdf/GCS/Crops/Brazil/Sugarcane/brazil_sugc_fractional_10yr_avg.nc I don't see cover for pasture |
Actually I think pasture fractional cover is in netcdf/GCS/Pasture2000_5min.nc Does that sound right? Are these the Ramankutty files? |
Regarding SOC, working out the conversion may be easiest. I believe @ValentineHerr has been using a file with units of t/ha (if not we need to fix our calculations, Valentine). |
Pasture2000_5min.nc sounds right for the Ramankutty files. Is there a crops one too? The other files you listed are specific crop types We also want generic cropland from Ramankutty. Are brazil_sugc_fractional_10yr_avg.nc and brazil_soyb_fractional_10yr_avg.nc working? @dlebauer, this relates to a question I sent you this AM via email. |
This is how to compute SOC from the hwsd.nc file:
SOC <- (t_oc * 0.3 * t_ref_bulk+ s_oc * 0.7 * s_ref_bulk) * 10000 |
I think they are working, will have to defer to @potterzot |
Short answer: yes. More details: Specific crops are still handled in the way they used to be. The way it is handled is:
There is some additional specific logic that applies to certain crops, but that's the process. The new biome mapping only applies to native ecosystems and generic pasture and cropland codes: |
What is the additional specific logic that applies to sugarcane and soy in Brazil? Earlier, there was trouble getting the sugarcane (and soy?) map to work, and a hack was created whereby these were assigned by state (not desirable). |
I don't know how the map values were created, so there could be something in that that assigns by state, but in terms of the logic after reading the map value, the specifics are: BR Sugarcane
BR Soy
Actual code if (!is.na(res$braz_sugarcane_num) &
res$braz_sugarcane_num > 0.01 &
res$braz_sugarcane_num < 110.0) {
biome_data$agroecosystem_eco["BR_sugarcane"] <- name_indexed_ecosystems["BR sugarcane"]
biome_data$agroecosystem_eco[["BR_sugarcane"]]$latent <- custom
biome_data$agroecosystem_eco[["BR_sugarcane"]]$sw_radiative_forcing <- custom
}
if (res$braz_fractional_soybean_num == 1 &
!is.na(res$br_sugc_latent_heat_flux_diff)) {
biome_data$agroecosystem_eco["BR_soy"] <- name_indexed_ecosystems["BR soy"]
biome_data$agroecosystem_eco[["BR_soy"]]$latent <- custom
biome_data$agroecosystem_eco[["BR_soy"]]$sw_radiative_forcing <- custom
} |
Okay, a minimal working example is up. I believe it only works with selecting one natural ecosystem. Agriculture systems don't work at the moment because of the below. Question: The format of the original biome defaults json file has source abbreviations like:
Because the new biome defaults are in a csv file, they have the format:
Essentially one level removed, with no "s000" key. This is a key for the source of the data from what I can tell. Right now this causes problems because the app will parse either one or the other, but not both. Do you want me to: a. convert all to the format that includes the "s000" |
I don't recognize "s000" notation - if it is not needed, please convert to the format that does not include it |
The demo is a complete working demo now, excepting the new issues that were created today and the remaining things below. Here's the current list of stuff that needs to be done for this issue:
|
The soil carbon numbers are wrong (way too high); most values should be SOC= 50-250 t C ha-1. Then the variable that goes into the calculator is "vulnerable soil organic matter", OM_SOM=SOC/.58*0.3 (or 0.43 when SYNMAP = crops). The .58 converts from C to organic matter (in retrospect, a stupid convention in my code!) and the 0.3 or 0.43 defines the fraction of that SOM that is vulnerable. Also, you need to be sure to convert % to fraction before applying David's formula. So here's a revised formula: SOC <- (t_oc/100 * 0.3 * t_ref_bulk+ s_oc/100 * 0.7 * s_ref_bulk) * 10000 |
Regarding this, " have not seen a list of biome names for each biome code like T1, T3, S1, etc... Right now I'm using vegetation types, but this means multiple different biomes will show up in the app as "Broadleaf Evergreen Forest", for example. If we have a list of names and codes for each biome, it would be easy to change this to reflect the specific biome name."... I intentionally chose to define forest type based only on the tree type; I think that makes it easier for users who wouldn't find the biome names very meaningful. So this item is fine. |
Regarding this: "the Revised Biome Mapping docx file has this item: " There are a few biome types for which default values do not (yet) exist, as indicated by “NaN”. For these, the calculator should give an error message. Something like: “Insufficient data for this vegetation type in this location. Please enter values manually or de-select this ecosystem type." This is probably not something that it makes sense for me to do. Right now these values are coded as NA in R."... Would it be complicated to make an error message pop up if the user tries to check the box? The error message can read, "Insufficient data for this vegetation type in this location. Please enter values manually or select a different ecosystem type." |
Regarding this, " there are not currently instructions for other "MAP" biome settings, for sw_radiative_forcing, latent, and sensible. These need to be implemented."… Basically, these will be treated exactly the same as they were in the previous version, with the exception that they now apply only some of the time to the natural vegetation types (trees, savanna, shrubs, grassland). The basic logic is: These maps (or at least most of them) are already loaded in the calculator, and I do not know what they are called. Perhaps @dlebauer can help. The variable definitions and formulas below describe the calculations you will need: R_net- net radiation or sw radiative forcing, in W/m2. For both, we have paired maps for vegetation (e.g., Natural Vegetation and Natural Vegetation_Bare). There are maps for natural vegetation, maize, soy, sugarcane, switchgrass, and miscanthus. ∆R_net= R_natural vegetation - Rnet bare (will usually be a negative number) for both, the number that goes into the calculator is converted as follows: I’m not familiar with all the inner workings of the calculator, so I hope this all makes sense. Let me know if you have any questions. |
I added the IBIS values in map_vegtypes.csv. Let me know if that works. |
About the Soil carbon units. Units seem to be in t ha-1 according to instructions that I have about the layers. Also the values stored don't look like percentages. The files I am talking about are:
|
@ValentineHerr I don't recall where those files came from, but I was referring to the file hwsd.nc produced by MsTMIP. That should be easier because it has all of the necessary data in a single file. |
Closing this issue, I think it is done. |
We currently have the following maps for biome-type (in netcdf/GCS/biomes):
Options
References
For reference, this is Hurtt's Land Use[ 1] map harmonized with the Synergetic Land Cover Map (SYNMAP)[2]". For reference on the combination of these see [3] .
The text was updated successfully, but these errors were encountered: