Closed zacharycope0 closed 2 years ago
I've been messing around with this a bit and have just been trying to get the top.dat file into the run folder through QF_Arrays export_fuel
function, currently ignoring the flag. I have discovered however, that elevation data is stored differently than the rest, so a call to fort_import
throws this error:
Traceback (most recent call last):
File "main.py", line 27, in <module>
qf_arrs = qf.build_ff_domain(dom, FF_request=True, use_Topo=True)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ttrs_quicfire/quic_fire.py", line 398, in build_ff_domain
qf_arrs = FF.build_ff_domain(dom, FUEL_PATH, FF_request, use_Topo)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ttrs_quicfire/build_FF_domain.py", line 204, in build_ff_domain
return qf.QF_Fuel_Arrays(dom, out_dir)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ttrs_quicfire/quic_fire.py", line 99, in __init__
self.topo = dat.fort_import(domain, os.path.join(FUEL_PATH, 'topo.dat'))
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ttrs_quicfire/dat_file_functions.py", line 23, in fort_import
data = data.reshape(domain.nz,domain.ny,domain.nx)
ValueError: cannot reshape array of size 115238 into shape (128,367,314)
This is a result of the varying lengths of the original .dat
files.
bulk_density.dat Length: 14750464
moisture.dat Length: 14750464
depth.dat Length: 14750464
topo.dat Length: 115238
Perhaps the topo.dat
data doesn't need to be reshaped at all and rather just copied? And if that is so then implementing the use_topo
flag should be easier but the management of that file would not be in the same place as the rest of the fastfuels .dat
files.
I will say I find this variation in data size rather odd since the fastfuels write
function writes all four files at the same resolution.
I should have addressed that in my initial feature request. The topo.dat has an nz=1 since it is a 2-d array that describes the elevation of each cell.
Everything through point 3 should be implemented now on the 2-topography
branch. It seems like point 4 relies on Issue #3 so I'll take a look at that next.
Nice. You should probably work on the same branch for both problems.
Point 4 should be resolved with the latest commit to 2-topography
as mentioned in https://github.com/QUIC-Fire-TT/ttrs_quicfire/issues/3#issuecomment-1142556036. After this and issue #3 are closed the branch can be merged and a new release can be made.
I changed the fuel_height finder to what is below. On the example setup it gives me 41 which I believe is correct. https://github.com/QUIC-Fire-TT/ttrs_quicfire/blob/c3f2ad08376962237575fb3bd49bb3c5725e285c/ttrs_quicfire/print_inp_files.py#L302-L315
I also changed the following line back from the way you had it. This is because I am comparing the base numbers without the fuel height included. If the relief * 3 is greater than 100 then I add that ontop of the fuel height instead of just 100. https://github.com/QUIC-Fire-TT/ttrs_quicfire/blob/c3f2ad08376962237575fb3bd49bb3c5725e285c/ttrs_quicfire/print_inp_files.py#L319-L322
Feature Description QF is able to use the topo.dat file built from fastfuels but I build the original workflow for flatlands only. I would like topo to be run as a default.
Getting Started
!Relative filepath to topo .dat file (ex:: "../path/to/topo.dat") "topo.dat" 5 !Topo flag 0:Flat 1:Gaussian Hill 3:Constant slope with flat section 5:Custom .dat 1 !Smoothing Flag 1 !#of smoothing iterations 1500 !Total startup iterations 500 !Iteration Reset Period
Screenshots Add any other context or screenshots about the feature request here.