gicait / PyAEZ

PyAEZ is a python package consisted of many algorithms related to Agro-ecalogical zoning (AEZ) framework.
MIT License
78 stars 53 forks source link

crop parameters while running PyAEZ Module 2 #37

Open xfry-lixuan opened 1 year ago

xfry-lixuan commented 1 year ago

I'm very sorry, I need to seek help from you. I encountered some questions about crop parameters while running PyAEZ Module 2. I have searched through the PyAEZ manual and GAEZ manual but have not resolved this issue.

图片

Among these Crop Parameters,

  1. The LAI and HI during the vegetation growth period are different, but here they are the same value. For example, I want to study the situation of rice. How should LAI and HI be set at this time;
  2. How to set and define the kc and yloss of these four stages of rice in Crop Cycle Parameters.
  3. Also, if it is legume, are there any differences from the above settings.
NokuzaSezo97 commented 1 year ago

Dear @xfry-lixuan ,

https://s3.eu-west-1.amazonaws.com/data.gaezdev.aws.fao.org/documentation/GAEZ4_Appendices.xlsx. Please refer to this GAEZ database of harvest index and leaf area index for the setting. From there, you have several options for rice, and select the settings for the relevant rice LUT, including kc factors and yloss factors, and legume or not.

By AEZ framework Module II, the crop simulation uses the maximum LAI and related HI in order to calculate the maximum potential yield. The setting for legume defines different constant factor of maintenance respiration according to Biomass Calculation (De Wit, et al., 1965).

I hope this will help you out in Module II usage.

Swun Wunna Htet

JCAELA commented 1 year ago

Hi Swun,

I have a question related to this module: How do we get the rasters for the crop suitability classes and starting date after the maximum yield calculation step? I am using the script found in the tutorial but I noticed that this files were already in the data_output/NB2. I dont see a line in the code where we safe this rasters at data_output/NB2

image

Thanks for your support

José Caela

NokuzaSezo97 commented 1 year ago

Dear @JCAELA ,

For saving the individual yield outputs from Module II, there's the code snippet (the picture below) provided at the end of NB2_CropSimulation notebook. The code uses the file path of the existing TIFF file "LAO_Admin.tif", and 2-D numpy array output to save results as TIFF file. After the crop simulation is finished, just call out the yield outputs, and run the code (picture below).

image

The code line that you got an error is for one purpose. If one has failed for the crop simulation due to several reason, at least they can visualize this existing outputs from simulation (which we've provided). For your case, you don't need to run that code cell.

Hope this information helps.

Regards,

Swun Wunna Htet

xfry-lixuan commented 1 year ago

Dear @xfry-lixuan ,

https://s3.eu-west-1.amazonaws.com/data.gaezdev.aws.fao.org/documentation/GAEZ4_Appendices.xlsx. Please refer to this GAEZ database of harvest index and leaf area index for the setting. From there, you have several options for rice, and select the settings for the relevant rice LUT, including kc factors and yloss factors, and legume or not.

By AEZ framework Module II, the crop simulation uses the maximum LAI and related HI in order to calculate the maximum potential yield. The setting for legume defines different constant factor of maintenance respiration according to Biomass Calculation (De Wit, et al., 1965).

I hope this will help you out in Module II usage.

Swun Wunna Htet

Thank you very much, this is very helpful to me.

JCAELA commented 1 year ago

Thanks Swun, It is clear now.

There is just one more thing I am struggling to understand in this module. Regarding the raster for Soil/terrain/special land cover classes:

How the pyAEZ relates the pixel values of the raster to what it actually represents? I saw in the Youtube tutorial that you used the raster from the HWSD, but what if we have a different source with different legend codes? Also, If I wanted to use special land use class like "protected area" what value should I give for pixels representing this land use?

Thank you for you support.

NokuzaSezo97 commented 1 year ago

Dear @JCAELA,

I presume you're asking about the definition of the layer's classes. If that's the case, I would suggest to check out on PyAEZ v2 user guide, on the AEZ classification, we provided the definitions of each class on Pg 23. This particular layer of data is exclusive if one wants to evaluate the agro-ecological zones (Refer to GAEZ v4 model documentation, Pg 147 - 158). We fully referred this function according to this documentation. I wish I could relay information of this data layer preparation, however at the moment, we have no idea of the process in GAEZ. Thus, I would suggest to go to GAEZ v4 Data Portal>>Data Viewer>>Variable Name = soil/terrain/special lulc classes, freely downloadable at approximately 1 km resolution global coverage, to mitigate the unknown and possibly technical-intensive preparation. (See the figure).

For soil question, which we suggest is to prepare and harmonize the soil map and parameters according to what AEZ requires for soil evaluation and constraints. Soil mapping units (or ID you would) are to be unique ID which reflect on all soil properties that AEZ algorithm would utilize for these evaluation. And additionally, AEZ works with Soil Qualities (which are combinations of several soil physical/chemical properties). If national level data have all these soil properties that AEZ framework uses, directly use it. There might need some adjustment/assumptions during harmonization process. Please fully refer to GAEZ v4 documentation for the list of soil parameters/considerations/variables used for more insights.

If I may add for "protected areas", I would suggest to incorporate into mask layer to omit out from the calculation because obviously you can't implement plantations on those restricted areas, so no need for any crop simulations.

Glad to be able to support, hope these helps.

image

Regards,

Swun Wunna Htet

JCAELA commented 1 year ago

Thank you Swun,

That was very helpful.

I found the answer on page 27 of PyAEZv2 Technical documentation. I am writing here just for future reference:

soil_terrain_lulc: 2D NumPy array, soil/terrain/special land cover classes (8 classes): 1: Dominantly very steep terrain 2: Dominantly hydromorphic soil 3: No or few soil/terrain limitations 4: Moderate soil/terrain limitations 5: Severe soil/terrain limitations 6: Irrigated soils 7: Water 8: Built-up/Artificial

xfry-lixuan commented 1 year ago

Hello, due to my problem, I really can't find where the no_lgpt, optm_lgpt parameters of aez.setLGPTScreening are located in GAEZ, can you tell me easily?

图片

LEEgiser commented 1 year ago

@JCAELA May I ask how you produced this data? Can you give a complete process? I found the answer on page 27 of PyAEZv2 Technical documentation. I am writing here just for future reference:

soil_terrain_lulc: 2D NumPy array, soil/terrain/special land cover classes (8 classes): 1: Dominantly very steep terrain 2: Dominantly hydromorphic soil 3: No or few soil/terrain limitations 4: Moderate soil/terrain limitations 5: Severe soil/terrain limitations 6: Irrigated soils 7: Water 8: Built-up/Artificial

JCAELA commented 1 year ago

Hi @LEEgiser ,

  1. Go to https://gaez.fao.org/
  2. Click on DATA VIEWER
  3. Click on Theme 1: Land and Water Resources
  4. Sub-theme name is: Agro-ecological Zones; Variable name is: Soil/terrain and special land cover classes
  5. When loaded click anywhere in the map and look for "Download this Raster (Open in New Tab)"
  6. If the download doesnt start immediately, click on the address bar of the new tab then press ENTER. The raster will download
  7. Clip the raster with your area of interest
  8. Make sure the clipped raster is the same size as the rest of the rasters or numpy arrays you will be working in pyAEZ.

Hope that helps

LEEgiser commented 1 year ago

@JCAELA Thank you very much for your help!

LEEgiser commented 10 months ago

@JCAELA May I ask which version of the code you are using? How did the data run out? My data comes out basically the same and I'm not sure what the problem is, so I'd like to ask you for some advice.

JCAELA commented 10 months ago

I used the previous version and I am now trying with the latest version. Well I am not an expert but you can share the code you are using and I can check what might be wrong.

maobw12 commented 7 months ago

Hi @LEEgiser ,

  1. Go to https://gaez.fao.org/
  2. Click on DATA VIEWER
  3. Click on Theme 1: Land and Water Resources
  4. Sub-theme name is: Agro-ecological Zones; Variable name is: Soil/terrain and special land cover classes
  5. When loaded click anywhere in the map and look for "Download this Raster (Open in New Tab)"
  6. If the download doesnt start immediately, click on the address bar of the new tab then press ENTER. The raster will download
  7. Clip the raster with your area of interest
  8. Make sure the clipped raster is the same size as the rest of the rasters or numpy arrays you will be working in pyAEZ.

Hope that helps

Hello, after I download and open it with arcmap, it shows invalid raster dataset. error2