Commit 202f873a authored by Giuseppe Carboni's avatar Giuseppe Carboni Committed by GitHub
Browse files

fix issue #454: now timestamps perfeclty agree to all metadata, pointing to...

fix issue #454: now timestamps perfeclty agree to all metadata, pointing to the middle of the sample. (#458)
parent b970f347
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -59,6 +59,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/
## [discosX.X.x]
### Added
### Changed
### Added
	  issue #454 - Timestamp of the Fits now is reffered to the middle of the sample accordingly to all others metadata
### Fixed
     issue #452 - The Total Power component erronously assigned a timestamp to the samples in case more samples were needed to reach total integration time
+3 −3
Original line number Diff line number Diff line
@@ -612,7 +612,7 @@ module Antenna {
		 * In case duration is greter than the configured coordinate integration time, the returned coordinates are the result of the average over the duration interval that starts
		 * from <i>timestamp</i>.
		 * @throw CORBA::SystemExcpetion
		 * @param timestamp the input timestamp
		 * @param timestamp the input timestamp (best practice is to use the middle of your reference time)
		 * @param duration duration of the integration, if greater than coordinate integration time the returned values are not instantaneous but are averaged 
		 *        over the provided interval.
		 * @param ra the returned observed right ascension in radians 
@@ -625,7 +625,7 @@ module Antenna {
		 * referes to must be provided. It is highly probable that these cordinates are not "real" (directly read from the antenna) but they are the result of 
		 * an interpolation. They are obtained by converting the corresponding J2000 observed equatorial coordinates.
		 * @throw CORBA::SystemExcpetion
		 * @param timestamp the input timestamp
		 * @param timestamp the input timestamp (best practice is to use the middle of your reference time)
		 * @param duration duration of the integration, if greater than coordinate integration time the returned values are not instantaneous but are averaged 
		 *        over the provided interval.
		 * @param ra the returned observed galactic longitude in radians 
@@ -638,7 +638,7 @@ module Antenna {
		 * referes to must be provided. It is highly probable that these cordinates are not "real" (directly read from the antenna) but they are the result of 
		 * an interpolation. They are obtained by the encoders coordinates depurated by instrumental effects..
		 * @throw CORBA::SystemExcpetion
		 * @param timestamp the input timestamp
		 * @param timestamp the input timestamp (best practice is to use the middle of your reference time)
		 * @param duration duration of the integration, if greater than coordinate integration time the returned values are not instantaneous but are averaged 
		 *        over the provided interval. 
		 * @param ra the returned observed azimuth in radians 
+16 −18
Original line number Diff line number Diff line
@@ -230,35 +230,32 @@ void CBossCore::getObservedHorizontal(TIMEVALUE& time,TIMEDIFFERENCE& duration,d
	if (duration.value().value>m_config->getCoordinateIntegrationPeriod()) {
		double ra,dec;
		IRA::CSkySource converter;
		TIMEVALUE stopTime(time.value());
		TIMEVALUE midTime(time.value().value+duration.value().value/2);
		stopTime+=duration.value();
		m_integratedObservedEquatorial.averagePoint(time,stopTime,ra,dec);
		TIMEVALUE startTime(time.value().value-duration.value().value/2);
		TIMEVALUE stopTime(time.value().value+duration.value().value/2);
		TIMEVALUE midTime(time.value().value);
		m_integratedObservedEquatorial.averagePoint(startTime,stopTime,ra,dec);
		converter.setInputEquatorial(ra,dec,IRA::CSkySource::SS_J2000);
		IRA::CDateTime dateTime(midTime,m_dut1);
		converter.process(dateTime,m_site);
		converter.getApparentHorizontal(az,el);
	}
	else {
		TIMEVALUE midTime(time.value().value+duration.value().value/2);
		//the integration time is not added anymore since we suppose the correct time is requested from caller
		TIMEVALUE midTime(time.value().value/*+duration.value().value/2*/);
		m_observedHorizontals.selectPoint(midTime,az,el);
	}
}

void CBossCore::getObservedEquatorial(TIMEVALUE& time,TIMEDIFFERENCE& duration,double&ra,double& dec) const
{
	//printf("duration, integration %llu, %lu\n",duration.value().value,m_config->getCoordinateIntegrationPeriod());
	if (duration.value().value>m_config->getCoordinateIntegrationPeriod()) {
		//printf("Long integration\n");
		TIMEVALUE stopTime(time.value());
		stopTime+=duration.value();
		//printf("time %llu, stop %llu\n",time.value().value,stopTime.value().value);
		m_integratedObservedEquatorial.averagePoint(time,stopTime,ra,dec);
		//printf("ra %lf, dec %lf\n",ra,dec);
		TIMEVALUE startTime(time.value().value-duration.value().value/2);
		TIMEVALUE stopTime(time.value().value+duration.value().value/2);
		m_integratedObservedEquatorial.averagePoint(startTime,stopTime,ra,dec);
	}
	else {
		//printf("Short integration\n");
		TIMEVALUE midTime(time.value().value+duration.value().value/2);
		//the integration time is not added anymore since we suppose the correct time is requested from caller
		TIMEVALUE midTime(time.value().value/*+duration.value().value/2*/);
		m_observedEquatorials.selectPoint(midTime,ra,dec);
	}
}
@@ -268,13 +265,14 @@ void CBossCore::getObservedGalactic(TIMEVALUE& time,TIMEDIFFERENCE& duration,dou
	if (duration.value().value>m_config->getCoordinateIntegrationPeriod()) {
		double ra,dec;
		IRA::CSkySource converter;
		TIMEVALUE stopTime(time.value());
		stopTime+=duration.value();
		m_integratedObservedEquatorial.averagePoint(time,stopTime,ra,dec);
		TIMEVALUE startTime(time.value().value-duration.value().value/2);
		TIMEVALUE stopTime(time.value().value+duration.value().value/2);
		m_integratedObservedEquatorial.averagePoint(startTime,stopTime,ra,dec);
		IRA::CSkySource::equatorialToGalactic(ra,dec,lng,lat);
	}
	else {
		TIMEVALUE midTime(time.value().value+duration.value().value/2);
		//the integration time is not added anymore since we suppose the correct time is requested from caller
		TIMEVALUE midTime(time.value().value/*+duration.value().value/2*/);
		m_observedGalactics.selectPoint(midTime,lng,lat);
	}
}
+2 −2
Original line number Diff line number Diff line
@@ -22,8 +22,8 @@
#include "DevIOSourceFlux.h"


static char *rcsId="@(#) $Id: CalibrationToolImpl.cpp,v 1.5 2011-03-11 12:27:21 c.migoni Exp $";
static void *use_rcsId = ((void)&use_rcsId,(void *) &rcsId);
//static char *rcsId="@(#) $Id: CalibrationToolImpl.cpp,v 1.5 2011-03-11 12:27:21 c.migoni Exp $";
//static void *use_rcsId = ((void)&use_rcsId,(void *) &rcsId);

#define WORKTHREADNAME "CALIBRATIONTOOLENGINE"
#define COLLECTORTHREADNAME "COLLECTORTHREAD"
+4 −1
Original line number Diff line number Diff line
@@ -172,6 +172,9 @@ bool CEngineThread::processData ()

    // get tsys from devices
    if (!m_data->getDump (time, calOn, bufferCopy, buffer, tracking, buffSize)) return false;
	 //The timestamp must be referred to the mid time of the sample. Since time is the beginning 
	 //(see idl documentation of generic backed), I need to add half integration time.
	 time+=(ACS::Time)(m_data->getIntegrationTime()*10000*0.5);    
    tS.value (time);
    CalibrationTool_private::getTsysFromBuffer (buffer, m_data->getInputsNumber (), m_ptsys);

Loading