Changeset 3079


Ignore:
Timestamp:
11/25/15 15:36:30 (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...


Make STMath warning free.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STMath.cpp

    r3010 r3079  
    1515#include <sstream>
    1616#include <iostream>
     17#include <limits.h>
    1718
    1819#include <casa/iomanip.h>
     
    20572058  for (uInt i=0; i < tab.nrow(); ++i ) {
    20582059    if (in->isAllChannelsFlagged(i)) {
    2059       out.push_back(NAN);
     2060      out.push_back(static_cast<int>(NAN));
    20602061    } else {
    20612062      Vector<Float> spec; specCol.get(i, spec);
     
    34273428      for ( uInt ifreq = 0 ; ifreq < freqid[itable].size() ; ifreq++ ) {
    34283429        double minf = iffreq[itable][2*ifreq] ;
    3429         uInt groupid ;
     3430        uInt groupid = UINT_MAX;
    34303431        for ( uInt igrp = 0 ; igrp < freqgrp.size() ; igrp++ ) {
    34313432          vector<uInt> memberlist = freqgrp[igrp] ;
     
    34343435            break ;
    34353436          }
     3437        }
     3438        if (groupid == UINT_MAX) {
     3439          LogIO os(LogOrigin("STMath", "new_average", WHERE));
     3440          os << LogIO::WARN << "frequency grouping may be failed. set to 0" << LogIO::POST;
     3441          groupid = 0;
    34363442        }
    34373443        groups[itable][ifreq] = groupid ;
     
    34943500
    34953501      // update MAIN
    3496       for ( uInt irow = 0 ; irow < newin[itable]->nrow() ; irow++ ) {
     3502      for ( Int irow = 0 ; irow < newin[itable]->nrow() ; irow++ ) {
    34973503        uInt groupid = groups[itable][oldFreqId[irow]] ;
    34983504        newFreqId[irow] = groupid ;
     
    39913997                              const vector< CountedPtr<Scantable> >& sky,
    39923998                              const vector< CountedPtr<Scantable> >& hot,
    3993                               const vector< CountedPtr<Scantable> >& cold,
     3999                              const vector< CountedPtr<Scantable> >& /*cold*/,
    39944000                              const Vector<uInt> &rows )
    39954001{
     
    40264032  Block<uInt> flagchan( spsize ) ;
    40274033  uInt nflag = 0 ;
    4028   for ( int irow = 0 ; irow < rows.nelements() ; irow++ ) {
     4034  for ( size_t irow = 0 ; irow < rows.nelements() ; irow++ ) {
    40294035    double reftime = timeCol.asdouble(*p) ;
    40304036    ids = getRowIdFromTime( reftime, timeSkyS ) ;
     
    40794085                          const CountedPtr<Scantable>& sky,
    40804086                          const CountedPtr<Scantable>& hot,
    4081                           const CountedPtr<Scantable>& cold,
     4087                          const CountedPtr<Scantable>& /*cold*/,
    40824088                          const Vector<uInt> &rows )
    40834089{
     
    41044110  Block<uInt> flagchan( spsize ) ;
    41054111  uInt nflag = 0 ;
    4106   for ( int irow = 0 ; irow < rows.nelements() ; irow++ ) {
     4112  for ( size_t irow = 0 ; irow < rows.nelements() ; irow++ ) {
    41074113    double reftime = timeCol.asdouble(*p) ;
    41084114    ids = getRowIdFromTime( reftime, timeSky ) ;
     
    42424248  delete timeCol ;
    42434249  Vector<Double> interval = s->integrCol_.getColumn() ;
    4244   uInt nrow = timeVec.nelements() ;
     4250  //uInt nrow = timeVec.nelements() ;
    42454251  uInt outrow = 0 ;
    42464252
Note: See TracChangeset for help on using the changeset viewer.