Units constants

From VectorSpaceLab/AREX-Skill · View interactive version

Units constants is an AI agent skill from the GitHub repository VectorSpaceLab/AREX-Skill. Use Astropy units, quantities, equivalencies, custom units, physical types, and physical constants safely in astronomy calculations.

How to use this skill

Skill file

Units and Constants Router

Use this sub-skill when a task centers on Astropy physical units, unit-aware

arrays, conversions, equivalencies, constants, or unit validation.

Load This When

.decompose(), .si, .cgs, or unit arithmetic.

Doppler velocity, temperature, parallax, brightness temperature, or

dimensionless angles.

or needs VOUnit/FITS/CDS formatting.

are involved.

Route Away When

../time-coordinates/SKILL.md.

../tables-io/SKILL.md.

../cosmology/SKILL.md.

../cli-config-data/SKILL.md or the root troubleshooting reference.

First Actions

  1. Identify whether each input is a scalar, NumPy array, Quantity, Unit,

string unit, or constant.

  1. Convert to a Quantity early: value * u.unit or u.Quantity(value, unit).
  2. Keep quantities unit-aware until an external package requires raw values.
  3. Use .to(target_unit, equivalencies=...) for conversion and .to_value(...)

only at boundaries.

  1. If .to() fails, decide whether an equivalency is scientifically justified.
  2. For constants, inspect the attached unit and whether SI/CGS ambiguity exists

before using a raw .value.

  1. Validate output with a dimensional check: quantity.unit.is_equivalent(...)

or quantity.physical_type.

References

constructors and key APIs for units, quantities, equivalencies, and constants.

recipes for unit-aware calculations, equivalencies, custom units, NumPy

interop, and constants.

conversion errors, cgs electromagnetic ambiguity, lost units, parser strictness,

and formatting pitfalls.

Safety and Validation

state the target unit used for .to_value().

which equivalency was used.

units.

values into code.

depends sensitively on CODATA/IAU revisions.

Native-Backed Validation Ideas

is equivalent to Hz.

expected.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.