Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extracting FDS-LS data to netcdf #92

Open
3dfirelab opened this issue Sep 26, 2024 · 9 comments
Open

extracting FDS-LS data to netcdf #92

3dfirelab opened this issue Sep 26, 2024 · 9 comments

Comments

@3dfirelab
Copy link

I use the attached code to read the terrain data (.ter files) that were generated with qgis2fds
terrainToNc.py.txt

when I plot the terrain from fds on the original data used in qgis2fd, I can see a slight rotation.
Screenshot_2024-09-26_20-11-52

Am i trying to redo something that already exist?
if not, I have been trying to see where I could have included a rotation, but without success
The code is using an slread function I got from randy sometime ago that load the .ter files
then it set a grid for the whole domain that is not critical I think
and finally use the scipy function griddata to interpolate the fds value on a 2D plan.

Let me know if i should put my qgis project somewhere together with the generated fds config file

@rmcdermo
Copy link
Contributor

@johodges @emanuelegissi Any chance this is already fixed in the dev branch for qgis2fds?

@johodges
Copy link
Collaborator

I remember we did some work on the projections, so I think this might be fixed already. If you can upload the project file as a zip with any local file dependencies included I can try and run it on dev.

@3dfirelab
Copy link
Author

the data
testTerrain.tar.gz

my config for qgis2fds
20240926_22h50m09s_grim

domain extent:
1.888192625,1.898496697,41.706845194,41.718590395 [EPSG:4326]

@3dfirelab
Copy link
Author

I am trying to deploy the dev version from the git repository
I managed to deploy the plugin from the branch master and install in QGIS
I then tried to switch to the branch dev, but there I am missing the algo folder and cannot /deploy.sh the dev version.
what should I do to get the dev version of the plugin?
Thanks

@emanuelegissi
Copy link
Member

I use the attached code to read the terrain data (.ter files) that were generated with qgis2fds terrainToNc.py.txt

when I plot the terrain from fds on the original data used in qgis2fd, I can see a slight rotation.

It is hard to exactly understand what happened, because you did not specify where the original data comes from and what kind of transformations you applied.

I suppose the following happened:

  • You read the elevation data from Landfire. Its reference system is EPSG:5070 (NAD83 / Conus Albers).
  • Then you exported it to FDS. At this point qgis2fds transforms the reference system from EPSG:5070 to the appropriate metric UTM reference system. The UTM reference system is slightly rotated in the eastern and western areas of the US, compared to the EPSG:5070, because it strictly keeps the North upwards.
  • You probably imported back the data to QGIS, and did not set the right UTM reference system for it. So the data is shown rotated.

Always double check that each of your data layers are correctly configured with the right reference system. GIS tools are not for the faint of heart ;-)

Check what I supposed by showing the View > Decorations > North arrow.

@emanuelegissi
Copy link
Member

I am trying to deploy the dev version from the git repository

Install git on you computer and check out the qgis2fds repo. Then replace your existing qgis2fds plugin folder contents with the qgis2fds repo you just downloaded. Reload QGIS.

Or wait for me releasing a new qgis2fds version.

Disclaimer: this is an open source tool, I am volunteering for it. I have got some work deadlines that do not allow me to fix that in the next few days.

@johodges
Copy link
Collaborator

I ran your project file on the dev branch and the fds file with the latest FDS master. I think the issue you are seeing is related to the CRS in your python script. I have an updated project file and processing script in the attached which does not show the same rotation issue. The elevation maps are still slightly offset in x-y but I attribute that to artifacts from repeated coordinate transformations and interpolation.

testTerrain_jh.zip

@emanuelegissi I had to make some local changes to pb_tool.cfg to update to the dev branch. Mainly updating the name of one of the python scripts and adding the "lang" directory. Also the plugin directory is hard coded so I had to make that match my machine. Do you want me to put in a PR to add this change on dev? We might want to figure out the best way to have pb_tool find the local qgis plugin folder rather than hard coding.

image

@emanuelegissi
Copy link
Member

@johodges okay

@3dfirelab
Copy link
Author

3dfirelab commented Oct 22, 2024

my problem was a projection issue. I was assuming that the UTM projection was aligned with the north.
Using the fds2qgis version from github and making sure the projection to epsg:4326 is correct, I have now the terrain exported from FDS that aligned with the original terrain used in qgis2fds. I can then save the output in netcdf and open them in QGIS.

Then I moved forward and try to compute the ROS using an arrival time map that I computed from the level set contour variable.
For the remaining of my question I moved to the FDS issue tracking as it is more relevant to FDS-LS.

firemodels/fds#13607

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants