Changeset 3080


Ignore:
Timestamp:
11/25/15 15:49:41 (9 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: No

Ready for Test: Yes

Interface Changes: Yes/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...


Bug fix on index range check. It seems that current code allows index 4. But I think valid index range should be 0 <= index <= 4.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STPolCircular.cpp

    r1259 r3080  
    4646    throw(AipsError("You must have 4 circular polarisations to run this function"));
    4747  }
    48   if ( index < 0 || index >4 ) throw(AipsError("LinPol index out of range"));
     48//  if ( index < 0 || index >4 ) throw(AipsError("LinPol index out of range"));
     49  if ( index >= 4 ) throw(AipsError("LinPol index out of range"));
    4950  Vector<Float> out,q,u;
    5051  if ( nspec() == 4) {
  • trunk/src/STPolLinear.cpp

    r2163 r3080  
    3030Vector<Float> asap::STPolLinear::getStokes( uint index )
    3131{
    32   if ( index > 4 ) throw(AipsError("Stokes index out of range"));
     32  if ( index >= 4 ) throw(AipsError("Stokes index out of range"));
    3333  Vector<Float> out;
    3434  Float phase = getTotalPhase();
     
    6161    throw(AipsError("You must have 4 linear polarizations to run this function"));
    6262  }
    63   if ( index >4 ) throw(AipsError("LinPol index out of range"));
     63  if ( index >= 4 ) throw(AipsError("LinPol index out of range"));
    6464  Vector<Float> out,q,u;
    6565  if ( nspec() == 4) {
  • trunk/src/STPolStokes.cpp

    r1007 r3080  
    3535Vector<Float> asap::STPolStokes::getLinPol( uInt index )
    3636{
    37   if ( index < 0 || index >4 ) throw(AipsError("LinPol index out of range"));
     37//  if ( index < 0 || index >4 ) throw(AipsError("LinPol index out of range"));
     38  if ( index >= 4 ) throw(AipsError("LinPol index out of range"));
    3839  Vector<Float> out;
    3940  if ( nspec() == 4) {
Note: See TracChangeset for help on using the changeset viewer.