Details marks hw02
How did I mark?
Interpolations
I had a pytest unit test to test the specific cases with a simple hill samples.xyz
. Download test_all.py to try:
pip install pytest
- put
test_all.py
in the same folder as yourmy_code_hw02.py
- in the console, type
pytest
I just compared your values to those obtained with startinpy interpolate(), including for outside the CH and directly on vertices.
The most common mistake was Laplace interpolation directly at a location where a vertex existsā¦ This meant that you inserted no vertex and then deleted the vertex at the end of the code?! Which meant havoc, your TIN is ācompromisedā.
GFTIN
I didnāt use the dataset I gave you (as previously announced), but found a random place in Limburg with a few trees and buildings and some āhillsā, and tested with only that dataset (download d1.laz).
I couldnāt test exactly the GFTIN because you all handled the bbox/convexhull differently, so I ran your function with --input_thinning 1000
and then calculated the differences between your terrain and the one obtained with classification and linear TIN:
print("=== DTM differences ===")
grid3 = grid_gftin - grid_c_linear
write_grid_to_disk("dtm_diff.tiff", grid3, (bbox[0], bbox[3]), 1.0)
and then I visualised the differences to see if they are generally the same as a correct implementation.
I also verified that your number of vertices in the DT was similar to what I obtain (~5900); I was very lax here, if it was around 5900 it was fine.
Then I ran again with --input_thinning 1000 --max_dist 5.0
, and verified that the error patterns are similar to mine and the number of vertices ~6400.
Some remarks in no particular order of importance
-
Using ChatGPT to help you code is allowed and encourage (I do that all the timeā¦), but for several of you I reckon that ChatGPT was perhaps of too much help, if I may say. I saw code that is very complex and using methods that were not per se in the book or standard (eg for the circumcircle of a triangle), which means that I am not sure you understood what the code precisely does. Some of you had Laplace values that were a bit off, but more than just rounding off errors that accumulate. To mark Laplace I used a tolerance of 0.001 and for most of you it worked, but if it didnāt itās complex for me to say where it went wrong to be honest. So I would strongly encourage you to minimise the amount of code you copy from ChatGPT.
-
I didnāt ask for comments in the code this time (an errorā¦) but I highly recommend you comment your code for future-you. Some parts were quite tricky, and I can guarantee you that in a few weeks if you open that code you wonāt remember what you did at line XYZ.
-
Enjoy the holidays āļø āļø (or perhaps more accurately: š§ļø ā š„¶)