Commit 7088f22e authored by Andrea Orlat's avatar Andrea Orlat
Browse files

added the method to compute the topocentric frequency in AntennaBoss

parent 2d98c358
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -531,12 +531,24 @@ module Antenna {
		 */
		void radialVelocity(in double rval, in TReferenceFrame vref, in TVradDefinition vdef);
		
		/**
		 * This call will computes the topocentric velocity of the current source with respect to the observer. The source radial velocity,
		 * frame and definition must be known (@sa <i>radialVelocity()</i>). The computation is executed for each of the input rest frequencies.
		 * @param restFreq reference frequency (MHz)
		 * @param topo topocentric velocities (km/sec) corresponding to the input frequency
		 * @throw CORBA::SystemException
		 * @throw AntennaErrors::AntennaErrorsEx
		 * @throw ComponentErrors::ComponentErrorsEx
		 */
		void getTopocentricFrequency(in ACS::doubleSeq restFreq,out ACS::doubleSeq topo) raises (ComponentErrors::ComponentErrorsEx,
				AntennaErrors::AntennaErrorsEx);

		/**
		 * copybrief Management::CommandInterpreter::command
		 * This is the command line interpreter for the sub-system. All the attributes and all the methods exposed by the boss can be
		 * called. That means a full set of operation for standard observation, but not full control of the system.
		 * @param the string that contains the command line to be parsed
		 * @return the string that contains the answer to the command issued by the input parameter. The caller is resposible to
		 * @return the string that contains the answer to the command issued by the input parameter. The caller is responsible to
		 * free the returned string (@sa CORBA::string_free).
		*/
		
+12 −0
Original line number Diff line number Diff line
@@ -411,6 +411,18 @@ public:
	 */
	void radialVelocity(CORBA::Double vrad, Antenna::TReferenceFrame vref, Antenna::TVradDefinition vdef ) throw (CORBA::SystemException);
	
	/**
	 * This call will computes the topocentric velocity of the current source with respect to the observer.
	 * The computation is executed for each of the input rest frequencies.
	 * @param restFreq reference frequency (MHz)
	 * @param topo topocentric velocities (km/sec) corresponding to the input frequency
	 * @throw CORBA::SystemException
	 * @throw AntennaErrors::AntennaErrorsEx
	 * @throw ComponentErrors::ComponentErrorsEx
	 */
	void getTopocentricFrequency(const ACS::doubleSeq & restFreq,ACS::doubleSeq_out topo) throw (CORBA::SystemException,
    		AntennaErrors::AntennaErrorsEx,ComponentErrors::ComponentErrorsEx);

	/**
	 *  This method starts a new scan that could be any of the possible antenna movement.  It loads an ammount of coordinates into the mount and then it starts the thread that is 
	 * in charge to keep the  tracking trajectory up to date. This method succeeds only if the mount has already 
+9 −0
Original line number Diff line number Diff line
@@ -236,6 +236,15 @@ public:
	*/
	void radialVelocity(const double& val,const Antenna::TReferenceFrame& vframe, const Antenna::TVradDefinition& vdef);
	
	/**
	 * Computes the topocentric frequencies corresponding to any given rest frequencies. The computation involves the site, the
	 * currently targeted source. The computetion is done for the present time.
	 * @param rest list of the rest frequencies (MHz)
	 * @param topo corresponding topocentric frequencies (MHz)
	 * @throw AntennaErrors::OperationNotPermittedExImpl
	 */
	void getTopocentricFrequency(const ACS::doubleSeq& rest,ACS::doubleSeq& topo) throw (AntennaErrors::OperationNotPermittedExImpl);

	/**
	 * It does an iterative computation of the fluxes corresponding to the given frequencies. The FWHM is required to be set otherwise 1.0 is returned.
	 * @param freqs list of frequencies at which make the computation (MHz)
+9 −0
Original line number Diff line number Diff line
@@ -385,6 +385,15 @@ void AntennaBossImpl::radialVelocity(CORBA::Double vrad, Antenna::TReferenceFram
	resource->radialVelocity(vrad,vref,vdef);
}

void AntennaBossImpl::getTopocentricFrequency(const ACS::doubleSeq & restFreq,ACS::doubleSeq_out topo) throw (CORBA::SystemException,
		AntennaErrors::AntennaErrorsEx,ComponentErrors::ComponentErrorsEx)
{
	CSecAreaResourceWrapper<CBossCore> resource=m_core->Get();
	ACS::doubleSeq_var cent=new ACS::doubleSeq;
	resource->getTopocentricFrequency(restFreq,cent);
	topo=cent._retn();
}

void AntennaBossImpl::enable() throw (CORBA::SystemException)
{
	AUTO_TRACE("AntennaBossImpl::enable()");
+27 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@
#include <SkySource.h>
#include <LogFilter.h>
#include <Definitions.h>
#include <FrequencyTracking.h>
#include <math.h>

#define MAXDATAPOINTS 4000
@@ -574,6 +575,32 @@ void CBossCore::radialVelocity(const double& val,const Antenna::TReferenceFrame&
	}
}

void CBossCore::getTopocentricFrequency(const ACS::doubleSeq& rest,ACS::doubleSeq& topo) throw (AntennaErrors::OperationNotPermittedExImpl)
{
	if (rest.length()==0) {
		topo.length(0);
		return;
	}
	if (m_vradReferenceFrame==Antenna::ANT_UNDEF_FRAME) {
		_EXCPT(AntennaErrors::OperationNotPermittedExImpl,impl,"BossCore::getTopocentricFrequency");
		impl.setReason("Reference frame not defined");
		throw impl;
	}
	if (m_vradDefinition==Antenna::ANT_UNDEF_DEF) {
		_EXCPT(AntennaErrors::OperationNotPermittedExImpl,impl,"BossCore::getTopocentricFrequency");
		impl.setReason("velocity definition is not known");
		throw impl;
	}
	topo.length(rest.length());
	TIMEVALUE now;
	IRA::CIRATools::getTime(now);
	for (unsigned i=0;i<rest.length();i++) {
		IRA::CFrequencyTracking track(m_site,m_targetRA,m_targetDec,mapReferenceFrame(m_vradReferenceFrame),
				mapVelocityDefinition(m_vradDefinition),rest[i],m_targetVrad);
		topo[i]=track.getTopocentricFrequency(now.value().value);
	}
}

void CBossCore::setOffsets(const double& lonOff,const double& latOff,const Antenna::TCoordinateFrame& frame) throw(ComponentErrors::UnexpectedExImpl,ComponentErrors::CORBAProblemExImpl,ComponentErrors::OperationErrorExImpl)
{
	if ((!CORBA::is_nil(m_generator)) && (m_generatorType!=Antenna::ANT_NONE)) {
Loading