Loading...
Searching...
No Matches
target.c File Reference

This module contains functions that define an observing target, or which are target related. More...

## Functions

short | make_cat_entry (const char *restrict name, const char *restrict catalog, long cat_num, double ra, double dec, double pm_ra, double pm_dec, double parallax, double rad_vel, cat_entry *source)
| Fully populates the data structure for a catalog source, such as a star, with all parameters provided at once.
int | make_cat_object (const cat_entry *star, object *source)
| Populates and object data structure with the data for a catalog source.
int | make_cat_object_sys (const cat_entry *star, const char *restrict system, object *source)
| Populates and object data structure with the data for a catalog source for a given system of catalog coordinates.
int | make_ephem_object (const char *name, long num, object *body)
| Sets a celestial object to be a Solar-system ephemeris body.
short | make_object (enum novas_object_type type, long number, const char *name, const cat_entry *star, object *source)
int | make_orbital_object (const char *name, long num, const novas_orbital *orbit, object *body)
| Sets a celestial object to be a Solar-system orbital body.
int | make_planet (enum novas_planet num, object *restrict planet)
| Sets a celestial object to be a major planet, or the Sun, Moon, Solar-system Barycenter, etc.
int | make_redshifted_cat_entry (const char *name, double ra, double dec, double z, cat_entry *source)
| Populates a celestial object data structure with the parameters for a redhifted catalog source, such as a distant quasar or galaxy.
int | make_redshifted_object (const char *name, double ra, double dec, double z, object *source)
| Populates a celestial object data structure with the ICRS astrometric parameters for a redhifted catalog source, such as a distant quasar or galaxy.
int | make_redshifted_object_sys (const char *name, double ra, double dec, const char *restrict system, double z, object *source)
| Populates a celestial object data structure with the parameters for a redhifted catalog source, such as a distant quasar or galaxy, for a given system of catalog coordinates.
void | novas_case_sensitive (int value)
| Enables or disables case-sensitive processing of the object name.
double | novas_helio_dist (double jd_tdb, const object *restrict source, double *restrict rate)
| Returns a Solar-system body's distance from the Sun, and optionally also the rate of recession.
int | novas_init_cat_entry (cat_entry *restrict source, const char *restrict name, double ra, double dec)
| Initializes a catalog entry, such as a star or a distant galaxy, with a name and coordinates.
enum novas_planet | novas_planet_for_name (const char *restrict name)
| Returns the NOVAS planet ID for a given name (case insensitive), or -1 if no match is found.
int | novas_set_catalog (cat_entry *restrict source, const char *restrict catalog, long num)
| Sets the optional catalog information for a sidereal source.
int | novas_set_distance (cat_entry *source, double parsecs)
| Sets the distance for a catalog source.
int | novas_set_lsr_vel (cat_entry *source, double epoch, double v_kms)
| Sets a radial velocity for a catalog source, defined w.r.t.
int | novas_set_parallax (cat_entry *source, double mas)
| Sets the parallax (a measure of distance) for a catalog source.
int | novas_set_proper_motion (cat_entry *source, double pm_ra, double pm_dec)
| Sets the proper-motion for a (Galactic) catalog source.
int | novas_set_redshift (cat_entry *source, double z)
| Sets a redhift for a catalog source, as a relativistic measure of velocity.
int | novas_set_ssb_vel (cat_entry *source, double v_kms)
| Sets a radial velocity for a catalog source, defined w.r.t.
double | novas_solar_power (double jd_tdb, const object *restrict source)
| Returns the typical incident Solar power on a Solar-system body at the time of observation.
int | proper_motion (double jd_tdb_in, const double *pos, const double *restrict vel, double jd_tdb_out, double *out)
| Applies proper motion, including foreshortening effects, to a star's position.
int | starvectors (const cat_entry *restrict star, double *restrict pos, double *restrict motion)
| Converts angular quantities for stars to vectors.
short | transform_cat (enum novas_transform_type option, double jd_tt_in, const cat_entry *in, double jd_tt_out, const char *out_id, cat_entry *out)
| Transform a star's catalog quantities for a change the coordinate system and/or the date for which the positions are calculated.
int | transform_hip (const cat_entry *hipparcos, cat_entry *hip_2000)
| Convert Hipparcos catalog data at epoch J1991.25 to epoch J2000.0, for use within NOVAS.

## Detailed Description

This module contains functions that define an observing target, or which are target related.

In general, the object data structure contains information on the astronomical target of observation. Depending on the type of astronomical source, you might use different functions to define the observing target:

- For major planets, Sun, Moon, Solar-system barycenter (SSB), Earth-Moon barycenter (EMB), or the Pluto system barycenter: Use make_planet() or else one of the static initializers, such as NOVAS_MARS_INIT.
- For Solar-system bodies, that is everything with ephemeris data other than a 'major planet', such as asteroids, comets, moons, spacecraft, you'd use make_ephem_object().
- For Keplerian orbital elements, such as the ones published by the Minor Planet Center (MPC) for asteroids, comets, or Near-Earth Objects (NEOs), you will want to use make_orbital_object().
- For catalog sources, especially within our own Galaxy, you might start with novas_init_cat_entry() and then set additional parameters as needed, and then define an object with ICRS coordinates, e.g. via make_cat_object_sys().
- For extragalactic sources (with no proper motion or parallax) you might use novas_make_redshifted_object() with ICRS coordinates, or else novas_make_redshifted_object_sys() with coordinates in other reference systems.

By default SuperNOVAS treats object names as case insensitive (for historical reasons), and will use capitalized versions of the names supplied by the user. You can enable case-sensitive name processing with novas_case_sensitive() if needed.

Once an object is defined, you may calculate astrometric properties, such as apparent or geometric positions; rise, set, or transit times, etc. through observing frames, which are defined for a specific observer location and time of observation.

Date
  Created on Mar 6, 2025

Author
  Attila Kovacs and G. Kaplan

See also
  frames.c, observer.c, timescale.c

## Function Documentation

## make_object()

short make_object | ( | enum novas_object_type | type,
|  | long | number,
|  | const char * | name,
|  | const cat_entry * | star,
|  | object * | source )

Deprecated
  More functionality and more readable, code results from using one of the specific alternatives: make_cat_object(), make_redshifted_object(), make_planet(), make_ephem_object(), or make_orbital_object().

Populates an object data structure using the parameters provided. By default (for compatibility with NOVAS C) source names are converted to upper-case internally. You can however enable case-sensitive processing by calling novas_case_sensitive() before.

NOTES:

1. This call does not initialize the orbit field (added in v1.2) with zeroes to remain ABI compatible with versions <1.2.

Parameters

  | type | The type of object. NOVAS_PLANET (0), NOVAS_EPHEM_OBJECT (1) or NOVAS_CATALOG_OBJECT (2), or NOVAS_ORBITAL_OBJECT (3).
  | number | The novas ID number (for solar-system bodies only, otherwise ignored)
  | name | The name of the object (case insensitive). It should be shorter than SIZE_OF_OBJ_NAME or else an error will be returned. The name is converted to upper internally unless novas_case_sensitive() was called before to change that.
  | star | Pointer to structure to populate with the catalog data for a celestial object located outside the solar system. Used only if type is NOVAS_CATALOG_OBJECT, otherwise ignored and can be NULL.
  [out] | source | Pointer to the celestial object data structure to be populated.

Returns
  0 if successful, or -1 if 'cel_obj' is NULL or when type is NOVAS_CATALOG_OBJECT and 'star' is NULL, or else 1 if 'type' is invalid, 2 if 'number' is out of legal range or 5 if 'name' is too long.

See also
  make_cat_object(), make_redshifted_object(), make_planet(), make_ephem_object(), make_orbital_object()
  novas_case_sensitive(), novas_make_frame()

References object::name, NOVAS_CATALOG_OBJECT, NOVAS_OBJECT_TYPES, NOVAS_PLANET, NOVAS_PLANETS, object::number, object::star, and object::type.