Closed zacharycope0 closed 2 years ago
I was going to tackle this one since it seemed to be a quick fix but I feel like this is already possible. Let me elaborate...
For starters, there is a a build
flag that if false, doesn't build a wind field and rather just saves the variables. How they are saved varies between if it is built or not.
https://github.com/QUIC-Fire-TT/ttrs_quicfire/blob/2e1a6288f28a8d0726ef73458afab2d1cf1ac529/ttrs_quicfire/quic_fire.py#L232
The first line above saves the inital wind direction as the first item in the list. This seems to be so the initial direction is the first in the list and then the rest of the list is appended to the end as it is built. The second just saves it as the variable. This means that the user could just pass in a list of directions as the start_dir
and set build
to false
and the list would be set. This would look something like the following in main.py
:
# Create
dirs = [90, 100, 80]
speeds = [5, 6, 4]
# My sim_time variable might be wrong as I don't quite understand
# what this is supposed to be but the example stands
winds = WindShifts(sim_time=100, start_speed=speeds, start_dir=dirs, build=False)
qf_arrs.winds = winds
# Update
dirs = [120, 130, 140]
qf_arrs.winds.dirs = dirs
This is obviously very technical and should probably be changed to include some getters and setters for updating it or maybe a better way to do initialization, like with a standardized variable input and another function for adding the custom list, but as it stands the init seems to be able to take a custom wind field just fine.
Feature Description I'm guessing that a lot of users will want to input there own wind field as arrays. I'd like you to create a QF_Fuel_Arrays class function that allow users to build the wind field arrays manually.
Getting Started Should be pretty straight forward. These are the arrays that I want users to have access to w/o calling WindShifts.build_wind_field. To do that you will have to change how the WindShifts class is initiated. https://github.com/QUIC-Fire-TT/ttrs_quicfire/blob/e57836a7285581ec41164269db7e89b931bea20b/ttrs_quicfire/quic_fire.py#L219-L226
Note The SIM_START_TIME = 1488794400 is a relic of earlier model workflows. I you want, you should be able to make the start time 0 since that is what most users would expect when inputting the array.
Make sure user values make sense: wind_dirs should be degrees 0-360 (0 is a northerly wind going south 90 is an easterly wind going west). wind_speed must be >0 and there is no reason they should be greater than 20m/s.
While you're at it could you change line 223 self.SENSOR_HEIGHT = 6.1 to self.SENSOR_HEIGHT = SENSOR_HEIGHT
Screenshots Add any other context or screenshots about the feature request here.