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

A collection of refraction models and utilities to use with novas_app_to_hor() or novas_hor_to_app(). More...

## Macros

#define | NOVAS_DEFAULT_WAVELENGTH 0.55
| [μm] Median wavelength of visible light.

## Functions

double | novas_inv_refract (RefractionModel model, double jd_tt, const on_surface *restrict loc, enum novas_refraction_type type, double el0)
| Computes the reverse atmospheric refraction for a given refraction model.
double | novas_optical_refraction (double jd_tt, const on_surface *loc, enum novas_refraction_type type, double el)
| Returns an optical refraction correction using the weather parameters defined for the observer location.
double | novas_radio_refraction (double jd_tt, const on_surface *loc, enum novas_refraction_type type, double el)
| Atmospheric refraction model for radio wavelengths (Berman & Rockwell 1976).
int | novas_refract_wavelength (double microns)
| Sets the observing wavelength for which refraction is to be calculated when using a wavelength-depenendent model, such as novas_wave_refraction().
double | novas_standard_refraction (double jd_tt, const on_surface *loc, enum novas_refraction_type type, double el)
| Returns an optical refraction correction for a standard atmosphere.
double | novas_wave_refraction (double jd_tt, const on_surface *loc, enum novas_refraction_type type, double el)
| The wavelength-dependent IAU atmospheric refraction model, based on the SOFA iauRefco() function, in compliance to the 'SOFA Software License' terms of the original source.
double | refract (const on_surface *restrict location, enum novas_refraction_model model, double zd_obs)
| Computes atmospheric optical refraction for an observed (already refracted!) zenith distance through the atmosphere.
double | refract_astro (const on_surface *restrict location, enum novas_refraction_model model, double zd_astro)
| Computes atmospheric optical refraction for a source at an astrometric zenith distance (e.g.

## Detailed Description

A collection of refraction models and utilities to use with novas_app_to_hor() or novas_hor_to_app().

Date
  Created on Jun 27, 2024

Author
  Attila Kovacs and G. Kaplan

See also
  novas_app_to_hor(), novas_hor_to_app()

## Macro Definition Documentation

## NOVAS_DEFAULT_WAVELENGTH

#define NOVAS_DEFAULT_WAVELENGTH 0.55

[μm] Median wavelength of visible light.

## Function Documentation

## novas_inv_refract()

double novas_inv_refract | ( | RefractionModel | model,
|  | double | jd_tt,
|  | const on_surface *restrict | loc,
|  | enum novas_refraction_type | type,
|  | double | el0 )

Computes the reverse atmospheric refraction for a given refraction model.

Thus if a refraction model takes observed elevation as an input, the reverse refraction takes astrometric elevation as its input, and vice versa.

Parameters

  model | The original refraction model
  jd_tt | [day] Terrestrial Time (TT) based Julian data of observation
  loc | Pointer to structure defining the observer's location on earth, and local weather
  type | Refraction type to use for the original model: NOVAS_REFRACT_OBSERVED (-1) or NOVAS_REFRACT_ASTROMETRIC (0).
  el0 | [deg] input elevation for the inverse refraction model.

Returns
  [deg] Estimated refraction, or NAN if there was an error (it should also set errno to indicate the type of error).

See also
  refract_astro(), itrs_to_hor()

Since
  1.1

Author
  Attila Kovacs

References novas_inv_max_iter, and NOVAS_REFRACT_OBSERVED.

Referenced by novas_radio_refraction(), and novas_wave_refraction().

## refract()

double refract | ( | const on_surface *restrict | location,
|  | enum novas_refraction_model | model,
|  | double | zd_obs )

Computes atmospheric optical refraction for an observed (already refracted!) zenith distance through the atmosphere.

In other words this is suitable to convert refracted zenith angles to astrometric (unrefracted) zenith angles. For the reverse, see refract_astro().

The returned value is the approximate refraction for optical wavelengths. This function can be used for planning observations or telescope pointing, but should not be used for precise positioning.

NOTES:

1. The standard temeperature model includes a very rough estimate of the mean annual temperature for the ovserver's latitude and elevation, rather than the 10 C everywhere assumption in NOVAS C 3.1.

REFERENCES:

1. Explanatory Supplement to the Astronomical Almanac, p. 144.
2. Bennett, G. (1982), Journal of Navigation (Royal Institute) 35, pp. 255-259.

Parameters

  location | Pointer to structure containing observer's location. It may also contains weather data (optional) for the observer's location. Some, but not all, refraction models will use location-based (e.g. weather) information. For models that do not need it, it may be NULL.
  model | The built in refraction model to use. E.g. NOVAS_STANDARD_ATMOSPHERE (1), or NOVAS_WEATHER_AT_LOCATION (2)...
  zd_obs | [deg] Observed (already refracted!) zenith distance through the atmosphere.

Returns
  [deg] the calculated optical refraction or 0.0 if the location is NULL or the option is invalid or the 'zd_obs' is invalid (<90°).

See also
  refract_astro(), hor_to_itrs()

References NOVAS_NO_ATMOSPHERE, NOVAS_RADIO_REFRACTION, novas_radio_refraction(), NOVAS_REFRACT_OBSERVED, NOVAS_REFRACTION_MODELS, novas_set_default_weather(), NOVAS_WAVE_REFRACTION, novas_wave_refraction(), NOVAS_WEATHER_AT_LOCATION, novas_on_surface::pressure, and novas_on_surface::temperature.

Referenced by refract_astro().

## refract_astro()

double refract_astro | ( | const on_surface *restrict | location,
|  | enum novas_refraction_model | model,
|  | double | zd_astro )

Computes atmospheric optical refraction for a source at an astrometric zenith distance (e.g.

calculated without accounting for an atmosphere). This is suitable for converting astrometric (unrefracted) zenith angles to observed (refracted) zenith angles. See refract() for the reverse correction.

The returned value is the approximate refraction for optical wavelengths. This function can be used for planning observations or telescope pointing, but should not be used for precise positioning.

REFERENCES:

1. Explanatory Supplement to the Astronomical Almanac, p. 144.
2. Bennett, G. (1982), Journal of Navigation (Royal Institute) 35, pp. 255-259.

Parameters

  location | Pointer to structure containing observer's location. It may also contains weather data (optional) for the observer's location. Some, but not all, refraction models will use location-based (e.g. weather) information. For models that do not need it, it may be NULL.
  model | The built in refraction model to use. E.g. NOVAS_STANDARD_ATMOSPHERE (1), or NOVAS_WEATHER_AT_LOCATION (2)...
  zd_astro | [deg] Astrometric (unrefracted) zenith distance angle of the source.

Returns
  [deg] the calculated optical refraction. (to ~0.1 arcsec accuracy), or 0.0 if the location is NULL or the option is invalid.

See also
  refract(), itrs_to_hor()

Since
  1.0

Author
  Attila Kovacs

References novas_inv_max_iter, NOVAS_RADIO_REFRACTION, novas_radio_refraction(), NOVAS_REFRACT_ASTROMETRIC, and refract().

Referenced by equ2hor().