Notes from the ess code refactoring
The ESS code refactoring did not go easily. It took me way to long… primarily because I started refactoring in August, didn’t finish, fogot about it, and then started hacking on the incomplete code without realizing. I sorted things out, but it was painful. Here are my notes from the process.
2008.10.28
Seems that I’m having problems with the Table class in particular the createTableFromDictList method.
I’m not sure that the input to the class is valid, so I should probably start by doing testing on the output from libcast.py and make sure that it matches what is coming out of VB libcast.
If it’s the same… then something must be wrong with the table generation…. I’m seeing stuff get chucked because they are not common to all rows, but should be.. Float rounding errors? Not sure.
2008.10.29
OK, createTableFromDictList seems to be OK, but I’m passing in a table that has 0 values for some rows (e.g. there is no value for .08 travel time at 0.00 degree because the ray has already reached the sea floor) I need to pad or something…
There are slight differences between the numbers returned using the Table (VB libcast with python2.5) and the old code (VB libcast with python2.4). I need to figure out why
2008.11.03
Looks like when I try to add the two Tables, there are lots of None values and it craps out saying that it can’t add them. Maybe I should use a numpy.ma (masked array) to do the adding…
2008.11.04
numpy.ma worked fantastically. Thanks Jack! Next I just have to convert the depth differences to m/s values, re-do the graph and I’ll be all set.
2008.11.04
Almost done… I just have to get the interpolations working in calculateAndDisplayMeanSurveyTPU and then clean up the code and I’ll be back to normal —–
blog comments powered by Disqus