forefireAPI / firefront

ForeFire is an open-source code for wildland fire spread models
GNU General Public License v2.0
37 stars 21 forks source link

Questions about landscape_gen_funcs.py #30

Closed MikeRiz521 closed 18 hours ago

MikeRiz521 commented 3 months ago

I want to generate a landscape file for the area of my interest, and I have already gathered the necessary rasters from CORINE for fuels and EuroDEM for the elevation. However I do have some questions:

  1. Should the produced elevation and fuel maps have the same dimensions? I did not see any part of the code about downsampling any of the two input rasters to match their resolutions, should the input raster files already have the same resolution?
  2. Should both raster files be reprojected on a common CRS? On the example file you are using epsg:5880, but then your reproject onto a different CRS for Aullenne when running the resolution, why are you doing that? Can I just not use the two raster files on whatever CRS they originally are? And if I do have to reproject both rasters on a common CRS, should I use the one specific for my area, or should I just use the epsg:4326 which is used by google?
  3. How large can the maps be on the landscape.nc for the simulation to not crash, is there a limit on the dimensions?
  4. The netcdf module from netCDF4 does not seem to have the function that you use for creating the lndscape.nc file, netcdf_file, shouldn't this bug be fixed? I tried to use the netcdf module from scipy.io and it seems to have worked, though I am not sure.

Thank you in advance for your responses, I will appreciate your help a lot since this script seems to be a very usefull tool to create a landscape.nc file, which is not easy to do from scratch

filippi commented 3 months ago

Hi, sorry for late answer, 1) you can use whatever you want as long as the data is consistent, and you know what you are doing, each layer can have its own resolution but should have the same reference and extent. 2) as for projection, same, whatever cos, but it must be conformal and consistent between layers. ForeFire do not handle projections, it assumes data is consistent and metric. 3) I tried it up to 5000X5000, it is not really suppose to do much more 4) All these helper scripts are really here to get started, every user eventually built their own, just use the netcdf lib you like the most.

MikeRiz521 commented 3 months ago

Thank you for your response, I managed to generate my own landscape.nc file that looks good in the EDA. However now I have an issue with the simulation. More specifically, I have used a single band of southern wind, and the example aullene.ff file, but the fire propagation stays the same triangular shape only a bit bigger. I understand that according to your documentation, if we don't use specific wind columns to our landscape through WindNInja, then the wind depends on the triggers we put in the ForeFire file. I also understand that loc=(0.,0.,0.) is the ignition point. So what do I need to change to see a different polygon in the simulation than just a triangle? Thank you!

filippi commented 3 months ago

Well, a triangle not getting bigger, is a fire not starting. Have you tried to update and use the pyForeFire library ? look at the wind example, it gives more idea on how to build the fields, it depends so much on your use case that there is no general answer

MikeRiz521 commented 3 months ago

Is the wind example in landscape_gen_funcs.py, or somewhere else? Basically I just took the example in there and removed the 7 bands

filippi commented 3 months ago

It is on the other depot with the python bindings : https://github.com/forefireAPI/pyForeFire

MikeRiz521 commented 3 months ago

Thank you, I'll have a look and I will let you know if I have any further questions!

MikeRiz521 commented 3 months ago

So it says you need the netCDF libraries and ther netCDF-CXX libraries, however on the netCDF download page it only offers libraries for C, C++, Fortran and Java. Which one of these do I need for pyForeFire?

filippi commented 18 hours ago

cXX is c++, take this one, but overall it may depends on your system