SwissEphSharp 2.10.4
dotnet add package SwissEphSharp --version 2.10.4
NuGet\Install-Package SwissEphSharp -Version 2.10.4
<PackageReference Include="SwissEphSharp" Version="2.10.4" />
<PackageVersion Include="SwissEphSharp" Version="2.10.4" />
<PackageReference Include="SwissEphSharp" />
paket add SwissEphSharp --version 2.10.4
#r "nuget: SwissEphSharp, 2.10.4"
#:package SwissEphSharp@2.10.4
#addin nuget:?package=SwissEphSharp&version=2.10.4
#tool nuget:?package=SwissEphSharp&version=2.10.4
SwissEphSharp
A C# port of the Astrodienst Swiss Ephemeris, the astronomical library used to compute planetary positions, house cusps, eclipses and related quantities. It is a line-by-line translation of Astrodienst's C source rather than a reimplementation, so the function names, arguments and return values are the ones in Astrodienst's own programming documentation.
swe_version() reports 2.10.04. Targets netstandard2.0, net8.0 and net10.0. No
dependencies.
Read the license first
Swiss Ephemeris, and therefore this library, is dual-licensed, and one of the two options has a condition that catches people out. You must choose one:
- AGPL-3.0. Free, but with a network clause. If you run this library as part of a service that users reach over a network, a web app, an API, a SaaS product, the AGPL requires you to offer those users the complete corresponding source of your whole service, not just this library. Operating the service is the trigger; you do not have to distribute a binary to anyone. If that does not work for your project, AGPL is not your option.
- Swiss Ephemeris Professional License. A commercial license bought from Astrodienst, without the source-disclosure obligation.
This is not a choice this package makes for you, and it follows Astrodienst's own relicensing of
Swiss Ephemeris. LICENSE, agpl-3.0.txt and NOTICE ship at the root of this package.
Astrodienst has issued a new edition of the Professional License contract, dated September 2026
(secont_e_2609.pdf).
Compared with the June 2026 edition:
- The duration changes from "valid for 99 years" to "valid for 6 years", after which it has to be renewed or the use of Swiss Ephemeris in web services or distributed software has to end.
- A new clause 3 covers API services: "If the licensee provides API services to third parties, i.e. to a business not owned by the licensee, this third party needs to purchase their own Swiss Ephemeris license, before they can legally begin using the API services. The licensee mentions that fact clearly in the documentation of his API service. The licensee obliges himself to inform Astrodienst about the identity and contact of each API service user."
- The clause granting the right to distribute Swiss Ephemeris in compiled form is no longer present, a new clause allows transferring the license to a third party (with notice to Astrodienst), and the price is unchanged (CHF 700).
The contract PDF was updated on 9 November 2026
(secont_e_2609.pdf).
The one substantive change is a new clause 13, "Use of language bindings and ports": every binding
or port must honour the dual licensing (AGPL and Astrodienst's professional license), authors of
bindings and ports may charge no extra fees, and Astrodienst lists the bindings it knows meet
this. SwissEphNet (published as SwissEphSharp) is not in that list. It is already offered under both the AGPL-3.0 and the
Professional License, and its LICENSE is unchanged.
Read the current contract and confirm the terms with Astrodienst.
Install
dotnet add package SwissEphSharp
The package ID is SwissEphSharp; the namespace and every type name stay SwissEphNet, so
using SwissEphNet; is what you write. The SwissEphNet package ID on nuget.org belongs to the
upstream project's own release, which is why this project cannot publish under it.
Your first calculation
This computes the Sun's position on 1 January 2020. It needs no data files: SEFLG_MOSEPH selects
the built-in analytic ephemeris, which is computed rather than read from disk.
using System.Globalization;
using SwissEphNet;
using var swe = new SwissEph();
// Julian day for 2020-01-01 00:00 UT, Gregorian calendar.
double jd = swe.swe_julday(2020, 1, 1, 0.0, SwissEph.SE_GREG_CAL);
var xx = new double[6];
string serr = "";
int ret = swe.swe_calc_ut(jd, SwissEph.SE_SUN, SwissEph.SEFLG_MOSEPH, xx, ref serr);
if (ret < 0)
Console.WriteLine($"error: {serr}");
else
Console.WriteLine("Sun longitude: "
+ xx[0].ToString("F6", CultureInfo.InvariantCulture) + " degrees");
Output:
Sun longitude: 280.009518 degrees
xx comes back as longitude, latitude, distance, then the three matching speeds. swe_calc_ut
takes Universal Time; swe_calc takes Ephemeris Time. A negative return means failure and serr
says why. SwissEph is IDisposable, hence the using.
Which API to call: prefer the 2 variants
Several functions have a newer sibling with a 2 in the name, and for new code that is generally
what you want.
For fixed stars this is Astrodienst's own published advice: "For new projects, we recommend using
the new functions swe_fixstar2_ut() and swe_fixstar2(). Performance will be a lot better if a
great number of fixed star calculations are done." The same goes for swe_fixstar2_mag over
swe_fixstar_mag. If an existing project is slow on star lookups, replacing the old calls is the
fix. All six are here, old and new.
For houses, swe_houses_ex2 and swe_houses_armc_ex2 are new in 2.10.03 and give you two things
the older calls cannot: per-cusp and per-ascmc speeds, and an explicit serr out-parameter
instead of a bare return code. Astrodienst does not publish a "prefer these" recommendation for
them the way it does for fixed stars, so treat them as extra capability rather than a replacement:
reach for them when you want speeds or a diagnostic message, and stay on swe_houses/
swe_houses_ex otherwise.
There is no 2 variant of swe_calc, which is why the example above uses swe_calc_ut.
Using real ephemeris files
For better accuracy, or for bodies the analytic ephemeris does not cover, point
swe_set_ephe_path at a directory of Astrodienst's .se1 files and ask for SEFLG_SWIEPH:
using var swe = new SwissEph();
swe.swe_set_ephe_path("/path/to/ephe");
var xx = new double[6];
string serr = "";
int ret = swe.swe_calc_ut(jd, SwissEph.SE_SUN, SwissEph.SEFLG_SWIEPH, xx, ref serr);
Files are read straight from the filesystem. Astrodienst publishes them in the Swiss Ephemeris
repository at aloistr/swisseph/ephe,
mirrored at ephe.scryr.io/ephe. sepl_18.se1, semo_18.se1 and
seas_18.se1 cover 1800 to 2399 and are enough for most work; each file holds six centuries
starting at the century in its name.
Watch for the silent fallback. When a file is missing the library falls back to the analytic
ephemeris, notes it in serr, and returns a number that looks perfectly reasonable. Compare ret
against the flag you asked for: ask for SEFLG_SWIEPH and get SEFLG_MOSEPH back and your path is
wrong. If you read serr instead, null-check it, because it comes back null from some successful
calls and "" from others.
When your data is not a file on disk, an embedded resource being the usual case, implement
SwissEph.IEphemerisFileProvider (one method, Stream Open(string path), returning null for
"not found") and assign it to SwissEph.FileProvider.
Threads
Create one SwissEph instance per request or operation, never used concurrently.
Separate instances are independent and can run concurrently. There is no async API; the calls are
synchronous, so wrap a long sweep in Task.Run to keep it off a UI thread.
Calling from a server? Validate input and keep instances per request: see Using SwissEph in a server.
Upgrading from SwissEphNet 2.8.0.2
Four things to check, in the order that matters:
- The license changed. 2.8.0.2 was GPL-2.0-or-later; this is AGPL-3.0 or the Professional License. See above. If you run it server-side and cannot publish your source, this is a licensing decision before it is a technical one.
- The package ID changed from
SwissEphNettoSwissEphSharp, and the assembly is nowSwissEphSharp.dll. Source that only calls the public API needs no change beyond thePackageReference. Anything that hardcodes the assembly name needs updating. - Your numbers will change. Some of that is Astrodienst's own model changes between 2.08 and
2.10.04; some is port defects that are now fixed, including one that gave every
SEFLG_SWIEPHposition the wrong obliquity. Eclipse magnitude and obscuration are now fractions rather than percentages, so a value that read100reads1. OnLoadFileis gone, replaced bySwissEph.FileProvider. If your handler just opened a real file by path, delete it:swe_set_ephe_pathalone now reaches those files.
Target frameworks moved too. 2.8.0.2 shipped net40 and netstandard1.0; neither is supported
here. .NET Framework 4.6.1 and later resolve netstandard2.0.
Upgrading from 2.10.3.x
SE_FNAME_DFT2 is gone, because upstream removed it with the DE406 fallback, so code that names it
no longer compiles. Results also move without a code change: the default Delta T model before
1 January 1962 is now SEMOD_DELTAT_STEPHENSON_ETC_2020, dt[] runs to 2033, and the default tidal
acceleration is SE_TIDAL_DE441. See CHANGELOG.md for the measured effect.
These values are C# consts, so code compiled against 2.10.3.x keeps the old ones until it is
recompiled. A caller that has only de431.eph must now call swe_set_jpl_file("de431.eph"):
SE_FNAME_DFT is de441.eph and the SE_FNAME_DFT2 fallback is gone.
The full README documents every breaking change with the C source line each one corresponds to.
Credits
The original C-to-C# port is Yan Grenier's work
(2014-2019). SwissEphSharp continues it, maintained since 2026 by Timothy van der Ham:
modernised target frameworks, the upgrade to Swiss Ephemeris 2.10.04, and a number of bug fixes in the port. The
Swiss Ephemeris itself is by Astrodienst. See NOTICE in this package for the full attribution.
This package is not published or endorsed by Yan Grenier or Astrodienst.
More
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
2.10.4.0:
- BREAKING: SE_FNAME_DFT2 is removed. Upstream deleted it together with the DE406 fallback in
open_jpl_file, so code that names the constant no longer compiles. SE_FNAME_DFT is now
de441.eph and SE_DE_NUMBER is 441. A caller that has only de431.eph must now call
swe_set_jpl_file("de431.eph"). The changed values (SE_TIDAL_DEFAULT, SE_TIDAL_SWIEPH,
SE_TIDAL_JPLEPH, SEMOD_DELTAT_DEFAULT, SEMOD_NDELTAT, SE_DE_NUMBER, SE_FNAME_DFT) are C#
consts, so code compiled against 2.10.3.x keeps the old values until it is recompiled.
- Results move without a code change. The default Delta T model is now
SEMOD_DELTAT_STEPHENSON_ETC_2020 (new, model 6), the Morrison, Stephenson, Hohenkerk and
Zawilski 2021 spline, used before 1 January 1962; dt[] runs to 2033 and adjust_for_tidacc()
changed. UT-input results before 1962 and after 2020 differ from 2.10.3.3. Measured from the
MSVC-built C, swe_deltat_ex at JD 2086302.5 (1 January 1000 proleptic Gregorian, 27 December 999
Julian) is 0.018871612655972776 days under model 6 and 0.016726901931961108 days under model 5,
the former default: 185.303 s apart.
SE_TIDAL_DEFAULT is SE_TIDAL_DE441 (was SE_TIDAL_DE431) and SE_TIDAL_STEPHENSON_2020 is new.
- With SEFLG_HELCTR the second light-time pass uses the heliocentric distance (upstream 8178d0ac;
upstream's figures: Mars in 2016 by 21 mas, Mercury up to 0.84 arcseconds).
- swe_calc chooses the ephemeris file by the date of the call, so results at file boundaries no
longer depend on call history (upstream 79d3553f, 85eb3a5d). When the light-time point falls
outside the JPL file, the Moon falls back to Moshier.
- The Chiron, Pholus, interpolated-apsides and file-limit messages now give the JD and the calendar
date, for example "Chiron not available at JD 1967600.5 = 31.12.0674j; restricted to JD
1967601.5 = 01.01.0675j - JD 3419437.5 = 01.01.4650". swetest -lim prints JD and -fT dates and
shows the errors of the interpolated apsides.
- swe_set_astro_models("") selects the current version's models. SEFLG_JPLHOR without the JPL file
returns a warning in serr. load_dpsi_deps reads the EOP dpsi column at the corrected offsets and
swe_close resets the EOP state. Upstream's sepl, semo and seas files were regenerated on DE441;
take the v2.10.04 files if you rely on the ephemeris data.
- Port fix: swed is now cleared in place on first initialisation, as sweph.c:1257 does. On a fresh
SwissEph, swe_get_astro_models("SE2.06") listed the default models where the C gives "-amod5,...",
and swe_nod_aps returned wrong apsides for some bodies and dates (Sun MEAN at JD 1000000:
perihelion 215.299, the C gives 302.338). This predates the sync.
- Also in this release, merged since 2.10.3.3: read_const no longer drops leading digits of an
asteroid's name beyond the C's prefix scan; the SEFLG_SIDEREAL Moshier-fallback warning is no
longer erased by plaus_iflag; a planet file opened as an asteroid file returns an error instead
of throwing; a seorbel.txt line with a trailing comma is accepted; swetest strcat slips,
FormatToDegreeMinuteSecond rounding, C.sprintf signs and non-finite values, non-seekable file
streams, and double-to-int conversions on .NET 9 and later are fixed; fixed-star loading is
faster. See CHANGELOG.md for each.
- The upstream pin moves from 43c9fe54 to the tag v2.10.04 (e308765d10b9463ab0ed53b102ad454820ee0b43),
the first upstream tag since v2.10.3bfinal. SE_VERSION is "2.10.04".
- Verification against the MSVC-built C at e308765d: both oracle grids are bit-identical (27,437
analytic and 3,376 file rows) with empty known-diff lists; 251 of 268 swetest cases are
byte-identical and the other 17 differ only by the directory separator and -nan(ind). The
conformance corpus is now 11 suites and 18,919 iterations; known-fail.tsv has 1,401 rows (all
VALUE-MISMATCH, down from 2,395; the harness no longer skips iterations for want of data and the
DATA-MISSING category is gone), and all 1,401 are triaged against the C as drift, none a port
defect; each is also pinned field by field in known-fail-pins.tsv. The 972 house-speed rows of 2.10.3.3 pass against
the regenerated t.exp.
- Known issues: v2.10.04's dt[] has 69.2093 for 2023 where USNO's deltat.data has 69.2039, and the
prediction 69.05 for 2026.0 where the measured value is 69.1099; the port keeps the C's values and
a correction is being prepared for upstream. Upstream's setest harness (not the library)
declares undersized arrays in suite_09_rise.c and aborts under gcc's stack protector at 9.2.9.
See docs/known-issues.md.
2.10.3.3:
- House cusp speeds are now analytic for every house system. swe_houses_ex2 and
swe_houses_armc_ex2 (and the older entry points that forward to them) previously used a
finite-difference interpolation that returned values in the millions of degrees per day near the
Ascendant's horizon tangency (ARMC 90 and 270); it now runs only as a fallback when an analytic
result is not finite. This is the eleven-patch house cusp-speed set that Timothy van der Ham
reported to the Swiss Ephemeris mailing list in August 2026 and that Astrodienst applied
upstream in commit 6c989727. Behaviour change for callers that read cusp or ascmc speeds. By
system: P and G implicit function theorem; K chain rule through the MC (the old value was up to
39% high at latitude 60); O cusps 11 and 12 from the MC speed instead of the Ascendant speed
(34-38% shift); L, S and Q chain rule through the quadrant; X, M, F, B, U and Y closed form; I
and i closed form with the Sun's declination held fixed (the omitted term reaches about 0.14
degrees per day at latitude 35 and 0.6 at 52); W and N speeds are 0.
- Sidereal house speeds now account for the ayanamsa's rate: in the traditional sidereal mode it
is subtracted from cusp and ascmc speeds (not from the ARMC, ascmc[2], and not from W and N cusps).
Measured with swetest -b1.1.2000 -ut12:00 -house13.4,52.5,P -speed -sid1 -p0, the Ascendant
moves at 600°43'39.3962 per day against 600°43'39.5410 tropical, 0.1448" less. With whole-sign
houses every cusp speed is 0. ECL_T0 and SSY_PLANE modes subtract their auxiliary frame's rates
(about 4e-5 degrees per day).
- SEFLG_RADIANS: house speeds are now converted to radians per day as well (they were left in
degrees per day beside positions in radians).
- Three house position fixes: Y (APC) uses sin(kv) instead of the dasc round trip, so within 1e-10
degrees of the equator cusps 1 and 7 are the Ascendant and Descendant (latitude 5e-11, ARMC 242:
cusp 1 was 303.139, now 329.906); i (Makransky Sunshine) fixes w == 180 exactly and southern
w == 90 or 270, and returns no cusp of exactly 360; G (Gauquelin) in the polar Porphyry
fallback returns 0 for cusps 13 to 36 and their speeds (uninitialised in the C). I (Sunshine)
declination error path returns ERR with all output arrays zeroed. swe_house_pos is unchanged.
- ECL_T0 sidereal modes near the mode's epoch t0: the frame rate is taken on tjde's side of t0
when a central difference would straddle it (upstream 0c3eb56e). The cusps jump at t0 by twice
the nutation in longitude, as in every earlier release; the first version of the frame-rate
code (6c989727, never part of a SwissEphNet release) differenced across that jump and was off
by up to 0.04 degrees per day within 0.1 day of t0. Measured for swetest -b1.1.2000 -ut12:00
-house13.4,52.5,P -speed -sid18, the Ascendant's speed is 600°43'39.6898 against 600°43'39.5410
tropical: the 0.149" difference is the frame term. The position jump at t0 is unchanged;
SE_SIDBIT_SSY_PLANE is not affected.
- swe_calc on an asteroid (or other) ephemeris file at exactly the file's last date returned
garbage: get_new_segment() took the index entry after the last segment. It now uses the last
segment (upstream 43c9fe54; the port had the identical bug). Astraea (se00005s.se1) at exactly
JD 2488932.5 came out at longitude 126.0072799, distance 3.648274082 au instead of 66.9437422
and 3.288141871. It shows only when the last date is the first one evaluated, because an
earlier date in the last segment caches that segment. New test AsteroidFileUpperLimitTest
matches the MSVC-built C at 43c9fe54 bit for bit.
- swe_houses_armc_ex2 no longer raises SwissEph.OnTrace messages. Upstream removed the TRACE
blocks from swehouse.c (6318ad4c); TRACE is defined by default in the .NET build, so the port's
swe_houses_armc_ex2 raised them. Other OnTrace sources are unchanged.
- swe_get_planet_name now looks numbered asteroids up in seasnam.txt by binary search, which is
faster; results are the same for a sorted file, and an unsorted file falls back to the full
scan (sweph.c:6954, :6968).
- Programs/SweTest: -astpos now passes the ephemeris time te to print_asteroids (swetest.c:1613;
the port had passed tjd since 2.10.3.2), and swe_get_planet_name is called only when the name is
printed. This affects the SweTest program, not the library API.
- Swiss Ephemeris Professional License: the contract PDF was updated on 9 November 2026 ("Edition
September 2026 update 9 Nov 2026",
https://github.com/aloistr/swisseph/blob/6c9897279736b76e81f0b0039d05283a9ba59dc5/doc/secont_e_2609.pdf).
The one substantive change is a new clause 13, "Use of language bindings and ports": every
binding or port must honour the dual licensing (AGPL and Astrodienst's professional license),
authors of bindings and ports may charge no extra fees, and Astrodienst lists the bindings it
knows meet this. SwissEphNet is not in that list. SwissEphNet is already offered under both
the AGPL-3.0 and the Professional License, as the README says, and this repository's LICENSE is
unchanged. If you hold or plan to buy a Professional License, check the current contract with
Astrodienst.
- The upstream pin moves from 94621aba to 43c9fe54 (upstream master), which is v2.10.3bfinal plus
25 commits; no newer tag exists. SE_VERSION is still "2.10.03". 94621aba..43c9fe54 touches
swehouse.c, sweph.c, swetest.c, ephe/seasnam.txt, ephe/seorbel.txt, ephe/astlistn.md, the
contract PDF and bin/swetest (a prebuilt binary, nothing to port); the first three are ported
above.
- Verification: the port is bit-exact against the MSVC-built C at 43c9fe54 on the oracle grids
(27,437 analytic and 3,376 file rows). The characterization baseline was regenerated
deliberately for the house-speed set, and passes unchanged at 43c9fe54. known-fail.tsv grows from 1,423 to 2,395
rows, unchanged at 43c9fe54; the 972 new rows are setest 6.8 and 6.9 speed fields where t.exp's
own values differ from the C's (positions unchanged), each with per-row evidence in docs and
tests, not port defects. Unit tests: 354 of 354. No API change. See docs/known-issues.md for the detail.
- #47 added a DATA-MISSING triage file, XML documentation for the SE_SIDM_* constants, and
docs/sidereal-and-vedic.md; no code change.
2.10.3.1:
- Full XML documentation (<summary>, <param>, <returns>) added for all 116
public swe_* methods in SwissEphNet/SwissEph.swephexp.h.cs, plus the SEFLG_*/SE_*/SEMOD_*
constants they reference. Purely additive: no signature or behavior changed, and
SwissEphNet/CPort/ is untouched. IntelliSense now shows the same documentation a C caller
gets from swephexp.h instead of nothing (CS1591 is suppressed repo-wide, so this gap was
previously silent).
- Programs/SweTest: fixed insert_gap_string_for_tabs's LEN_SOUT bound. It now counts bytes the
way the C's strlen does, using native single-byte semantics on Windows (the narrow-argv code
page) and UTF-8 elsewhere, instead of counting UTF-16 characters. Accented -g gap values no
longer stop tab substitution one byte early. This affects the SweTest program's console
output, not the SwissEphSharp library API.
- swe_houses_ex2 now re-reads sid_data after its SE_SIDM_FAGAN_BRADLEY fallback, matching the
C's pointer semantics (swehouse.c:221). No input reachable through the public API changes
value from this today; it closes an audited fidelity gap rather than fixing an observed bug.
- Test coverage: BaselineMatrix now exercises 7 more of the library's 107 public entry points,
all 100% EXACT on both TFMs. A new NutationTableFidelityTest value-diffs the nutation
coefficient table against upstream source instead of only checking its length.
- CI gained macOS legs on the baseline and conformance gates (report-only).
- No breaking changes. See docs/known-issues.md and docs/compliance-2.10.04.md for the
verification detail behind this release.
2.10.3 (the first release published to nuget.org, under the SwissEphSharp
package ID):
- LICENSE CHANGE, read this before upgrading. 2.8.0.2 was distributed under the GNU General
Public License version 2 or later. This release is under the Swiss Ephemeris dual license:
the GNU Affero General Public License, or a Swiss Ephemeris Professional License bought from
Astrodienst. The practical difference is the AGPL's network clause. Under GPL-2.0 you could
run this library inside a web service and owe nobody source, because nothing was distributed.
Under the AGPL, operating the service is itself the trigger, and users who reach it over a
network can require the complete corresponding source of your whole service, not just this
library. If that does not work for your project, the Professional License is the other arm.
This follows Astrodienst's own relicensing of Swiss Ephemeris and applies to the C library
just as much as to this port. LICENSE, agpl-3.0.txt and NOTICE ship at the package root.
- SE_VERSION now reports "2.10.03", matching the C library this port tracks (upstream tag
v2.10.3bfinal). Every stage of the 2.10.03 delta has landed: the header/constants stage,
swephlib.c, the ayanamsha machinery, sweph.c, swecl.c, swehouse.c and swetest.c.
- swe_houses, swe_houses_ex, swe_houses_armc, swe_house_pos and swe_house_name each gained an
int hsys overload alongside the existing char hsys overload, matching upstream swephexp.h.
- New API surface: swe_houses_ex2, swe_houses_armc_ex2, swe_calc_pctr, swe_get_current_file_data.
- swe_lun_occult_when_glob and swe_lun_occult_when_loc each gained an Int32 backward overload, so
SE_ECL_ONE_TRY can be OR-ed into that bitfield the way swephexp.h declares. The existing bool
overload is unchanged and still binds; it can only pass 0 or 1, so it can never request the
flag. Reflection that resolves either method by name alone now throws AmbiguousMatchException.
- OnLoadFile is gone; ephemeris files are read from disk by default through the new
SwissEph.FileProvider (IEphemerisFileProvider).
- The assembly is now named SwissEphSharp (was SwissEphNet), so this package can coexist in one
dependency graph with the original SwissEphNet 2.8.0.2 instead of silently colliding with it at
build time and crashing at runtime. The namespace stays SwissEphNet.
- 2.10.3 is the only release that ships netstandard2.0, not the last of several. 2.8.0.2 shipped
net40 and netstandard1.0 and never carried netstandard2.0, and net8.0 or later will be required
from the next release on, so the window in which this library is reachable from .NET Framework
is this one version. Consumers on .NET Framework 4.6.1+ can take 2.10.3 and should pin to it
deliberately rather than expect it to persist. netstandard2.0 is a compatibility target,
not a correctness one: measured on .NET Framework 4.8 and 4.6.2 against .NET 10, the same
asset's swe_calc differs on 29 of 102 calls (34 bodies x 3 epochs; worst case SE_ADMETOS
latitude speed, 2.28e-3 relative -- an absolute divergence of 1.4e-08 deg/day against a base
value of about -6.1e-06), while net8.0 and net10.0 agree on all 102. The cause is .NET
Framework's less accurate Math.Sin/Math.Cos/Math.Tan near quarter-turn boundaries, not this
port; see the "V:2.10.3" section of README.md for the full measurement.
- Numerous port bug fixes surfaced by the 2.10.03 work, several of them upstream C bugs Astrodienst
fixed between 2.08 and 2.10.03 that this port now also carries: swe_nod_aps/swe_nod_aps_ut
returning all-zero nodes and apsides, an obliquity read that affected every SEFLG_SWIEPH
position, eclipse magnitude and obscuration off by a factor of 100, and the swe_house_pos buffer
that was one element short for Gauquelin houses. See docs/compliance-2.10.04.md for the
verification numbers behind this release and docs/known-issues.md and the "V:2.10.3" section
of README.md for the full list.
- You are also inheriting everything in CHANGELOG.md's 2.8.1.0 entry, even though no such
package was ever published. On nuget.org the step is 2.8.0.2 straight to this release, so
those changes arrive with it: DIR_GLUE went from '\' to '/' on every platform, which changes
the asteroid file names a file provider is asked for; DefaultEncoding became UTF-8 explicitly
rather than falling back to it when Windows-1252 could not be resolved; and C.strcmp,
strncmp, strstr and strchr became ordinal instead of culture-sensitive, which affects
fixed-star name search and sort under a non-invariant culture.
Full history, back to the 2.08 upgrade: CHANGELOG.md at
https://github.com/Tim81/SwissEphNet/blob/main/CHANGELOG.md.