hunterakins / pyat

Provide Python functions for reading and writing the files required for the Acoustics Toolbox programs (KRAKEN, BELLHOP, SCOOTER). Also defines objects that represent the basic elements of an acoustic simulation.
GNU General Public License v3.0
29 stars 9 forks source link

Calculating modes for multiple frequencies #1

Closed John-Ragland closed 2 years ago

John-Ragland commented 2 years ago

Do you know if there is a way to run kraken for multiple frequencies (without just using a forloop and calling kraken.exe over and over again)? There seems to be hints that this feature exists throughout kraken, but I haven't found any direct answer in the documentation. For instance the shade file has a dimension for different frequencies that always seems to be size 1.

This isn't strictly a pyat question, but thought you might know.

Thanks

hunterakins commented 2 years ago

Yes, although pyat doesn't have support for that. See that broadband example in the Acoustics Toolbox (under the tests folder). The MunkK.env file theere shows an example where there are 2 frequencies specified. It would be easy to implement in pyat, and in a way that is backwards compatible (check if input frequency to write env is a list or a float/int, then write it in the appropriate way). What's the problem with the forloop? Too slow?

emma-ozanich commented 2 years ago

Hi guys, So it seems like the broadband method is only valid for range-independent cases? It errors when I try to run Krakenc with a range-dependent profile. Any thoughts? And same, looping is just kind of slow. By the way, I created a function to copy an env file and just replace the frequency, which will save you a fair amount of write time. -Emma

hunterakins commented 2 years ago

Emma, Haven't messed around much with the broadband method. There may be a way to get it to work for range-dependent, but I don't know it. With regard to cutting down loop time, is reading and writing env files the main bottleneck? If so, there is a general way to speed it up using memory mapped files in reading and writing that I have considered implementing but haven't tried yet.