Post Reply 
computing the apparent place of a star
12-13-2022, 10:33 AM
Post: #1
computing the apparent place of a star
This HP Prime program can be used to calculate the geocentric and topocentric apparent place of a star. Most of the routines used in this program have been ported to HP PPL from the Naval Observatory Vector Astrometry Software (NOVAS).

The coordinates and motion characteristics of the star of interest should be coded similar to the data for Altair show below.

/////////////////////////////////////////////////
// coordinates and motion characteristics of star
/////////////////////////////////////////////////

// star name

sname := "ALTAIR";

// J2000 right ascension (hours)

ram := 19.8463894440;

// J2000 declination (degrees)

decm := 8.8683416670;

// J2000 proper motion in right ascension (seconds/Julian century)

pmra := 3.6290;

// J2000 proper motion in declination (arcseconds/Julian century)

pmdec := 38.6300;

// parallax (arcseconds)

parlax := 0.1981;

// radial velocity (kilometers/second)

radvel := -26.30;

Calculating the topocentric apparent place requires the geographic coordinates of the observer according to the following example. Please note the units and sign conventions for this data.

if (topo = 1) then

///////////////////////
// observer coordinates
///////////////////////

// geographic latitude of the observer
// (-90 <= degrees <= +90, 0 <= minutes <= 60, 0 <= seconds <= 60)
// (north latitude is positive, south latitude is negative)

obslat := dtr * (39.0 + 40.0 / 60.0 + 36 / 3600.0);

// geographic longitude of the observer
// (0 <= degrees <= 360, 0 <= minutes <= 60, 0 <= seconds <= 60)
// (east longitude is positive, west longitude is negative)

obslong := -dtr * (104.0 + 57.0 / 60.0 + 12.0 / 3600.0);

// altitude of the observer (meters)
// (positive above sea level, negative below sea level)

obsalt := 1644.0;

// define observer east longitude (degrees)

glon := obslong * rtd;

// define observer geodetic latitude (degrees)

glat := obslat * rtd;

// define observer altitude (meters)

ht := obsalt;

else

glon := 0.0;

glat := 0.0;

ht := 0.0;

end;

The software also requires the heliocentric and solar system barycentric position and velocity vectors of the earth. This data, in astronomical units and astronomical units per day, should be included at the beginning of the source code with EXPORT statements like the following;

// position and velocity of the earth wrt barycenter of solar system (au and au/day)

EXPORT pebs := [0.335207364639029, 0.847950456694068, 0.367561213490944];

EXPORT vebs := [-0.016437902656370, 0.005331914082881, 0.002311774017306];

// position and velocity of the earth wrt center of sun (au and au/day)

EXPORT pess := [0.336675432007477, 0.850147421283625, 0.368555309516304];

EXPORT vess := [-0.016444008724469, 0.005333353176417, 0.002312540155858];

A Windows executable program (jpl_body_states.exe) for computing the heliocentric and solar-system-barycenter state vectors of the earth at the TDB Julian day of interest can be downloaded from

https://sourceforge.net/projects/orbital...ran/files/

This program should be run from a DOS command window. Make sure the executable and DE421.bsp ephemeris file are in the same subdirectory.

The source code and documentation for this demo_astar program can be downloaded from

https://www.dropbox.com/s/oejkphptwvh1oq...r.zip?dl=0
Find all posts by this user
Quote this message in a reply
10-16-2024, 01:53 PM
Post: #2
RE: computing the apparent place of a star
I'm getting an error message about line 1217, "deltat" reference.
Find all posts by this user
Quote this message in a reply
Yesterday, 12:43 AM (This post was last modified: Yesterday 12:44 AM by Giuseppe Donnini.)
Post: #3
RE: computing the apparent place of a star
Since I have no knowledge of, nor interest in, the HP Prime calculator, I can only try to answer this question on purely astronomical grounds.

ΔT is an empirical quantity depending on Earth’s rotation, so you probably have to supply it yourself:
  • For present-day observations you may simply use the current value – which is 69.2045 seconds as per NASA’s Earth Observing System Data and Information System (EOSDIS) – and keep it updated every month or so.
     
  • For dates between February 1973 (first recorded data) and today, you may simply fetch the appropriate value from a table, either by hand or programmatically.
     
  • For dates before February 1973, as well as for dates several years – or even centuries – in the future, you should translate the current state-of-the-art prediction models into a runnable HP Prime program.
Find all posts by this user
Quote this message in a reply
Yesterday, 06:50 PM
Post: #4
RE: computing the apparent place of a star
Thank you! That corrected the problem.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 2 Guest(s)