Measures (reference frames)
import SOFA (and optionally EarthOrientation) activates measconvert; see Concepts. Split off from the main API reference page since this category alone (measure types, measconvert, and ~50 reference-frame singleton types) is large enough to push the combined API page past Documenter's HTML size limit.
MeasurementSets.measinfo — Function
measinfo(t, col) -> Union{Nothing,MeasInfo}Parse the MEASINFO keyword of column col. nothing if the column carries no measure information.
MeasurementSets.MeasInfo — Type
MeasInfoThe parsed MEASINFO (+ QuantumUnits) of a measure-valued column. fixedref xor varrefcol is set.
MeasurementSets.measure — Function
measure(t, col, row; epoch=nothing) -> Measure | Vector{Measure}
measure(t, col) -> VectorRead column col of t as a physical measure, taking its reference frame from the MEASINFO keyword (a fixed Ref, or a per-row VarRefCol code). An epoch column yields MEpoch (MJD days), a direction column MDirection (radians), a position column MPosition (metres), a frequency column MFrequency (Hz) – an array-valued frequency/direction cell yields a Vector of them.
Passing epoch (an MEpoch) to a direction cell of a FIELD subtable evaluates a moving target: if that field row is a comet / planet (field_ephemeris finds one), the returned direction is the ephemeris position at epoch (in the ephemeris table's own posrefsys frame), shifted by the stored PHASE_DIR offset.
MeasurementSets.measconvert — Function
measconvert(m::Measure, R::Type{<:RefFrame}; frame=MeasFrame()) -> MeasureConvert measure m to reference frame R. Needs SOFA.jl loaded (import SOFA); import EarthOrientation as well for full ΔUT1 / polar-motion accuracy (otherwise ~1 arcsecond, with a one-time warning). frame supplies whatever auxiliary epoch / position / source direction the target frame requires – see MeasFrame.
measconvert(d::MDoppler{C}, C2::Type{<:DopplerType}) -> MDoppler{C2}Re-express a Doppler shift in another convention.
MeasurementSets.observatory — Function
observatory(name) -> MPosition{ITRF} | nothingThe ITRF position of a known telescope ("VLA", "ALMA", "ATCA", "GBT", "WSRT", "GMRT", …), matched case-insensitively. nothing if the name is not in the bundled table.
MeasurementSets.MeasFrame — Type
MeasFrame(; epoch, position, direction)The auxiliary information a reference-frame conversion needs: an MEpoch (for APP, AZEL, any velocity frame), an MPosition (for AZEL/HADEC, TOPO), and an MDirection source direction (for every frequency / radial-velocity conversion). Fields are set as needed and may be left nothing.
MeasurementSets.MEpoch — Type
MEpoch{R}(mjd)An instant of time as a Modified Julian Date (days) in time scale R (UTC/TAI/TT/TDB/UT1).
MeasurementSets.MDirection — Type
MDirection{R}(lon, lat)A direction on the sky, longitude/latitude in radians, in frame R (J2000/ICRS/B1950/APP/GALACTIC/ECLIPTIC/AZEL/AZELGEO/HADEC).
MeasurementSets.MPosition — Type
MPosition{R}(x, y, z)A location, geocentric Cartesian metres, in frame R (ITRF/WGS84).
Note this differs from real casacore's own MPosition::WGS84, which represents a geodetic (longitude, latitude, height) position — here WGS84 is only a frame label, and measconvert between ITRF/WGS84 is an identity on (x,y,z) (no real MS POSITION column ever uses MEASINFO Ref="WGS84"). For the real geodetic ↔ Cartesian ellipsoidal transform, use _geodetic_to_itrf/_itrf_to_geodetic (internal — exposed to TaQL-lite as meas.wgs()/meas.itrfxyz()).
MeasurementSets.MFrequency — Type
MFrequency{R}(hz)A frequency in hertz, referenced to velocity frame R (TOPO/GEO/BARY/LSRK/LSRD/GALACTO/REST).
MeasurementSets.MRadialVelocity — Type
MRadialVelocity{R}(mps)A radial velocity in m/s, referenced to velocity frame R (LSRK/LSRD/BARY/GEO/TOPO/GALACTO). measconvert converts between these frames (needs import SOFA and frame.direction).
MeasurementSets.MDoppler — Type
MDoppler{C}(d)A Doppler shift as a dimensionless value in convention C (RADIO / OPTICAL / RATIO / BETA / GAMMA). measconvert(d, C2) changes convention; doppler / frequency / radialvelocity / restfrequency bridge to the other spectral measures (a rest frequency is needed where one is).
MeasurementSets.MBaseline — Type
MBaseline{R}(x, y, z)A baseline vector (antenna → antenna) in metres, in direction frame R (ITRF / J2000 / APP / AZEL / HADEC / GALACTIC / …). measconvert rotates it between frames (needs import SOFA), preserving its length — equivalent to converting the unit direction and rescaling.
MeasurementSets.MuvW — Type
MuvW{R}(u, v, w)A uvw baseline coordinate in metres, in direction frame R — the UVW column of an MS. Differs from an MBaseline by the rotation onto the frame whose w-axis points at the phase centre, so measconvert also needs frame.direction (the phase centre).
MeasurementSets.MEarthMagnetic — Type
MEarthMagnetic{R}(x, y, z)The Earth's magnetic field as a 3-vector in nano-tesla, in direction frame R. MEarthMagnetic{IGRF} is a model frame: measconvert(MEarthMagnetic{IGRF}(...), R; frame) evaluates the IGRF-14 field at frame.position / frame.epoch and rotates it to R. See earthfield.
MeasurementSets.earthfield — Function
earthfield(pos::MPosition, epoch::MEpoch) -> MEarthMagnetic{ITRF}The IGRF-14 geomagnetic field vector (nano-tesla, ITRF Cartesian) at pos and epoch. Model accuracy is ~arcminute-of-arc in direction / ~150 nT; the epoch is used as given (the ~1 minute UTC/TDB difference is negligible for the 5-year-interpolated model).
MeasurementSets.EarthMagneticMachine — Type
EarthMagneticMachine(height, pos::MPosition, epoch::MEpoch)A reusable emm_lineofsight evaluator for one shell height, observer and epoch — call it on a direction: machine(dir).
MeasurementSets.emm_lineofsight — Function
emm_lineofsight(dir::MDirection, height, pos::MPosition, epoch::MEpoch)
-> (; losfield, field, subpoint, sublon, sublat)The geomagnetic field along the line of sight to dir, sampled where the ray from pos crosses a sphere height metres above the observer's geocentric radius (e.g. height = 350e3 for the ionospheric F-layer):
losfield— the field component parallel to the line of sight (nT); multiply by the slant TEC and2.63e-13for the RM.field— the full field vector at the pierce point,MEarthMagnetic{ITRF}.subpoint— the pierce point,MPosition{ITRF}.sublon/sublat— its geocentric longitude / latitude (rad).
dir may be in any direction frame; it is rotated to ITRF using epoch + pos. Needs import SOFA.
MeasurementSets.rotation_measure — Function
rotation_measure(dir, epoch, pos; stec, height=350e3) -> Float64
rotation_measure(m::EarthMagneticMachine, dir; stec) -> Float64The ionospheric rotation measure (rad/m²) toward dir, in the thin-shell approximation: RM_IONOSPHERE · stec · B∥, with B∥ the geomagnetic field component along the direction of propagation (source → observer) where the line of sight pierces a shell height m up (emm_lineofsight), and stec the slant total electron content in TECU (10¹⁶ e⁻/m²). Positive RM ⇔ the field points toward the observer. Needs import SOFA.
MeasurementSets.faraday_rotation — Function
faraday_rotation(rm, freq) -> Δχ (rad)The polarization-angle rotation RM · λ² at frequency freq (Hz — a number or MFrequency). λ = c / freq.
MeasurementSets.derotate_angle — Function
derotate_angle(χ, rm, freq) -> χ − RM·λ²Remove the Faraday rotation from an observed polarization angle χ (rad).
MeasurementSets.RM_IONOSPHERE — Constant
Ionospheric rotation-measure constant (SI collapsed to practical units): RM [rad/m²] = RM_IONOSPHERE · STEC[TECU] · B∥[nT], where RM_IONOSPHERE = e³/(8π²ε₀mₑ²c³) · 10¹⁶ · 10⁻⁹ ≈ 2.631e-6.
MeasurementSets.Ephemeris — Type
EphemerisAn opened solar-system ephemeris table (casacore MeasComet format). Construct with open_ephemeris or get one for a moving-target field with field_ephemeris; evaluate with ephemeris_direction / ephemeris_radvel / ephemeris_distance.
MeasurementSets.open_ephemeris — Function
open_ephemeris(path) -> EphemerisOpen a casacore ephemeris (MeasComet) table at path.
MeasurementSets.field_ephemeris — Function
field_ephemeris(fld::Table, field_id) -> Ephemeris | nothingIf FIELD row field_id (0-based) is a moving target — a non-negative EPHEMERIS_ID with a matching EPHEM<id>_*.tab in the FIELD subtable directory — return its opened Ephemeris, else nothing.
MeasurementSets.ephemeris_direction — Function
ephemeris_direction(e::Ephemeris, mjd) -> MDirectionThe target direction at mjd (MJD, ideally TDB — a coarsely sampled table makes the UTC↔TDB difference negligible), in the table's own posrefsys frame. Linearly interpolates the Cartesian (ρ, RA, Dec) vector between the two bracketing rows.
MeasurementSets.ephemeris_radvel — Function
ephemeris_radvel(e::Ephemeris, mjd) -> Float64The target radial velocity at mjd, m/s (linear interpolation of the RadVel column, AU/d → m/s).
MeasurementSets.ephemeris_distance — Function
ephemeris_distance(e::Ephemeris, mjd) -> Float64The geocentric distance to the target at mjd, metres.
MeasurementSets.ephemeris_diskpos — Function
ephemeris_diskpos(e::Ephemeris, mjd) -> (lon, lat)The sub-observer point on the target body's surface at mjd — the DiskLong / DiskLat ephemeris columns (rad), great-circle interpolated between the bracketing rows (casacore MeasComet::getDisk). Errors if the table has no DiskLong / DiskLat columns.
MeasurementSets.doppler — Function
doppler(f::MFrequency, restfreq) -> MDoppler{BETA}
doppler(v::MRadialVelocity) -> MDoppler{BETA}The Doppler shift of f relative to restfreq (a frequency in Hz or an MFrequency), or of a radial velocity (β = v/c). Result in the BETA (true v/c) convention – measconvert it to RADIO / OPTICAL / etc. as needed.
MeasurementSets.frequency — Function
frequency(d::MDoppler, restfreq) -> MFrequency{LSRK}
frequency(v::MRadialVelocity, restfreq) -> MFrequency{LSRK}The frequency √((1−β)/(1+β)) · ν₀ implied by a Doppler shift (casacore fromDoppler) or a radial velocity v and a line rest frequency restfreq. The result frame defaults to LSRK.
MeasurementSets.radialvelocity — Function
radialvelocity(d::MDoppler) -> MRadialVelocity{LSRK}
radialvelocity(f::MFrequency, restfreq) -> MRadialVelocity{LSRK}The true radial velocity of a Doppler shift (c·β, casacore fromDoppler), or of a frequency f relative to restfreq (= radialvelocity(doppler(f, restfreq))). The two-argument form broadcasts — radialvelocity.(measure(spw, "CHAN_FREQ"), ν₀) is a velocity axis. The result frame defaults to LSRK.
MeasurementSets.restfrequency — Function
restfrequency(f::MFrequency, d::MDoppler) -> MFrequency{REST}The rest frequency ν / √((1−β)/(1+β)) given an observed frequency and its Doppler shift (casacore toRest).
MeasurementSets.shiftfreq — Function
shiftfreq(d::MDoppler, ν) -> same shape as νMultiply frequency(ies) ν by the Doppler factor √((1−β)/(1+β)) (β from d in the BETA convention) — the vectorised form of casacore MDoppler::shiftFrequency. ν is a frequency in Hz, an MFrequency (the frame label is kept), or a vector of either (the factor is computed once).
Unlike casacore, a non-BETA d is converted to BETA first.
MeasurementSets.reftype — Function
reftype(m::Measure) -> Type{<:RefFrame}The reference-frame type parameter of a measure value (reftype(MEpoch{UTC}(0)) === UTC).
MeasurementSets.RefFrame — Type
RefFrameAbstract supertype of every measure reference frame. Concrete singleton subtypes, used as the type parameter of a measure value (MEpoch{UTC}, MDirection{J2000}) and as the target of measconvert:
| group | frames |
|---|---|
| epoch (time scale) | UTC TAI TT TDB UT1 |
| direction | J2000 ICRS B1950 APP GALACTIC SUPERGAL ECLIPTIC HADEC AZEL AZELGEO AZELSW AZELSWGEO |
| earth-fixed | ITRF WGS84 TOPO |
| frequency / radial velocity | REST LSRK LSRD BARY GEO GALACTO |
An unrecognised casacore frame name is carried as OtherRef{:Name} (parsed, not convertible).
MeasurementSets.DopplerType — Type
A Doppler-shift convention (RADIO / OPTICAL / RATIO / BETA / GAMMA).
MeasurementSets.UTC — Type
Coordinated Universal Time (epoch scale).
MeasurementSets.TAI — Type
International Atomic Time (epoch scale).
MeasurementSets.TT — Type
Terrestrial Time (epoch scale).
MeasurementSets.TDB — Type
Barycentric Dynamical Time (epoch scale).
MeasurementSets.UT1 — Type
Universal Time UT1 (epoch scale; needs ΔUT1).
MeasurementSets.J2000 — Type
Mean equator and equinox of J2000.0 (direction; treated as ICRS).
MeasurementSets.ICRS — Type
International Celestial Reference System (direction).
MeasurementSets.B1950 — Type
FK4 B1950.0 (direction).
MeasurementSets.APP — Type
Geocentric apparent place, equinox of date (direction).
MeasurementSets.GALACTIC — Type
Galactic coordinates (direction).
MeasurementSets.SUPERGAL — Type
Supergalactic coordinates (direction; a fixed rotation of GALACTIC).
MeasurementSets.ECLIPTIC — Type
J2000 ecliptic coordinates (direction).
MeasurementSets.HADEC — Type
Topocentric hour angle / declination (direction).
MeasurementSets.AZEL — Type
Azimuth / elevation about the geocentric vertical, N=0 E=90 (direction).
MeasurementSets.AZELGEO — Type
Azimuth / elevation about the geodetic vertical (direction).
MeasurementSets.AZELSW — Type
Azimuth / elevation about the geocentric vertical, S=0 W=90 – azimuth = AZEL's azimuth + 180° (direction).
MeasurementSets.AZELSWGEO — Type
Azimuth / elevation about the geodetic vertical, S=0 W=90 – azimuth = AZELGEO's azimuth + 180° (direction).
MeasurementSets.ITRF — Type
International Terrestrial Reference Frame (position / direction).
MeasurementSets.WGS84 — Type
WGS84 geodetic datum (position).
MeasurementSets.TOPO — Type
Topocentric (frequency / direction).
MeasurementSets.REST — Type
Source rest frame (frequency).
MeasurementSets.LSRK — Type
Kinematic Local Standard of Rest (frequency / radial velocity).
MeasurementSets.LSRD — Type
Dynamical Local Standard of Rest (frequency / radial velocity).
MeasurementSets.BARY — Type
Solar-system barycentre (frequency / radial velocity).
MeasurementSets.GEO — Type
Geocentric (frequency / radial velocity).
MeasurementSets.GALACTO — Type
Galactocentric (frequency / radial velocity).
MeasurementSets.LGROUP — Type
Local Group barycentre, ~308 km/s (frequency / radial velocity).
MeasurementSets.CMB — Type
Cosmic microwave background rest frame, ~369.5 km/s (frequency / radial velocity).
MeasurementSets.MERCURY — Type
The planet Mercury as a direction (geocentric apparent place).
MeasurementSets.VENUS — Type
The planet Venus as a direction (geocentric apparent place).
MeasurementSets.MARS — Type
The planet Mars as a direction (geocentric apparent place).
MeasurementSets.JUPITER — Type
The planet Jupiter as a direction (geocentric apparent place).
MeasurementSets.SATURN — Type
The planet Saturn as a direction (geocentric apparent place).
MeasurementSets.URANUS — Type
The planet Uranus as a direction (geocentric apparent place).
MeasurementSets.NEPTUNE — Type
The planet Neptune as a direction (geocentric apparent place).
MeasurementSets.SUN — Type
The Sun as a direction (geocentric apparent place).
MeasurementSets.MOON — Type
The Moon as a direction (geocentric apparent place; topocentric when frame.position is set).
MeasurementSets.IGRF — Type
IGRF-14 geomagnetic field model as an MEarthMagnetic source frame — measconvert(MEarthMagnetic{IGRF}(...), ITRF; frame) evaluates the field at frame.position and frame.epoch.
MeasurementSets.RADIO — Type
Radio velocity cΔν/ν₀ (D = 1 − ν/ν₀).
MeasurementSets.OPTICAL — Type
Optical velocity / redshift z = cΔλ/λ₀ (D = ν₀/ν − 1).
MeasurementSets.RATIO — Type
The frequency ratio ν/ν₀ itself.
MeasurementSets.BETA — Type
True relativistic velocity v/c (D = (1−F²)/(1+F²), F = ν/ν₀).
MeasurementSets.GAMMA — Type
The Lorentz factor γ (D = (1+F²)/(2F)).
MeasurementSets.Z — Type
Alias for OPTICAL — casacore's Z (redshift) spelling.
MeasurementSets.RELATIVISTIC — Type
Alias for BETA — casacore's RELATIVISTIC spelling.