Git Product home page Git Product logo

ctraceo's Introduction

################################################################
##                                                            ##
##           The cTraceo Acoustic Raytracing Model            ##
##                                                            ##
################################################################
## Website:                                                   ##
##          https://github.com/EyNuel/cTraceo/wiki            ##
##                                                            ##
## License: This file is part of the cTraceo Raytracing Model ##
##          and is released under the Creative Commons        ##
##          Attribution-NonCommercial-ShareAlike 3.0 Unported ##
##          License (CC BY-NC-SA 3.0)                         ## 
##          http://creativecommons.org/licenses/by-nc-sa/3.0/ ##
##                                                            ##
## NOTE:    cTraceo is research code under active development.##
##          The code may contain bugs and updates are possible##
##          in the future.                                    ##
##                                                            ##  
## Written for project SENSOCEAN by:                          ##  
##          Emanuel Ey                                        ##  
##          [email protected]                              ##  
##          Copyright (C) 2011, 2012                          ##  
##          Signal Processing Laboratory                      ##  
##          Universidade do Algarve                           ##  
##                                                            ##  
## cTraceo is the C port of the FORTRAN 77 TRACEO code,       ##
## written by:                                                ##
##          Orlando Camargo Rodriguez:                        ##  
##          Copyright (C) 2010                                ##  
##          Orlando Camargo Rodriguez                         ##  
##          [email protected]                                   ##  
##          Universidade do Algarve                           ##  
##          Physics Department                                ##  
##          Signal Processing Laboratory                      ##  
##                                                            ##
################################################################


################################################################
## Contents:
 * Features
 * Software Requirements
 * Makefile Configuration
 * Compilation & Installation
 * Matlab Configuration & Examples
 * License Notes.

################################################################
## Features:

 # Range dependent altimetry/bathymetry including range dependent
  elastic properties (Compressional and shear wave speeds,
  density, as well as compressional and shear attenuation);
  
 # Range dependent sound speed fields;
 
 # Support for user-defined smooth objects within waveguide
   (like rocks, marine mammals, submarines);
   
 # Full suppport for backscattering (from altimetry/bathymetry
   or objects);
   
 # Allows free positioning of acoustic source and receivers
   (altimetry/bathymetry as well as objects and receivers may be
   positioned behind the source for modelling complex waveguides);
   
 # Support for horizontal, vertical, rectangular and arbitrarily
   shaped receiver arrays (allows modelling unusual array shapes,
   multiple arrays as well as array distortions);
   
 # Output options: ray trajectories and amplitudes, eigenray
   search (with user-definable proximity threshhold), arrival
   patterns, acoustic pressure, coherent transmission loss, as
   well as particle velocity components (for modelling vector
   sensors).
   
 # Outputs are written to .mat files (does not require Matlab(R)
   for compilation/usage)

################################################################
## Software Requirements

# Matlab (Optional)
  This software generates Matlab .mat-files as output, and
  provides 2 methods for writing these files.
  1 - Linking with Matlab(R) libraries during compilation.
  2 - Using a set of internal functions.
  Option 2 is now the recommended method and is enabled by default.
  Although it is still possible to fall back to option 1 this
  requires some extra configuration, is only supported on Linux
  and requires a Matlab(R) License to be available.
  

# Compiler Support
  cTraceo requires a C Compiler compatible with the ISO C99
  Standard. This is mostly due to the need for complex
  (Imaginary) Math.
  
 * The GNU C Compiler
   GCC fully supports the ISO C99 standard as of version 4.5.
   The 4.3.x and 4.4.x versions partially implement the C99
   standard and although warnings related to imaginary math may
   be generated, the code is compiled successfully.
   Successfully tested with versions 4.4.4 and 4.4.5 on Linux as
   well as with version 4.5.3 on Windows (using Cygwin)
  
 * Clang - LLVM C Language Frontend
   The Clang compiler is the compiler used for development of the
   cTraceo Model.
   Successfully tested with versions 2.8 and 2.9 on Linux.
  
 * MS Visual Studio
   No version of Microsoft's Visual Studio C Compiler supports 
   the ISO C99 Standard, so compilation should not be possible.
   Not tested.



################################################################
## Makefile Configuration
   To compile this model the user may have to adapt the included
   makefile to match the target system.
   Although the options in the Makefile are mostly self-
   -explanatory, a brief overview will be presented here:

# The "CC" variable
  Defines which command to invoke for compilation.
  
# The "OS" Variable:
  Defines for which operating system to compile.

# The "ARCH" variable
  This is used to define whether to compile for 32 bit or 64 bit
  systems.

# The "USE_MATLAB" variable
  When compiling cTraceo on Linux it is possible to choose between
  using Matlab or the internal functions to write the result files.
  If in doubt, leave at "0". Note that linking with matlab is only
  supported in linux.
   
# The "MATLAB_DIR" variable
  This variable should contain the base directory of the 
  system's Matlab(R) installation. This is needed when linking with 
  Matlab for writing .mat files, and is only possible on Linux.
  

# The "MATLAB_VERSION" variable
  As different versions of Matlab require different variable
  types for calling library functions, this option is required 
  for selecting the appropriate types.

################################################################
## Compilation and Installation

 # Linux
   After the options descibed in "Makefile Configuration" have
   been defined, just run:
    
   $> make
   
   This will compile the model and place a binary named "ctraceo"
   in the "bin/" subdirectory.
   
 # Windows
   To compile cTraceo on windows, several steps are required:
   
    * Download and install Cygwin from www.cygwin.com.
      Cygwin provides basic linux build tools (like 'make') for windows.
      When installing Cygwin packages, select the following packages:
        "devel > gcc4"
        "devel > make"
      Several other packages will be installed for dependencies.
    
    * Add "c:/cygwin/bin" to your system's PATH environment variable.
    
    * Open Cygwin. A command line will appear.
      This command line provides an interface similar to Linux, and
      allows for easy compilation of the model.
      In Cygwin, navigate to location which contains cTraceo's source
      code; this will look similar to:
        $> cd /cygdrive/c/Users/username/Documents/models/cTraceo
    
    * Run:
        $> make
      If all goes well, this will produce an executable called
      "ctraceo.exe" in the "bin/" subdirectory which can now be
      used like any other windows executable.
    
   
################################################################
## Matlab Configuration & Example Cases
   Several example cases are contained in the "examples/"
   subdirectory. These examples depend on matlab functions
   contained in the "M-Files/" subdirectory and as such this
   folder should be added to the matlab path.
   
   Within the provided example files the model is invoked by
   calling the command "ctraceo", and thus the "bin/" folder 
   containing the compiled cTraceo binary should be on the
   system's PATH.


################################################################
## License Notes
   The cTraceo Raytracing Model is released under the Creative
   Commons Attribution-NonCommercial-ShareAlike 3.0 Unported
   (CC BY-NC-SA 3.0) 
   http://creativecommons.org/licenses/by-nc-sa/3.0/

Below, a short, "human readable" version of the software license
is shown. Read the attached "license.txt" file for the full text
of the license.
----------------------------------------------------------------

In Short:
You are free:
    to Share — to copy, distribute and transmit the work
    to Remix — to adapt the work 

Under the following conditions:
    Attribution   — You must attribute The cTraceo Raytracing
                    Model to SiPLAB (with link to
                    http://www.siplab.fct.ualg.pt/)
    Noncommercial — You may not use this work for commercial 
                    purposes. 
    Share Alike   — If you alter, transform, or build upon this
                    work, you may distribute the resulting work
                    only under the same or similar license to
                    this one. 

With the understanding that:
    Waiver        — Any of the above conditions can be waived if
                    you get permission from the copyright holder.
    Public Domain — Where the work or any of its elements is in
                    the public domain under applicable law, that
                    status is in no way affected by the license.
    Other Rights  — In no way are any of the following rights
                    affected by the license:
                    # Your fair dealing or fair use rights, or
                      other applicable copyright exceptions and
                      limitations;
                    # The author's moral rights;
                    # Rights other persons may have either in
                      the work itself or in how the work is used,
                      such as publicity or privacy rights.
    Notice        — For any reuse or distribution, you must make
                    clear to others the license terms of this
                    work. The best way to do this is with a link to:
                    http://creativecommons.org/licenses/by-nc-sa/3.0/

ctraceo's People

Contributors

eynuel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ctraceo's Issues

Move ray memory allocation to cTraceo.c

Currently cTraceo.c calls the function corresponding to the selected output option [(calcRayCoords(), calsAllRayInfo(), etc ] which in turn does the memory allocation. In the OpenCL version this allocation has been moved up a level (ie. into cTraceo.c) to remove code redundancy.

Split into client/server parts

The client should read input files and send them to the server in the form of a settings struct (using sockets?).

The server:

  • adds received data to a queue
  • processes all items in queue
  • waits for work while queue is empty

Q: Should the server write the results to a file or send them back to the client?
A: Probably best to send back to client

Client may optionally handle a pool of servers and keep 2nd queue of tasks:

  • make sure a min/max number of tasks are in each server's queue
  • keep remaining tasks in client queue for load balancing

Actually, instead of putting all this functionality into the client, keep the client simple (only does dispatching and receiving of results) and write a 3rd program for load balancing called poolManager

Refraction point structures not filled-in corectly

Using stable version 1.3
The structures eigenrays.eigenray(n).refrac_r and eigenrays.eigenray(n).refrac_z do not seem to be filled-in correctly. In an example I ran where 11 eigenrays were found to the receiver, the structures were filled for ray number 1 only and were the wrong ones, corresponding to ray number 11. It seems that what happens is that the correct refraction points for the last ray are filed in only in the structure for the first ray.

bug

Makefile issues with doc/ subdirectory

when doc/ directory isn't present, te following error occurs when running make:

$ make 
find: `doc': No such file or directory 
find: `doc': No such file or directory 
find: `doc': No such file or directory 
find: `doc': No such file or directory 

Building cTraceo 1.3 with standard options -run 'make help' for more information. 

Coherent acoustic pressure incorrect when more than 500 rays are launched.

The coherent acoustic pressure (and thus transmission loss and particle velocity which depend on it) is incorrectly calculated with high numbers of rays.
With increasing number of rays, the pressure at hydrophones near the source is incorrect. The higher the number of rays, the further away from the source hydrophones are affected.
The "Thresshold" for correct output seems to be around 500 rays.

Implement single-precision version.

A single precision version was developed as a first step for the OpenCL version.
Although this is already available, it corresponds to the 1.0.1 version of cTraceo.
New functionality needs to be ported to SP.

source coordinate equal to rangebox's lower bound causes segfault.

What ?

Rs == rbox1 causes segfault

As many [Bellhop] users will likely run something like Rs = 0 and use a rangebox of [0, Rmax]
I consider this to be a major usabilty bug as the user has no way of knowing what causes the segfault.

Solution:

  • Add a check to readIn(), print a warning and exit, or
  • Silently resize the rangebox so that it includes the source? (maybe do this as a special case for rs = rbox1 = 0.0?)

Multiple Bottom Layers

As a new feature, maybe extend the model to consider multiple bottom layers rather than the single halfspace layer that it currently treats

Expand wctraceoinfile.m to do some data verification/completion before writing file

What?

For example:
if surface_data.type is nonelastic, allow omitting:
surface_data.ptype = '''H'''; % Homogeneous (or NonHomogeneous)
surface_data.units = '''W'''; % (Attenuation Units) dB/Wavelenght
surface_data.itype = '''FL'''; % Sea surface interpolation type
surface_data.properties = [0 0 0 0 0]; % Dummy values

Same for bottom properties

Why?

To make simple waveguides simple to describe. This way early examples become easier to understand for new users, plus a lot of unnecessary clutter gets removed from m-files.

also see issue #11

in "bracket()": replace bisection method by "hunt" method.

"bracket()" successively searches an ordered vector of numbers for a value's index using a bisection method.
Bisection of a vector to find an element is almost never optimal.
the "hunt" method stores the last found element's index and resumes searching from there, thus offering large time savings when searching for values which are close to another..

Include option to read bathymetrey's reflection coeff from separate file

Bellhop does something similar.
Bounce computes an interface's equivalent reflection coefficient for a multilayer bottom and generates an output file which can then be included in Bellhop.
File seems to contain a complex number for each bathymetry point -I'm assuming this is simply the interfaace's reflection coeff as computed internally by both cTraceo and Bellhop.

Add path definitions to all example M-Files

To ensure a better "out of the box" experience, examples should work without change from the user.
By adding

addpath('../M-Files/');
addpath('../bin/');

to the M-Files located in the 'examples/' subdirectory, the examples should work for all users without requiring change.

Write an example case for Python.

Although the model generates it's output as .mat files, this file format can be read by many different applications.
It would be interesting to have examples for applications other than Matlab, specifically one written in Python.

Cases:
a) run an RCO case and plot the results.
b) generate a channel's impulse response.

Output of integration routine may be imprecise

cTraceo uses a RKF45 method to integrate the ray paths.
The rk5 output is being used. This is an error, as the rk4 should be used -rk5 is only computed to estimate the precision of the current interpolation step.

Ability to specify output file name.

Currently, cTraceo's output file names depend on the output option specified, ie:

  • Ray coordinates: rco.mat
  • All Ray Information: `ari.mat
  • Eigenrays: eig.mat
  • Coherent Acoustic Pressure: cpr.mat
  • Particle Velocity: pvl.mat
  • Coherent Acoustic Pressure and Particle Velocity: pav.mat

Often it is useful to have the ability to specify one's own output file name - the command line option --outputFile <filename> should be implemented to allow specifying one.

Move opening of output file to cTraceo.c

currently there is a call of the type matfile = matOpen(settings->options.outputFileName, "u"); in every calculation function.
This is redundant code and sometimes results in a file being opened and closed several times.

This will require adding outputFileName to the settings.options structure.

create a python script to automate creation of new versions.

This script should:

  • ask user for short version string
  • ask user for long version string
  • check if no other version with same name exists
  • ask for confirmation
  • add contents of source/version to source/previousVersions.
  • write new version strings to source/version

Notes:

  • The source/previousVersions file should contain one version definition per line
  • change makefile so that all previous versions are included in the AUXFILES
    variable and thus included in the dist package.

Verify correct travel time interpolation at box exit in solveEikonalEq()

Emanuel, I noticed that there is a small bug in seikeq.for: ray coordinates are linearly interpolated at the box limits but travel times are not. Thus, travel time information is fine but at the last ray point. I guess that the C equivalent of seikeq.for has the same problem. This is hard to spot but generates wrong results when a timefront is to be calculated.

Cheers

Orlando

ray amplitude when computing arrivals by Regula False is NaN

This is due to the fact that whn computing eigenrays by RF, the last ray coordinate is exactly on the rBox limit. Thus certain gradients which are computed from the current+next ray coordinates can not be computed at the last coordinate.

Thanks to Ronan for reporting this.

Allow specifying output name for ssp as interpolated by the model.

Currently, the model takes the command line option '--ssp '.
This option will create a vector containing the sound speed profile as interpolated by the model, ie,
the ssp which is used internally by the model.

This array is saved as 'ssp.mat'.

let's implement a command line option --sspFileName to store this data in a differently named file.

Update the user manual to reflect changes incorporated since v1.0

This no longer has to be according to the siplab template.
Title should be "The cTraceo Acoustic Raytracing Model - User Manual"

@Manual{cTraceoManual,
 title        = "The cTraceo Acoustic Raytracing Model - User Manual",
 author       = "Emanuel Ey and Orlando C. Rodriguez",
 organization = "Signal Processing Laboratory, Universidade do Algarve",
 month        = "January",
 year         = "2012",
}

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.