Code Monkey home page Code Monkey logo

python-sofa's Introduction

Spatially Oriented Format for Acoustics (SOFA) API for Python

A Python API for reading, writing and creating SOFA files as defined by the SOFA conventions (version 1.0) found at https://www.sofaconventions.org/.

Documentation:
https://python-sofa.readthedocs.io/
Source code and issue tracker:
https://github.com/spatialaudio/python-sofa/
License:
MIT -- see the file LICENSE for details.
Quick start:
  • Install Python 3
  • python3 -m pip install python-sofa --user
  • Check out the examples in the documentation

python-sofa's People

Contributors

jnlossner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-sofa's Issues

Writing sofa file results in UNSUPPORTED DATATYPE

Hi,

I have followed this description on how to generate a new SOFA file,

As a result, I have "generated" this python script, which does exactly, what is described in the documentation.

Running this Python script results in this SOFA file.

If I inspect the produced SOFA file , using the netCDF function "ncdisp" in Matlab, I see that apparently all attributes are of UNSUPPORTED DATATYPE.
For a copy of the results, please refer to this Matlab diary.

I have tried manually assigning what I assumed to be valid values for the attributes before saving the sofa file, but I have not been able to produce any other result than UNSUPPORTED DATATYPE, when inspecting the file using ncdisp.

Let me know, if you need more information from me.

BR Jacob Riiser

API for duplicating a SOFA file

There seem to be no functionality for loading an HRTF set and saving it into a different file (for example, after having edited its content). Would you recommend a way of implementing this?

Importing Python-SOFA in parallel to h5py fails on Windows.

When importing SOFA and h5py Python throws:
` UserWarning: h5py is running against HDF5 1.12.1 when it was built against 1.12.2, this may cause problems
_warn(("h5py is running against HDF5 {0} when it was built against {1}, "
Warning! HDF5 library version mismatched error
The HDF5 header files used to compile this application do not match
the version used by the HDF5 library to which this application is linked.
Data corruption or segmentation faults may occur if the application continues.
This can happen when an application was compiled by one version of HDF5 but
linked with a different version of static or shared HDF5 library.
You should recompile the application or check your shared library related
settings such as 'LD_LIBRARY_PATH'.
You can, at your own risk, disable this warning by setting the environment
variable 'HDF5_DISABLE_VERSION_CHECK' to a value of '1'.
Setting it to 2 or higher will suppress the warning messages totally.
Headers are 1.12.2, library is 1.12.1
SUMMARY OF THE HDF5 CONFIGURATION
=================================

General Information:

               HDF5 Version: 1.12.1
              Configured on: 2022-03-04
              Configured by: Ninja
                Host system: Windows-10.0.17763
          Uname information: Windows
                   Byte sex: little-endian
         Installation point: D:/bld/hdf5_split_1646412547396/_h_env/Library

Compiling Options:

                 Build Mode: RELEASE
          Debugging Symbols: OFF
                    Asserts: OFF
                  Profiling: OFF
         Optimization Level: OFF

Linking Options:

                  Libraries:

Statically Linked Executables: OFF
LDFLAGS: /machine:x64
H5_LDFLAGS:
AM_LDFLAGS:
Extra libraries: D:/bld/hdf5_split_1646412547396/_h_env/Library/lib/libcurl.lib;D:/bld/hdf5_split_1646412547396/_h_env/Library/lib/libssl.lib;D:/bld/hdf5_split_1646412547396/_h_env/Library/lib/libcrypto.lib
Archiver: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64/lib.exe
Ranlib: :

Languages:

                          C: YES
                 C Compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64/cl.exe 19.16.27045.0
                   CPPFLAGS:
                H5_CPPFLAGS:
                AM_CPPFLAGS:
                     CFLAGS:   /DWIN32 /D_WINDOWS
                  H5_CFLAGS: /W3;/wd4100;/wd4706;/wd4127
                  AM_CFLAGS:
           Shared C Library: YES
           Static C Library: YES

                    Fortran: OFF
           Fortran Compiler:
              Fortran Flags:
           H5 Fortran Flags:
           AM Fortran Flags:
     Shared Fortran Library: YES
     Static Fortran Library: YES

                        C++: ON
               C++ Compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64/cl.exe 19.16.27045.0
                  C++ Flags:
               H5 C++ Flags: /W3;/wd4100;/wd4706;/wd4127
               AM C++ Flags:
         Shared C++ Library: YES
         Static C++ Library: YES

                        JAVA: OFF
             JAVA Compiler:

Features:

               Parallel HDF5: OFF

Parallel Filtered Dataset Writes:
Large Parallel I/O:
High-level library: ON
Build HDF5 Tests: ON
Build HDF5 Tools: ON
Threadsafety: ON (recursive RW locks: )
Default API mapping: v112
With deprecated public symbols: ON
I/O filters (external): DEFLATE
MPE:
Direct VFD:
Mirror VFD:
(Read-Only) S3 VFD: 1
(Read-Only) HDFS VFD:
dmalloc:
Packages w/ extra debug output:
API Tracing: OFF
Using memory checker: OFF
Memory allocation sanity checks: OFF
Function Stack Tracing: OFF
Use file locking: best-effort
Strict File Format Checks: OFF
Optimization Instrumentation:
Bye...`

Discovered on Windows 10 and not reproducable on Ubuntu.

Initialisation of "View" as the only varying Coordinate not possible

In version 0.2.0, there seems to be a problem with initialising "View" as the only varying Coordinate:

Reproducing code example:

import sofa

HRIR = sofa.Database.create(
    'test.sofa',
    "MultiSpeakerBRIR", 
    dimensions={"M": 10, 
                "N": 1024, 
                "S": 128,
                "E": 3,
                "R": 2,
               }
)

HRIR.Listener.initialize(fixed=["Position", "Up"], variances=["View"])   # error
HRIR.Listener.initialize(fixed=["Position"], variances=["View", "Up"])  # works

Output:

Exception: failed to get Units of ListenerView, variable not initialized

I'm not sure, if this is intended, as there are cases where BRIR dataset only have the ListenerView as the varying variable. If yes, the error message could be explaining the user, that one cannot initialise View as the only varying coordinate.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.