Search notes:

Stellarium API: getObjectPosition

//  vim: ft=javascript
//
//  ..\runScript.bat getObjectPosition.ssc
//  


// Go to Irchelturm
core.setObserverLocation(
   8 + 36/60 + 25.85/60/60, // core.dmsToRad( 8, 36, 25.85 ), // longitude
  47 + 32/60 + 21.48/60/60, // core.dmsToRad(47, 32, 21.48 ), // latitude
   0                                                          // Altitude
);


core.setDeltaTAlgorithm("WithoutCorrection");

core.setDate(
  '2014-01-04T05:15:00',
  'local'              , // or 'utc'
   true                  // enable Delta T correction
);

core.wait(0.01);
// GridLinesMgr.setFlagAzimuthalGrid(true);
GridLinesMgr.setFlagEquatorGrid(true);

var pos = core.getObjectPosition("Saturn");

txt('altitude');
txt('azimuth' );
txt('dec'     );
txt('decJ2000');
txt('ra'      );
txt('raJ2000' );

// The Following does not seem to work!
// core.moveToAltAzi(pos['altitude'], pos['azimuth'] + "d", 0);

core.moveToRaDec(pos['ra'] + "d", pos['dec'] + "d", 0);

function txt(key) {

  if (typeof(line) == 'undefined') {
    line = 0;
  }
  else {
    line++;
  }

  LabelMgr.labelScreen(    key,  20, 20 + line*18, true, 15, '#ff0000');
  LabelMgr.labelScreen(pos[key],100, 20 + line*18, true, 15, '#ff0000');

}
Github repository about-Stellarium, path: /API/core/getObjectPosition.ssc

See also

core.selectObjectByName()
core.getObjectInfo()
Stellarium Script API

Index