Unverified Commit 0f626c6f authored by Sergio Poppi's avatar Sergio Poppi Committed by GitHub
Browse files

Solar system bodies tracking (#912)



* First skeleton issue #002

* SolarSystemBody.midl interface and makefile patched

* Xephem Astro lib added to Common Libraries

* Patched Makefile XEphem libastro

* Xephem libastro wrapper to solarsystem comp

* Patched makefile in astrolib

* inclded dynamic comp in cdb

* added build.log to gitignore

* Git ignored solarsystem body

* Xephemlib added to System Make

* Modified xephemAstrilib wrappe.
implemented SolarSystemBodyImpl::execute.

* Site implementation

* Removed handy shortcuts from astro.h in astrolib

* Refactored libastrowrapper to opimize handling  solar system body names with static methods.

* Unresolved symbols due to missing linking objects in SolarSystem makefile

* Implemented Method body position

* getAttribute method implemented.

* Implemented getCoordinates and getAllCoordinates

* patch to allow test component with python

* test_solarsystembody.py

 added az el calculation

* Testing output Solar System Body output

* patched libastrowrapper. Added getJ2000EquatorialMethod.

* unittest setup

* patched test planet jupiter

* SolarSystemBody comp. test apparant equatorial and horizontal

* SolarSystemBody:added test for setting offsets.

* Add to git new tests

* test on Sun and offsets

* test Sun added

* Implemented distance

* Test jupiter distance

* Patched getAttributes

* Implemented SUN in Antenna boss component

* Sun tracking:implemented in scheduler

* SolarSystem module added to SystemMake

* Error handling if a wrong planet is chosen

* Included functinality for planet tracking. Typos patched.

* Bug fixed Mercury planet code. Planet not found i NOBJ code

* Wrong planet name gives correct exception

* planet tracking with schedule, first draft

* Patched schedule subscan to allow planet tracking in schedule file

* Otimized logging of the SolarSystemBody component

* Generator showed in antennaBoss TUI

* typos fixes

* patche logs

---------

Co-authored-by: default avatarGiuseppe Carboni <giuseppecarboni89@live.com>
parent 32ce82f2
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -6,11 +6,13 @@ object/
*~
*~
*.swp
*.swp
*.pyc
*.pyc
.project*


# Ignore the SliLibrary directory
# Ignore the SliLibrary directory
Common/Libraries/SlaLibrary
Common/Libraries/SlaLibrary


# Files generated by the building process
# Files generated by the building process
Common/Interfaces/build.log
Common/Clients/CaltoolClient/src/calibrationtool_ui.py
Common/Clients/CaltoolClient/src/calibrationtool_ui.py
Common/Clients/CaltoolClient/src/calibrationtool_ui.pye
Common/Clients/CaltoolClient/src/calibrationtool_ui.pye
Common/Errors/AntennaErrors/idl/AntennaErrors.idl
Common/Errors/AntennaErrors/idl/AntennaErrors.idl
@@ -26,12 +28,16 @@ Common/Errors/ParserErrors/idl/ParserErrors.idl
Common/Errors/ReceiversErrors/idl/DerotatorErrors.idl
Common/Errors/ReceiversErrors/idl/DerotatorErrors.idl
Common/Errors/ReceiversErrors/idl/ReceiversErrors.idl
Common/Errors/ReceiversErrors/idl/ReceiversErrors.idl
Common/Errors/XBackendErrors/idl/XBackendsErrors.idl
Common/Errors/XBackendErrors/idl/XBackendsErrors.idl
Common/Errors/ActiveSurfaceErrors/idl/ASErrors.idl
Common/Interfaces/ActiveSurfaceInterface/idl/ActiveSurfaceCommon.idl
Common/Interfaces/AntennaInterface/idl/SolarSystemBody.idl
Common/Interfaces/AntennaInterface/idl/AntennaBoss.idl
Common/Interfaces/AntennaInterface/idl/AntennaBoss.idl
Common/Interfaces/AntennaInterface/idl/Moon.idl
Common/Interfaces/AntennaInterface/idl/Moon.idl
Common/Interfaces/AntennaInterface/idl/Mount.idl
Common/Interfaces/AntennaInterface/idl/Mount.idl
Common/Interfaces/AntennaInterface/idl/OTF.idl
Common/Interfaces/AntennaInterface/idl/OTF.idl
Common/Interfaces/AntennaInterface/idl/Observatory.idl
Common/Interfaces/AntennaInterface/idl/Observatory.idl
Common/Interfaces/AntennaInterface/idl/SkySource.idl
Common/Interfaces/AntennaInterface/idl/SkySource.idl
Common/Interfaces/AntennaInterface/idl/SolarSystemBody.idl
Common/Interfaces/ActiveSurfaceInterface/idl/ActiveSurfaceCommon.idl
Common/Interfaces/ActiveSurfaceInterface/idl/ActiveSurfaceCommon.idl
Common/Interfaces/CommonInterface/idl/AntennaDefinitions.idl
Common/Interfaces/CommonInterface/idl/AntennaDefinitions.idl
Common/Interfaces/CommonInterface/idl/BackendsDefinitions.idl
Common/Interfaces/CommonInterface/idl/BackendsDefinitions.idl
@@ -50,4 +56,7 @@ SRT/Clients/SRTActiveSurfaceGUIClient/include/SRTActiveSurfaceGUI.h
SRT/Clients/SRTActiveSurfaceGUIClient/src/moc_SRTActiveSurfaceCore.cpp
SRT/Clients/SRTActiveSurfaceGUIClient/src/moc_SRTActiveSurfaceCore.cpp
SRT/Clients/SRTActiveSurfaceGUIClient/src/moc_SRTActiveSurfaceGUIui.cpp
SRT/Clients/SRTActiveSurfaceGUIClient/src/moc_SRTActiveSurfaceGUIui.cpp
SRT/Interfaces/SRTActiveSurfaceInterface/idl/SRTActiveSurfaceBoss.idl
SRT/Interfaces/SRTActiveSurfaceInterface/idl/SRTActiveSurfaceBoss.idl
Common/Libraries/build.log
SRT/Interfaces/SRTActiveSurfaceInterface/idl/SRTActiveSurfaceCommon.idl
.DS_Store
.vscode/settings.json
.vscode/settings.json
+44 −1
Original line number Original line Diff line number Diff line
@@ -162,6 +162,49 @@ void updateGenerator(maci::SimpleClient& client,Antenna::TGeneratorType& lastGen
				extraLabel6->Refresh();	
				extraLabel6->Refresh();	
				break;
				break;
			}
			}
			case Antenna::ANT_SOLARSYSTEMBODY : {
				IRA::CString str1,str2;
 
				Antenna::SolarSystemBodyAttributes_var att;
				Antenna::SolarSystemBody_var ssbody;
				try {
					ssbody=Antenna::SolarSystemBody::_narrow(lastGenerator);
					if (!CORBA::is_nil(ssbody)) {
						ssbody->getAttributes(att);
					}
				}
				catch (...) {
					_EXCPT(ClientErrors::UnknownExImpl,impl,"::Main()");
					_IRA_LOGGUARD_LOG_EXCEPTION(guard,impl,LM_ERROR);
					return;
				}			
				tmpString=(const char*)att->sourceID;
				outString="Source name    : "+tmpString;
				extraLabel1->setValue(outString);
				extraLabel1->Refresh();
				IRA::CIRATools::radToHourAngle(att->rightAscension,str1);
				IRA::CIRATools::radToSexagesimalAngle(att->declination,str2);
				outString="Apparent Eq.   : "+str1+"/"+str2+"/";
				str1.Format("%.5lf",att->julianEpoch);
				outString+=str1;
				extraLabel2->setValue(outString);
				extraLabel2->Refresh();
				IRA::CIRATools::radToAngle(att->gLongitude,str1);
				IRA::CIRATools::radToAngle(att->gLatitude,str2);
				outString="Galactic       : "+str1+"/"+str2;
				extraLabel3->setValue(outString);
				extraLabel4->Refresh();
				IRA::CIRATools::radToAngle(att->azimuth,str1);
				IRA::CIRATools::radToAngle(att->elevation,str2);
				outString="Horizontal     : "+str1+"/"+str2;
				extraLabel4->setValue(outString);
				extraLabel4->Refresh();								
				extraLabel5->setValue("");
				extraLabel5->Refresh();			
				extraLabel6->setValue("");
				extraLabel6->Refresh();	
				break;
			}
			case Antenna::ANT_OTF: {
			case Antenna::ANT_OTF: {
				Antenna::OTFAttributes_var att;
				Antenna::OTFAttributes_var att;
				Antenna::OTF_var otf;
				Antenna::OTF_var otf;
+4 −1
Original line number Original line Diff line number Diff line
@@ -6,6 +6,7 @@
#include <SkySourceC.h>
#include <SkySourceC.h>
#include <OTFC.h>
#include <OTFC.h>
#include <MoonC.h>
#include <MoonC.h>
#include <SolarSystemBodyC.h>
#include <ManagementErrors.h>
#include <ManagementErrors.h>
#include <acsncSimpleConsumer.h>
#include <acsncSimpleConsumer.h>
#include <fstream>
#include <fstream>
@@ -396,7 +397,7 @@ int main(int argc, char *argv[]) {
		generatorType_box->setStatusLook(Antenna::ANT_SIDEREAL);
		generatorType_box->setStatusLook(Antenna::ANT_SIDEREAL);
		generatorType_box->setStatusLook(Antenna::ANT_MOON); 
		generatorType_box->setStatusLook(Antenna::ANT_MOON); 
		generatorType_box->setStatusLook(Antenna::ANT_SUN); 
		generatorType_box->setStatusLook(Antenna::ANT_SUN); 
		generatorType_box->setStatusLook(Antenna::ANT_SOLARSYTEMBODY); 
		generatorType_box->setStatusLook(Antenna::ANT_SOLARSYSTEMBODY); 
		generatorType_box->setStatusLook(Antenna::ANT_SATELLITE); 
		generatorType_box->setStatusLook(Antenna::ANT_SATELLITE); 
		generatorType_box->setStatusLook(Antenna::ANT_OTF); 
		generatorType_box->setStatusLook(Antenna::ANT_OTF); 
		
		
@@ -434,6 +435,8 @@ int main(int argc, char *argv[]) {
			_TW_SET_COMPONENT(output_label,0,WINDOW_HEIGHT-(OUTPUT_FIELD_HEIGHT+1),WINDOW_WIDTH-1,OUTPUT_FIELD_HEIGHT,OUTPUT_FIELD_COLOR_PAIR,OUTPUT_FIELD_STYLE,NULL);	
			_TW_SET_COMPONENT(output_label,0,WINDOW_HEIGHT-(OUTPUT_FIELD_HEIGHT+1),WINDOW_WIDTH-1,OUTPUT_FIELD_HEIGHT,OUTPUT_FIELD_COLOR_PAIR,OUTPUT_FIELD_STYLE,NULL);	
		#endif 
		#endif 
		
		
		
		
		// Monitors
		// Monitors
		ACS_LOG(LM_FULL_INFO,MODULE_NAME"::Main()",(LM_INFO,MODULE_NAME"::MONITORS_INSTALLATION"));
		ACS_LOG(LM_FULL_INFO,MODULE_NAME"::Main()",(LM_INFO,MODULE_NAME"::MONITORS_INSTALLATION"));
		/** Add all required monitor installation here */
		/** Add all required monitor installation here */
+1 −1
Original line number Original line Diff line number Diff line
@@ -66,7 +66,7 @@ EXECUTABLES_L =
_tui_AntennaBossTextClient_OBJECTS   =   AntennaBossTextClient
_tui_AntennaBossTextClient_OBJECTS   =   AntennaBossTextClient
_tui_AntennaBossTextClient_LIBS = AntennaBossStubs IRALibrary \
_tui_AntennaBossTextClient_LIBS = AntennaBossStubs IRALibrary \
  ManagmentDefinitionsStubs TextWindowLibrary ClientErrors ComponentErrors ManagementErrors \
  ManagmentDefinitionsStubs TextWindowLibrary ClientErrors ComponentErrors ManagementErrors \
  AntennaErrors AntennaDefinitionsStubs EphemGeneratorStubs SkySourceStubs OTFStubs MoonStubs acsnc
  AntennaErrors AntennaDefinitionsStubs EphemGeneratorStubs SkySourceStubs OTFStubs MoonStubs SolarSystemBodyStubs acsnc




SCRIPTS         = antennaBossTui
SCRIPTS         = antennaBossTui
+93 −0
Original line number Original line Diff line number Diff line
/* ************************************************************************************/
/* INAF  DISCOS
/*                                                    */
/* $Id: SolarSystemBody.midl,v 1.3 2010-09-24 15:42:03 a.orlati Exp $                                                                             */
/*                                                                                    */
/* This code is under GNU General Public Licence (GPL)                                */
/*																					                      */
/* Who                                  when            What                          */
/* S.Poppi, S.Righini							09/May/2017         created                       */

#ifndef _SSB_IDL
#define _SSB_IDL

#include "baci.idl"
#include <enumpropMACRO.idl>
#include <EphemGenerator.idl>

#pragma prefix "alma"
                                                                            
module Antenna {
 /*	
 * Here we have defined a struct "SolarSystemBody structure" that contains all the properties of the component. 
 * Since EphemGenerator defines all the properties of the component and we have inherited the SolarSystemBody  component from EphemGenerator.
 * This Interface will be mapped into the ACS dynamic component so it can't expose properties in their classic definations.
 * Component attributes are read via their accesor method (<i>getAttributes()</i>).   * 
*/	
	DEFATTRIBUTES (SolarSystemBodyAttributes)
           double angularSize; /** apparent angular diameter of the body degrees**/
           double distance; /**body distance AU **/
           double radialVelocity; /**body radial velocity km/s**/
           Antenna::TReferenceFrame vradFrame; /** reference frame of the radial velocity */
           Antenna::TVradDefinition vradDefinition; /** definition of the radial velocity */

	ENDDEFATTRIBUTES;
	
	
	interface SolarSystemBody: EphemGenerator { 
		/*This is the Interface of the component Moon and this is inherited from EphemGenerator
		 * all the properties metioned below are inherited by the interface SolarSystemBody 
		 * # input Source ID:SolarSystemBody, the name of the source
		 * # double right Ascension of the body in radians
		 * # double decination of the body in radians
		 * # double azimuth in radians 
		 * # double elevation in radians
		 * # Julian Epoch the current time as a julian epoch
		 * # double userAzimuthOffset in radians	 
	 	 * # double userElevationOffset in radians
	 	 * # double userRightAscensionOffset in radians
	 	 * # double userDeclinationOffset in radians
		 * # double parallacticAngle in radians
		 */
		void getAttributes(out SolarSystemBodyAttributes att); /*this method is the attribute accessor*/

      	/**
		 * This method is only for control software internal use. It used, given a timestamp, to retrive the apparent
		 * J2000 Equatorial coordiantes coordinates in one shot.
		 * @throw CORBA::SystemException
		 * @param timestamp this parameter is used to pass the exact time the caller wants to know the topocentric coordinates.
		 * @param ra that's the returned value in radians of the right ascension for the requested time.
		 * @param re that's the returned value in radians of the declination for the requested time.
		*/
		void getJ2000EquatorialCoordinate(in ACS::Time timestamp, out double ra,out double dec);
			   
	        
                /**
                      @param bodyName of the target
                     
                */
       
                void setBodyName(in string bodyName)  raises (AntennaErrors::AntennaErrorsEx);

            /**
		 * This method is only for control software internal use. It used, given a timestamp, to retrive the distance of the body
		 * @param timestamp this parameter is used to pass the exact time the caller wants to know the topocentric coordinates.
		 * @param distance  body distance in AU.

		      * J2000 Equatorial coordiantes coordinates in one shot.

                */
                void getDistance(in ACS::Time timestamp, out double distance);
                
                
	};

};
	
	




#endif
Loading