/* * Format the coordinates in the given buffers: * * If hmsFlag is non-zero, in H:M:S [+-]D:M:S format, otherwise in decimal * degrees. */ void GaiaWorldCoords::format( char* ra_buf, char* dec_buf, double equinox, int hmsFlag ) { if ( equinox == 2000.0 ) { if ( hmsFlag ) { ra_.print( ra_buf ); dec_.print( dec_buf ); } else { sprintf( ra_buf, "%.17g", ra_deg() ); sprintf( dec_buf, "%.17g", dec_deg() ); } } else { // make tmp copy and convert equinox before printing GaiaWorldCoords tmp = *this; tmp.convertEquinox( 2000.0, equinox ); if ( hmsFlag ) { tmp.ra_.print( ra_buf ); tmp.dec_.print( dec_buf ); } else { sprintf( ra_buf, "%.17g", tmp.ra_deg() ); sprintf( dec_buf, "%.17g", tmp.dec_deg() ); } } }
/***********************************************************************//** * @brief Print instrument direction information ***************************************************************************/ std::string GCTAInstDir::print(void) const { // Initialise result string std::string result; // Append instrument direction result.append("RA="+str(ra_deg())+", DEC="+str(dec_deg())); // Return result return result; }
/* * get ra and dec in degrees in the given equinox */ void WorldCoords::get(double& ra, double& dec, double equinox) { if (equinox == 2000.0) { ra = ra_deg(); dec = dec_deg(); } else { // make tmp copy and convert equinox WorldCoords tmp = *this; tmp.convertEquinox(2000.0, equinox); ra = tmp.ra_deg(); dec = tmp.dec_deg(); } }