Changeset 2235


Ignore:
Timestamp:
07/19/11 12:52:35 (13 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: Yes CAS-1913

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 a way to search appropriate weather information based on time.
Also, pressure should be diveded by 100.0 since ASDM stores pressure
in Pa while MS stores pressure in hPa.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/external-alma/asdm2ASAP/ASDMReader.cc

    r2229 r2235  
    12401240                                 float &windaz )
    12411241{
     1242  casa::String funcName = "getWeatherInfo" ;
     1243
    12421244  temperature = 0.0 ;
    12431245  pressure = 0.0 ;
     
    12641266  unsigned int nrow = wrows->size() ;
    12651267  //logsink_->postLocally( LogMessage("There are "+String::toString(nrow)+" rows for given context: stationId "+String::toString(weatherStationId_),LogOrigin(className_,funcName,WHERE)) ) ;
    1266   ArrayTime startTime = tint.getStart() ;
     1268  ArrayTime startTime = getMidTime( tint ) ;
    12671269  if ( startTime < (*wrows)[0]->getTimeInterval().getStart() ) {
    12681270    temperature = (*wrows)[0]->getTemperature().get() ;
    1269     pressure = (*wrows)[0]->getPressure().get() ;
     1271    pressure = (*wrows)[0]->getPressure().get() ; 
    12701272    humidity = (*wrows)[0]->getRelHumidity().get() ;
    12711273    windspeed = (*wrows)[0]->getWindSpeed().get() ;
    12721274    windaz = (*wrows)[0]->getWindDirection().get() ;
    12731275  }
    1274   else if ( startTime > (*wrows)[nrow-1]->getTimeInterval().getStart() ) {
     1276  else if ( startTime > getEndTime( (*wrows)[nrow-1]->getTimeInterval() ) ) {
    12751277    temperature = (*wrows)[nrow-1]->getTemperature().get() ;
    12761278    pressure = (*wrows)[nrow-1]->getPressure().get() ;
     
    12821284    for ( unsigned int irow = 1 ; irow < wrows->size() ; irow++ ) {
    12831285      wrow = (*wrows)[irow-1] ;
    1284       if ( startTime < (*wrows)[irow]->getTimeInterval().getStart() ) {
     1286      ArrayTime tStart = wrow->getTimeInterval().getStart() ;
     1287      ArrayTime tEnd = (*wrows)[irow]->getTimeInterval().getStart() ;
     1288      if ( startTime >= tStart && startTime <= tEnd ) {
    12851289        temperature = wrow->getTemperature().get() ;
    12861290        pressure = wrow->getPressure().get() ;
     
    12921296    }
    12931297  }
     1298
     1299  // Pa -> hPa
     1300  pressure /= 100.0 ;
    12941301
    12951302  return ;
Note: See TracChangeset for help on using the changeset viewer.