forefireAPI / firefront

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

Aullene landscape.nc Wind Layer Format #2

Closed ConorHackett98 closed 1 year ago

ConorHackett98 commented 1 year ago

Hi,

I've recently been trying to use ForeFire to model forest fires in different areas. So far, I've got the program running for the example fire in Aullene.

I've gathered data for the different areas but I'm not exactly sure how the wind layer in landscape.nc works. I was wondering if you might have a source to the original data or a document that explains how the wind layer in landscape.nc works.

Thank you.

filippi commented 1 year ago

Hi Connor,

Thanks for your question. You'll find in tools/genForeFireCase.py an example on how to add a wind layer in the data file directly in python, we recommend using this code to generate your data file. You can do more, time varying wind fields, using pre/computed mass consistent simulations but there is little coverage of this topic in the user's guide as we suppose that as an advanced user, you'll do whatever you want for your experiment and build your data with your own pre-processing code.

Regards


Jean Baptiste Filippi
SPE - UMR 6134 CNRS
Université de Corse
Quartier grossetti
BP 52, 20250 Corte
Tel. +33 495 450 158

Le ven. 2 sept. 2022 à 14:40, Conor Hackett @.***> a écrit :

Hi,

I've recently been trying to use ForeFire to model forest fires in different areas. So far, I've got the program running for the example fire in Aullene.

I've gathered data for the different areas but I'm not exactly sure how the wind layer in landscape.nc works. I was wondering if you might have a source to the original data or a document that explains how the wind layer in landscape.nc works.

Thank you.

— Reply to this email directly, view it on GitHub https://github.com/forefireAPI/firefront/issues/2, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUZ7CQMRI4RNHB52VHCQTTV4HYTPANCNFSM6AAAAAAQDHXDDY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

ConorHackett98 commented 1 year ago

Hi Jean,

Thank you for getting back to me and sorry for my late response. Since your last response I've been trying to use the tools/genForeFireCase.py file to generate a data file and I have a few questions about the values that are entered if you have a chance to reply.

For the domainProperties['SWx'], domainProperties['SWy'] and domainProperties['SWz'] are these coordinates using the same coordinates as the projection set in parametersProperties['projection']? If so what unit of measurement are the domainProperties['Lx'], domainProperties['Ly'] and domainProperties['Lz'] using to measure the length?

I'm also not too sure what the parametersProperties['projectionproperties'] expects as an input, is it the South West coordinates using the set projection?

Finally, I have one more question about the wind. Does the wind["zonal"] and wind["meridian"] set the wind speeds in m/s from west to east and north to south respectively? Would setting these as negative values change the wind speeds from West to East and North to South, to East to West and Soth to North respectively in m/s?

I've also attached a few parameters from the file I created as an example.

Thanks again, Conor.

import numpy as np
import sys

import netCDF4 as nc4

#Read genForeFireCase.py
exec(open("genForeFireCase.py").read())

#File name of the genereated netCDF File 
fout = "../swig/getTest/genTest.nc" #sys.argv[2]

#Domain Properties Set the Boundaries of the Map
domainProperties= {}
#SW = Sout West
domainProperties['SWx']  = 0
domainProperties['SWy']  = 0
domainProperties['SWz']  = 0
#L = Length
domainProperties['Lx']   = 511
domainProperties['Ly']   = 682
domainProperties['Lz']   = 0
#t0 = Initial Time
domainProperties['t0']   = 0
#Lt = Duration
domainProperties['Lt']   = np.Inf

#Details
parametersProperties= {}
parametersProperties['projectionproperties']  = "0,0" ;
parametersProperties['date']  = "2009-07-24_11:37:39" ;
parametersProperties['duration']  = 360000;
parametersProperties['projection']  = "EPSG:4326" ;
parametersProperties['refYear']  = 2013 ;
parametersProperties['refDay']  = 30 ;

#Set Fuel Map
fuelMap = np.zeros((682,511), dtype=int)

#Set Elevation Map
elevation = np.zeros((682,511), dtype=float)

#Set Wind Map
wind =  {}
#West to East
wind["zonal"]    = np.ones((682,511), dtype=float)
#North to South
wind["meridian"] = np.zeros((682,511), dtype=float)

#Create netCDF file
FiretoNC(fout, domainProperties,parametersProperties,fuelMap,elevation=elevation, wind=wind, fluxModelMap = None)