- #1
person123
- 328
- 52
- TL;DR Summary
- I'm working on developing an API for data analysis and I want to know what similar opensource code already exists and what would be the most useful route to develop it.
(As a quick note, 'wave flume' should be taken rather generally. I basically just mean the sort of experiments involved in the flow of water which may use instruments such as pressure gauges, load cells, wave gauges, and ADVs. I know that they're not always done in a flume per say -- the experiment I'm analyzing data from was technically conducted in a basin and not a flume -- but I'm not sure of the proper term).
I'm an REU student assigned to analyze data from an experiment conducted at the HWRL. Here is a link to a news article about it. I'm working on an API in MATLAB to help with analyzing data from sensors such as those in those sort of experiments. The individual functions were all created for me for this specific project, but an API would allow you to use what I wrote however you like. I have an extremely crude version already written, but it would be pretty much useless for others (it's extremely slow, it crashes, it's not at all user-friendly). (Some problems include: there's no documentation, there's only a single class, making my own GUI instead of using documentation causes it to crash due to a graphics error). It was, however, a proof of concept, and I'm now going to start to gradually build an API which will hopefully be useful. I already have some features which could be used for general purposes (not limited to 'wave flume' type experiments):
I'm a bit hesitant of adding this as a footnote; as I don't know if it's possible, I don't know how to do it, and I'm sure I wouldn't be able to do it; but I could imagine it may be theoretically possible to connect the API with some CFD software. It would have to use this to figure out what's going on in your server and somehow talk to the software. The software would need to know how to set everything up. It would need a lot of information: dimensions of everything, all boundary conditions, all the information about the wave conditions etc. That information would be fed to the software as directions and the software would follow those directions to run a simulation. (Something like this, but probably a lot simpler, might also work with CAD software). Again though, I have no idea if this is possible.
I'm an REU student assigned to analyze data from an experiment conducted at the HWRL. Here is a link to a news article about it. I'm working on an API in MATLAB to help with analyzing data from sensors such as those in those sort of experiments. The individual functions were all created for me for this specific project, but an API would allow you to use what I wrote however you like. I have an extremely crude version already written, but it would be pretty much useless for others (it's extremely slow, it crashes, it's not at all user-friendly). (Some problems include: there's no documentation, there's only a single class, making my own GUI instead of using documentation causes it to crash due to a graphics error). It was, however, a proof of concept, and I'm now going to start to gradually build an API which will hopefully be useful. I already have some features which could be used for general purposes (not limited to 'wave flume' type experiments):
- I have not written code to allow you to customize the type of data you want to extract from the raw data because it has not been useful for me yet, but I think this would be essential to implement if I were to make an API. An example of extracted data is the wave height recorded for each trial for each sensor. (I'm not going to go over how I extracted all of the data on this main post because it isn't that relevant, but I would be more than happy to explain all the steps I took if someone wanted me to).
- Built in constants. For me, all I needed so far was water density and the acceleration due to gravity.
- Allows you to create your own constants. In my case, for example, one house was on stilts and the stilt height would be a good constant.
- Allows you to create your own parameters based on those constants. Using the previous example, I then made the parameter air gap which used the constant stilt height (the air gap is the stilt height minus water depth).
- Allows you to plot those created parameters against one another. (There are three parameters: independent, dependent, and legend -- the legend is automatically constructed based on unique values). For example, I could then plot uplift vs. the air gap parameter I constructed at different water depths say (just a random example). The title and labels are automatically generated based on your selection.
- Allows you to automatically save figures and update a PowerPoint with those figures (I haven't used Word yet, so I haven't implemented that yet, but I probably will once I start writing my research paper).
- Computes uplift and moment from pressure gauge readings using different methods. There were multiple pressure gauges on the bottom of the house, and I think having multiple pressure gauges all in the same plane is fairly general. Originally I computed using uplift and moment using a bilinear multivariable regression. (I actually deleted that code because my mentor said he didn't want to do it like that, but I could rewrite it very easily. I could even simply build the structure of it using mvregress and the user could choose the kind of fit they want). However I also used tributary areas and a linear regression to compute uplift and moment -- both assume pressure doesn't vary along the long-shore direction of the house.
- Computes phase average with period and sample rate of sensor as an input. (I'm not sure if my code for Fourier Transform is correct -- I haven't really looked at it because I haven't been asked to use it yet).
- Computing wave height using wave gauges. It first finds the phase average, then finds the difference between the maximum and minimum value of the phase average.
- Computes wavelength using linear wave theory (it takes water depth and wave period as inputs and uses vpasolve (built-in function to solve equation numerically) to determine the wavelength.
- It computes uplift and moment from load cells (fairly self-explanatory I think).
- A method for computing wave energy to use for normalization (in my case, I used ##E=\rho g H y## (##H## is wave height and ##y## is the length of the house in the long-shore direction)
- There are other things I implemented which my mentor said weren't useful to our project, but may be useful in general:
- Computes wave height using Green's Law. The wave height at the wave maker is stored in the metadata so I could use Green's Law to account for shoaling during wave propagation. (The flume bottom was at a tilt so the depth decreased as the wave propagated). The waves were already broken, or close to breaking by the time it came in contact with the house, so for us it wouldn't be accurate.
- Computes wave length by finding the shift in wave gauge readings between successive sensors and takes the cross-shore distance between the gauges as inputs. Noisy reading, a fairly poor method for calculating it (it counted every time the reading crosses zero as half a period, making it useless for noisy reading), and the fact we can use linear wave theory made it useless for us. However, I could create a more robust algorithm (I'm thinking of minimizing the difference between the two readings by shifting one reading through time to match the other) if it turns out to be useful (maybe you don't want to approximate with linear wave theory).
I'm a bit hesitant of adding this as a footnote; as I don't know if it's possible, I don't know how to do it, and I'm sure I wouldn't be able to do it; but I could imagine it may be theoretically possible to connect the API with some CFD software. It would have to use this to figure out what's going on in your server and somehow talk to the software. The software would need to know how to set everything up. It would need a lot of information: dimensions of everything, all boundary conditions, all the information about the wave conditions etc. That information would be fed to the software as directions and the software would follow those directions to run a simulation. (Something like this, but probably a lot simpler, might also work with CAD software). Again though, I have no idea if this is possible.
Last edited: