Sidereon.SpaceWeather (Sidereon v3.0.0)

Copy Markdown View Source

Space-weather tables for drag and decay inputs.

The parser and lookup policy are implemented in the core NIF. This module reads optional files, owns the Elixir structs, and forwards table operations to the parsed native resource.

Summary

Types

The class of a space-weather row: observed, interpolated by the source (flux qualifier 2 or 4, or INT in CSV), a day with no flux observation (flux qualifier 3), daily predicted, or monthly predicted.

t()

Functions

The NRLMSISE-00 Ap history array at epoch_j2000_s under policy, with the least-trusted row class consulted and the substitutions made.

The non-fatal findings of the parse that built the table: skipped lines (:skips, each with its line, reason and detail) and warnings (:warnings, each with its line and kind), such as a row out of date order, which is kept and sorted into place, a repeated date, of which the first row is kept, or a declared point count that differs from the rows read.

Types

error_reason()

@type error_reason() ::
  :unrecognized_format
  | :not_text
  | {:malformed, non_neg_integer(), String.t()}
  | {:before_coverage, float(), float()}
  | {:after_coverage, float(), float()}
  | {:missing_data, integer(), integer(), integer(), String.t()}
  | {:rejected_by_policy, atom(), integer(), integer(), integer()}
  | {:invalid_epoch, float()}
  | term()

observation_class()

@type observation_class() ::
  :observed
  | :interpolated
  | :not_observed
  | :daily_predicted
  | :monthly_predicted

The class of a space-weather row: observed, interpolated by the source (flux qualifier 2 or 4, or INT in CSV), a day with no flux observation (flux qualifier 3), daily predicted, or monthly predicted.

t()

@type t() :: %Sidereon.SpaceWeather{handle: reference()}

Functions

ap_array_at(space_weather, epoch_j2000_s)

@spec ap_array_at(t(), number()) :: {:ok, [float()]} | {:error, error_reason()}

ap_array_at!(table, epoch_j2000_s)

ap_history_at_with_policy(space_weather, epoch_j2000_s, policy)

@spec ap_history_at_with_policy(
  t(),
  number(),
  Sidereon.SpaceWeather.Policy.t() | keyword()
) ::
  {:ok, Sidereon.SpaceWeather.ApHistory.t()} | {:error, error_reason()}

The NRLMSISE-00 Ap history array at epoch_j2000_s under policy, with the least-trusted row class consulted and the substitutions made.

ap_array_at/2 returns the array alone under the default policy.

ap_history_at_with_policy!(table, epoch_j2000_s, policy)

coverage(space_weather)

@spec coverage(t()) :: {:ok, Sidereon.SpaceWeather.Coverage.t()} | {:error, term()}

coverage!(table)

diagnostics(space_weather)

@spec diagnostics(t()) :: %{skips: [map()], warnings: [map()]}

The non-fatal findings of the parse that built the table: skipped lines (:skips, each with its line, reason and detail) and warnings (:warnings, each with its line and kind), such as a row out of date order, which is kept and sorted into place, a repeated date, of which the first row is kept, or a declared point count that differs from the rows read.

load(path)

@spec load(String.t()) :: {:ok, t()} | {:error, term()}

load!(path)

parse(bytes)

@spec parse(binary()) :: {:ok, t()} | {:error, error_reason()}

parse!(bytes)

sample_at(space_weather, epoch_j2000_s)

@spec sample_at(t(), number()) ::
  {:ok, Sidereon.SpaceWeather.Sample.t()} | {:error, error_reason()}

sample_at!(table, epoch_j2000_s)

sample_at_with_policy(space_weather, epoch_j2000_s, policy)

@spec sample_at_with_policy(
  t(),
  number(),
  Sidereon.SpaceWeather.Policy.t() | keyword()
) ::
  {:ok, Sidereon.SpaceWeather.Sample.t()} | {:error, error_reason()}

sample_at_with_policy!(table, epoch_j2000_s, policy)

space_weather_at(space_weather, epoch_j2000_s)

@spec space_weather_at(t(), number()) ::
  {:ok, Sidereon.Drag.SpaceWeather.t()} | {:error, error_reason()}

space_weather_at!(table, epoch_j2000_s)

to_csv_text(space_weather)

@spec to_csv_text(t()) :: {:ok, String.t()} | {:error, term()}

to_txt_text(space_weather)

@spec to_txt_text(t()) :: {:ok, String.t()} | {:error, term()}