Ignore:
Timestamp:
03/08/05 15:27:49 (19 years ago)
Author:
mar637
Message:

Reworked stokestopolspectrum to have polIdx=-1 to enable polSel_.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDMemTable.cc

    r527 r539  
    440440}
    441441
    442 std::string SDMemTable::getPolarizationLabel (Bool linear, Bool stokes, Bool linPol, Int polIdx) const
     442std::string SDMemTable::getPolarizationLabel(Bool linear, Bool stokes,
     443                                              Bool linPol, Int polIdx) const
    443444{
    444445   uInt idx = polSel_;   
    445446   if (polIdx >=0) idx = polIdx;
    446 //
    447    return SDPolUtil::polarizationLabel (idx, linear, stokes, linPol);
    448 }
    449 
    450 
    451 
    452 std::vector<float> SDMemTable::stokesToPolSpectrum (Int whichRow, Bool toLinear, uInt polIdx) const
     447   return SDPolUtil::polarizationLabel(idx, linear, stokes, linPol);
     448}
     449
     450
     451
     452std::vector<float> SDMemTable::stokesToPolSpectrum(Int whichRow,
     453                                                   Bool toLinear,
     454                                                   Int polIdx) const
    453455//
    454456// polIdx
     
    481483     throw(AipsError("Conversion to linears not yet supported"));
    482484  } else {
    483      Bool doRR = (polIdx==0);
    484      if(polIdx>1) {
    485         throw(AipsError("Only conversion to RR & LL is currently supported"));
    486      }
    487 
    488 // Get I and V slices
    489 
    490      Array<Float> I = SDPolUtil::getStokesSlice(arr,start,end,"I");
    491      Array<Float> V = SDPolUtil::getStokesSlice(arr,start,end,"V");
    492 
    493 // Compute output
    494 
    495      out = SDPolUtil::circularPolarizationFromStokes(I, V, doRR);
    496    }
    497 
    498 // Copy to output
    499 
     485    uInt selection = polSel_;
     486    if (polIdx > -1) selection = polIdx;
     487    Bool doRR = (selection==0);
     488    if (selection>1) {
     489      throw(AipsError("Only conversion to RR & LL is currently supported"));
     490    }
     491   
     492    // Get I and V slices   
     493    Array<Float> I = SDPolUtil::getStokesSlice(arr,start,end,"I");
     494    Array<Float> V = SDPolUtil::getStokesSlice(arr,start,end,"V");
     495   
     496    // Compute output     
     497    out = SDPolUtil::circularPolarizationFromStokes(I, V, doRR);
     498  }
     499 
     500  // Copy to output
    500501   IPosition vecShape(1,shape(asap::ChanAxis));
    501502   Vector<Float> outV = out.reform(vecShape);
Note: See TracChangeset for help on using the changeset viewer.