Skip to content

Commit

Permalink
Merge pull request #10 from 1oly/joss1
Browse files Browse the repository at this point in the history
Updates to README and documentation
  • Loading branch information
1oly authored Apr 10, 2024
2 parents 7fdb5d4 + 8695a82 commit 95e4875
Show file tree
Hide file tree
Showing 3 changed files with 217 additions and 10 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ First install [julia](http://julialang.org) and start julia in a terminal, [VS c
pkg> add AeroAcoustics
```
the package manager `pkg>` can be accessed by typing `]`.
## Tests
This package constains tests used for CI, but can also be used to check if the package is working properly when installed. To run the tests, after adding the package, activate the package manager, by typing `]`, and write
```
pkg> test AeroAcoustics
```
The test suite will download an external file, that is stored in `test/data`.
## Documentation
The [documentation](https://1oly.github.io/AeroAcoustics.jl/dev/) gives an introduction to the packages and the API.
## Contribution
Contributions are welcome! Issues are tracked on [Github issue tracker](https://github.com/1oly/AeroAcoustics.jl/issues). If you want to add an new algorithm, you can fork this package and start developing your code and test it.

Expand Down
8 changes: 4 additions & 4 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ using HDF5, AeroAcoustics, PyPlot
```
Open the hdf5 file from the test directory and assemble the data to a Complex array.
```
csm_file = joinpath(dirname(@__DIR__),"test","data","test1_csm.h5")
csm_file = joinpath(replace(dirname(pathof(AeroAcoustics)),"src"=>"test"),"data","test1_csm.h5")
csm_ref = h5open(csm_file, "r") do file
read(file, "CsmData/csmReal")+im*read(file, "CsmData/csmImag")
end
Expand Down Expand Up @@ -86,11 +86,11 @@ Check out `examples/Quick_start.ipynb` to see examples of the acoustic images.

### Source integration
In a typical workflow, the acoustic images are used to focus on selected regions
of the spatial domain and extract a spectrum. The source integration is called with
of the spatial domain and extract a spectrum. The source integration is used on an acoustic map, e.g., `b`, `xSC`, or `xD`, computed above.
```
sourceintegration(x,E,int_region)
sourceintegration(b,E,int_region)
```
where `x` is the source map, `E` the environment struct and `int_region` describe the limits of
where `b` is the source map, `E` the environment struct and `int_region` describe the limits of
a square to integrate over. A utility function `AeroAcoustics.point_to_region` can help define limits
by giving a point and extent as input, e.g.,
```
Expand Down
211 changes: 205 additions & 6 deletions examples/Quick_start.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -13,7 +13,206 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## 1. Quick start"
"## 1. Quick start\n",
"We will use measurement data downloaded for the unit tests, which is located in `/data`. \n",
"If you did not run the tests, you can either do that now or download the file manually."
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"\u001b[32m\u001b[1m Testing\u001b[22m\u001b[39m AeroAcoustics\n",
"\u001b[32m\u001b[1m Status\u001b[22m\u001b[39m `/private/var/folders/__/b6h41j4s2px67g4g_3g64bq80000gn/T/jl_uX5VsS/Project.toml`\n",
" \u001b[90m[03ede2b8] \u001b[39mAeroAcoustics v0.2.3 `~/.julia/dev/AeroAcoustics`\n",
" \u001b[90m[717857b8] \u001b[39mDSP v0.7.9\n",
" \u001b[90m[b4f34e82] \u001b[39mDistances v0.10.11\n",
" \u001b[90m[7a1cc6ca] \u001b[39mFFTW v1.8.0\n",
"\u001b[32m⌃\u001b[39m \u001b[90m[f67ccb44] \u001b[39mHDF5 v0.16.16\n",
"\u001b[32m⌃\u001b[39m \u001b[90m[5078a376] \u001b[39mLazyArrays v1.8.3\n",
" \u001b[90m[2774e3e8] \u001b[39mNLsolve v4.5.1\n",
" \u001b[90m[d96e819e] \u001b[39mParameters v0.12.3\n",
" \u001b[90m[ac1d9e8a] \u001b[39mThreadsX v0.1.12\n",
" \u001b[90m[ade2ca70] \u001b[39mDates\n",
" \u001b[90m[f43a241f] \u001b[39mDownloads v1.6.0\n",
" \u001b[90m[37e2e46d] \u001b[39mLinearAlgebra\n",
" \u001b[90m[ea8e919c] \u001b[39mSHA v0.7.0\n",
" \u001b[90m[10745b16] \u001b[39mStatistics v1.10.0\n",
" \u001b[90m[8dfed614] \u001b[39mTest\n",
"\u001b[32m\u001b[1m Status\u001b[22m\u001b[39m `/private/var/folders/__/b6h41j4s2px67g4g_3g64bq80000gn/T/jl_uX5VsS/Manifest.toml`\n",
" \u001b[90m[621f4979] \u001b[39mAbstractFFTs v1.5.0\n",
"\u001b[32m⌃\u001b[39m \u001b[90m[7d9f7c33] \u001b[39mAccessors v0.1.35\n",
"\u001b[32m⌃\u001b[39m \u001b[90m[79e6a3ab] \u001b[39mAdapt v4.0.1\n",
" \u001b[90m[03ede2b8] \u001b[39mAeroAcoustics v0.2.3 `~/.julia/dev/AeroAcoustics`\n",
" \u001b[90m[dce04be8] \u001b[39mArgCheck v2.3.0\n",
"\u001b[32m⌃\u001b[39m \u001b[90m[4fba245c] \u001b[39mArrayInterface v7.7.1\n",
"\u001b[32m⌃\u001b[39m \u001b[90m[4c555306] \u001b[39mArrayLayouts v1.6.0\n",
" \u001b[90m[198e06fe] \u001b[39mBangBang v0.4.1\n",
" \u001b[90m[9718e550] \u001b[39mBaselet v0.1.1\n",
" \u001b[90m[bbf7d656] \u001b[39mCommonSubexpressions v0.3.0\n",
" \u001b[90m[34da2185] \u001b[39mCompat v4.14.0\n",
" \u001b[90m[a33af91c] \u001b[39mCompositionsBase v0.1.2\n",
"\u001b[32m⌃\u001b[39m \u001b[90m[187b0558] \u001b[39mConstructionBase v1.5.4\n",
" \u001b[90m[717857b8] \u001b[39mDSP v0.7.9\n",
" \u001b[90m[9a962f9c] \u001b[39mDataAPI v1.16.0\n",
" \u001b[90m[e2d170a0] \u001b[39mDataValueInterfaces v1.0.0\n",
" \u001b[90m[244e2a9f] \u001b[39mDefineSingletons v0.1.2\n",
" \u001b[90m[163ba53b] \u001b[39mDiffResults v1.1.0\n",
" \u001b[90m[b552c78f] \u001b[39mDiffRules v1.15.1\n",
" \u001b[90m[b4f34e82] \u001b[39mDistances v0.10.11\n",
" \u001b[90m[ffbed154] \u001b[39mDocStringExtensions v0.9.3\n",
" \u001b[90m[7a1cc6ca] \u001b[39mFFTW v1.8.0\n",
"\u001b[32m⌃\u001b[39m \u001b[90m[1a297f60] \u001b[39mFillArrays v1.9.3\n",
"\u001b[32m⌃\u001b[39m \u001b[90m[6a86dc24] \u001b[39mFiniteDiff v2.22.0\n",
" \u001b[90m[f6369f11] \u001b[39mForwardDiff v0.10.36\n",
"\u001b[32m⌃\u001b[39m \u001b[90m[f67ccb44] \u001b[39mHDF5 v0.16.16\n",
" \u001b[90m[22cec73e] \u001b[39mInitialValues v0.3.1\n",
"\u001b[32m⌃\u001b[39m \u001b[90m[3587e190] \u001b[39mInverseFunctions v0.1.12\n",
" \u001b[90m[92d709cd] \u001b[39mIrrationalConstants v0.2.2\n",
" \u001b[90m[c8e1da08] \u001b[39mIterTools v1.10.0\n",
" \u001b[90m[82899510] \u001b[39mIteratorInterfaceExtensions v1.0.0\n",
" \u001b[90m[692b3bcd] \u001b[39mJLLWrappers v1.5.0\n",
"\u001b[32m⌃\u001b[39m \u001b[90m[5078a376] \u001b[39mLazyArrays v1.8.3\n",
" \u001b[90m[d3d80556] \u001b[39mLineSearches v7.2.0\n",
" \u001b[90m[2ab3a3ac] \u001b[39mLogExpFunctions v0.3.27\n",
" \u001b[90m[3da0fdf6] \u001b[39mMPIPreferences v0.1.10\n",
" \u001b[90m[1914dd2f] \u001b[39mMacroTools v0.5.13\n",
"\u001b[32m⌃\u001b[39m \u001b[90m[a3b82374] \u001b[39mMatrixFactorizations v2.1.0\n",
" \u001b[90m[128add7d] \u001b[39mMicroCollections v0.2.0\n",
" \u001b[90m[d41bc354] \u001b[39mNLSolversBase v7.8.3\n",
" \u001b[90m[2774e3e8] \u001b[39mNLsolve v4.5.1\n",
" \u001b[90m[77ba4419] \u001b[39mNaNMath v1.0.2\n",
" \u001b[90m[bac558e1] \u001b[39mOrderedCollections v1.6.3\n",
" \u001b[90m[d96e819e] \u001b[39mParameters v0.12.3\n",
" \u001b[90m[f27b6e38] \u001b[39mPolynomials v4.0.6\n",
"\u001b[32m⌃\u001b[39m \u001b[90m[aea7be01] \u001b[39mPrecompileTools v1.2.0\n",
"\u001b[32m⌃\u001b[39m \u001b[90m[21216c6a] \u001b[39mPreferences v1.4.1\n",
" \u001b[90m[3cdcf5f2] \u001b[39mRecipesBase v1.3.4\n",
" \u001b[90m[189a3867] \u001b[39mReexport v1.2.2\n",
" \u001b[90m[42d2dcc6] \u001b[39mReferenceables v0.1.3\n",
" \u001b[90m[ae029012] \u001b[39mRequires v1.3.0\n",
" \u001b[90m[efcf1570] \u001b[39mSetfield v1.1.1\n",
" \u001b[90m[276daf66] \u001b[39mSpecialFunctions v2.3.1\n",
" \u001b[90m[171d559e] \u001b[39mSplittablesBase v0.1.15\n",
" \u001b[90m[1e83bf80] \u001b[39mStaticArraysCore v1.4.2\n",
" \u001b[90m[82ae8749] \u001b[39mStatsAPI v1.7.0\n",
" \u001b[90m[3783bdb8] \u001b[39mTableTraits v1.0.1\n",
" \u001b[90m[bd369af6] \u001b[39mTables v1.11.1\n",
" \u001b[90m[ac1d9e8a] \u001b[39mThreadsX v0.1.12\n",
" \u001b[90m[28d57a85] \u001b[39mTransducers v0.4.81\n",
" \u001b[90m[3a884ed6] \u001b[39mUnPack v1.0.2\n",
" \u001b[90m[f5851436] \u001b[39mFFTW_jll v3.3.10+0\n",
"\u001b[32m⌃\u001b[39m \u001b[90m[0234f1f7] \u001b[39mHDF5_jll v1.14.2+1\n",
" \u001b[90m[e33a78d0] \u001b[39mHwloc_jll v2.10.0+0\n",
" \u001b[90m[1d5cc7b8] \u001b[39mIntelOpenMP_jll v2024.0.2+0\n",
" \u001b[90m[1d63c593] \u001b[39mLLVMOpenMP_jll v15.0.7+0\n",
" \u001b[90m[856f044c] \u001b[39mMKL_jll v2024.0.0+0\n",
" \u001b[90m[7cb0a576] \u001b[39mMPICH_jll v4.2.0+0\n",
" \u001b[90m[f1f71cc9] \u001b[39mMPItrampoline_jll v5.3.2+0\n",
" \u001b[90m[9237b28f] \u001b[39mMicrosoftMPI_jll v10.1.4+2\n",
" \u001b[90m[fe0851c0] \u001b[39mOpenMPI_jll v5.0.2+0\n",
"\u001b[32m⌃\u001b[39m \u001b[90m[458c3c95] \u001b[39mOpenSSL_jll v3.0.13+0\n",
" \u001b[90m[efe28fd5] \u001b[39mOpenSpecFun_jll v0.5.5+0\n",
"\u001b[32m⌃\u001b[39m \u001b[90m[32165bc3] \u001b[39mPMIx_jll v4.2.7+0\n",
"\u001b[32m⌃\u001b[39m \u001b[90m[477f73a3] \u001b[39mlibaec_jll v1.0.6+1\n",
" \u001b[90m[1080aeaf] \u001b[39mlibevent_jll v2.1.13+1\n",
" \u001b[90m[eb928a42] \u001b[39mprrte_jll v3.0.2+0\n",
" \u001b[90m[0dad84c5] \u001b[39mArgTools v1.1.1\n",
" \u001b[90m[56f22d72] \u001b[39mArtifacts\n",
" \u001b[90m[2a0f44e3] \u001b[39mBase64\n",
" \u001b[90m[ade2ca70] \u001b[39mDates\n",
" \u001b[90m[8ba89e20] \u001b[39mDistributed\n",
" \u001b[90m[f43a241f] \u001b[39mDownloads v1.6.0\n",
" \u001b[90m[7b1f6079] \u001b[39mFileWatching\n",
" \u001b[90m[9fa8497b] \u001b[39mFuture\n",
" \u001b[90m[b77e0a4c] \u001b[39mInteractiveUtils\n",
" \u001b[90m[4af54fe1] \u001b[39mLazyArtifacts\n",
" \u001b[90m[b27032c2] \u001b[39mLibCURL v0.6.4\n",
" \u001b[90m[76f85450] \u001b[39mLibGit2\n",
" \u001b[90m[8f399da3] \u001b[39mLibdl\n",
" \u001b[90m[37e2e46d] \u001b[39mLinearAlgebra\n",
" \u001b[90m[56ddb016] \u001b[39mLogging\n",
" \u001b[90m[d6f4376e] \u001b[39mMarkdown\n",
" \u001b[90m[a63ad114] \u001b[39mMmap\n",
" \u001b[90m[ca575930] \u001b[39mNetworkOptions v1.2.0\n",
" \u001b[90m[44cfe95a] \u001b[39mPkg v1.10.0\n",
" \u001b[90m[de0858da] \u001b[39mPrintf\n",
" \u001b[90m[3fa0cd96] \u001b[39mREPL\n",
" \u001b[90m[9a3f8284] \u001b[39mRandom\n",
" \u001b[90m[ea8e919c] \u001b[39mSHA v0.7.0\n",
" \u001b[90m[9e88b42a] \u001b[39mSerialization\n",
" \u001b[90m[6462fe0b] \u001b[39mSockets\n",
" \u001b[90m[2f01184e] \u001b[39mSparseArrays v1.10.0\n",
" \u001b[90m[10745b16] \u001b[39mStatistics v1.10.0\n",
" \u001b[90m[4607b0f0] \u001b[39mSuiteSparse\n",
" \u001b[90m[fa267f1f] \u001b[39mTOML v1.0.3\n",
" \u001b[90m[a4e569a6] \u001b[39mTar v1.10.0\n",
" \u001b[90m[8dfed614] \u001b[39mTest\n",
" \u001b[90m[cf7118a7] \u001b[39mUUIDs\n",
" \u001b[90m[4ec0a83e] \u001b[39mUnicode\n",
" \u001b[90m[e66e0078] \u001b[39mCompilerSupportLibraries_jll v1.0.5+1\n",
" \u001b[90m[deac9b47] \u001b[39mLibCURL_jll v8.4.0+0\n",
" \u001b[90m[e37daf67] \u001b[39mLibGit2_jll v1.6.4+0\n",
" \u001b[90m[29816b5a] \u001b[39mLibSSH2_jll v1.11.0+1\n",
" \u001b[90m[c8ffd9c3] \u001b[39mMbedTLS_jll v2.28.2+1\n",
" \u001b[90m[14a3606d] \u001b[39mMozillaCACerts_jll v2023.1.10\n",
" \u001b[90m[4536629a] \u001b[39mOpenBLAS_jll v0.3.23+2\n",
" \u001b[90m[05823500] \u001b[39mOpenLibm_jll v0.8.1+2\n",
" \u001b[90m[bea87d4a] \u001b[39mSuiteSparse_jll v7.2.1+1\n",
" \u001b[90m[83775a58] \u001b[39mZlib_jll v1.2.13+1\n",
" \u001b[90m[8e850b90] \u001b[39mlibblastrampoline_jll v5.8.0+1\n",
" \u001b[90m[8e850ede] \u001b[39mnghttp2_jll v1.52.0+1\n",
" \u001b[90m[3f19e933] \u001b[39mp7zip_jll v17.4.0+2\n",
"\u001b[36m\u001b[1m Info\u001b[22m\u001b[39m Packages marked with \u001b[32m⌃\u001b[39m have new versions available and may be upgradable.\n",
"\u001b[32m\u001b[1m Testing\u001b[22m\u001b[39m Running tests...\n",
"\u001b[0m\u001b[1mTest Summary: | \u001b[22m\u001b[32m\u001b[1mPass \u001b[22m\u001b[39m\u001b[36m\u001b[1mTotal \u001b[22m\u001b[39m\u001b[0m\u001b[1m Time\u001b[22m\n",
"AeroAcoustics | \u001b[32m 45 \u001b[39m\u001b[36m 45 \u001b[39m\u001b[0m11.9s\n",
"\u001b[32m\u001b[1m Testing\u001b[22m\u001b[39m AeroAcoustics tests passed \n"
]
}
],
"source": [
"using Pkg\n",
"Pkg.test(\"AeroAcoustics\")"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"\"/Users/ollyl/.julia/dev/AeroAcoustics/test/data/test1_csm.h5\""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"using Downloads\n",
"url = \"https://gitlab.windenergy.dtu.dk/ollyl/aeroacousticsdata/raw/master\"\n",
"outputdir = joinpath(replace(dirname(pathof(AeroAcoustics)),\"src\"=>\"test\"),\"data\")\n",
"isdir(outputdir) || mkpath(outputdir)\n",
"if !isfile(joinpath(outputdir,\"test1_csm.h5\"))\n",
" Downloads.download(joinpath(url,\"data/test1_csm.h5\" * \"?inline=false\"),joinpath(outputdir,\"test1_csm.h5\"))\n",
"else\n",
" println(\"File already exists...\")\n",
"end"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Read the downloaded h5 datafiles into julia arrays:"
]
},
{
Expand All @@ -33,7 +232,7 @@
}
],
"source": [
"csm_file = joinpath(dirname(@__DIR__),\"test\",\"data\",\"test1_csm.h5\")\n",
"csm_file = joinpath(replace(dirname(pathof(AeroAcoustics)),\"src\"=>\"test\"),\"data\",\"test1_csm.h5\")\n",
"csm_ref = h5open(csm_file, \"r\") do file\n",
" read(file, \"CsmData/csmReal\")+im*read(file, \"CsmData/csmImag\")\n",
"end\n",
Expand Down Expand Up @@ -387,15 +586,15 @@
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.7.2",
"display_name": "Julia 1.10.0",
"language": "julia",
"name": "julia-1.7"
"name": "julia-1.10"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.7.2"
"version": "1.10.0"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 95e4875

Please sign in to comment.