Ignore:
Timestamp:
01/11/13 18:48:37 (11 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: Yes CAS-4770, CAS-4774

Ready for Test: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No?

Module(s): Module Names change impacts.

Description: Describe your changes here...

Updated STApplyCal to be able to specify interpolation method.
The method can be specified in time and frequency axes independently.
Possible options are nearest, linear (default), (natural) cubic spline,
and polynomial with arbitrary order.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/BisectionLocator.cpp

    r2720 r2727  
    1212#include <assert.h>
    1313
    14 #include <casa/Arrays/Vector.h>
    15 #include <casa/Arrays/ArrayIO.h>
    16 #include <casa/Exceptions/Error.h>
    17 
    1814#include "BisectionLocator.h"
    19 
    20 using namespace casa;
    2115
    2216namespace asap {
     
    3933    else if (x > x_[n_-1])
    4034      return n_;
     35
     36    unsigned int jl = 0;
     37    unsigned int ju = n_;
     38    unsigned int jm;
     39    while (ju - jl > 1) {
     40      jm = (ju + jl) >> 1;
     41      if (x > x_[jm])
     42        jl = jm;
     43      else
     44        ju = jm;
     45    }
     46    return ju;
    4147  }
    4248  else {
    43     if (x > x_[0])
     49    if (x >= x_[0])
    4450      return 0;
    45     else if (x <= x_[n_-1])
     51    else if (x < x_[n_-1])
    4652      return n_;
     53
     54    unsigned int jl = 0;
     55    unsigned int ju = n_;
     56    unsigned int jm;
     57    while (ju - jl > 1) {
     58      jm = (ju + jl) >> 1;
     59      if (x < x_[jm])
     60        jl = jm;
     61      else
     62        ju = jm;
     63    }
     64    return ju;
    4765  }
    48   unsigned int jl = 0;
    49   unsigned int ju = n_;
    50   unsigned int jm;
    51 
    52   while (ju - jl > 1) {
    53     jm = (ju + jl) >> 1;
    54     if ((x >= x_[jm]) == ascending)
    55       jl = jm;
    56     else
    57       ju = jm;
    58   }
    59   return ju;
    6066}
    6167
Note: See TracChangeset for help on using the changeset viewer.