Changelog¶
0.5.0 — 2026-11-29¶
Changes marked Breaking require changes to code or builds that worked with 0.4.
Added¶
otswap/Version.h, generated by CMake from the project version and installed with the headers:OTSWAP_VERSIONandOTSWAP_VERSION_MAJOR,_MINOR,_PATCH; and Pythonotswap.__version__, the same string. Both are new public forms.Result.from_arrays(geometry="lightcone_cartesian", angle_unit=...)builds a Cartesian lightcone result withouttracers_sky, which it computes fromtracersasreconstruct_lightcone_cartesiandoes (the redshift fromdistanceswhen given, NaN otherwise);distancesis optional.
Changed¶
Breaking (CMake): requires meshsearch 1.0.0 or a later 1.x, was 0.3.0 or a later 0.3.x; v1.0.0 is fetched when none is installed.
Breaking (CMake): the CMake package answers requests for 0.5 (
find_package(otswap 0.5 CONFIG)); a request for 0.4,find_package(otswap 0.4 CONFIG), does not find 0.5.0.The configuration fails, with otswap’s own message, when the meshsearch found is the CMake package of meshsearch’s Python wheel (a target built in the project) and
OTSWAP_INSTALLis ON, as the install could not export it.OTSWAP_INSTALL=OFFand wheel builds are unaffected.Breaking (C++, Python modules sharing the types):
Geometry::Lightconeis replaced byGeometry::LightconeSky(the sky reconstruction) andGeometry::LightconeCartesian(the Cartesian one); a module or program built against 0.4 must be rebuilt.Breaking (Python):
Result.geometryandRealSpaceCatalog.geometryreturn"lightcone_sky"or"lightcone_cartesian", no longer"lightcone".Breaking (files): the
GEOMETRYkeyword holdsbox,lightcone_skyorlightcone_cartesian; files withlightconeare read aslightcone_sky. Columns and other keywords are unchanged. A lightcone file of 0.4 or earlier, sky or Cartesian, reads aslightcone_sky. The executable’sgeometrykey still takesboxorlightcone; its files recordlightcone_skyorlightcone_cartesianaccording tolightcone_input.Breaking (Python):
io.read_displacement_completeandio.read_displacement_meantakeangle_unitonly for a lightcone file: a box file read withangle_unitraisesotswap.Error, and a lightcone file without it raises too.Breaking (Python):
Result.from_arraystakes a required keywordgeometry=,"box","lightcone_sky"or"lightcone_cartesian", and no longer infers it fromtracers_sky; every call must add it. A boxgeometryrefusestracers_sky,angle_unitanddistances; a lightcone one refusesoutside_box,periodicandbox.A Cartesian lightcone result without a distance table or profile now has
lagrangian_skyandlagrangian_distance(right ascension and declination, NaN redshift), as its reconstruction has, and its complete and mean files keep theoutsideDistanceCutcolumn. No result of a reconstruction changes.
Build and documentation¶
meshsearch >= 1.0, < 2is a build requirement of the Python package, so a build from the sdist takes meshsearch from its wheel and fetches nothing. It is not a runtime dependency. meshsearch’s wheel needs NumPy, so the build environment installs it too.The subproject consumer test also checks that otswap’s
test_parameter_fileandtest_periodic, and meshsearch 1.0’s tests, examples and Python module, are not built.Continuous integration checks that the configuration with the CMake package of meshsearch’s wheel and
OTSWAP_INSTALL=ONfails with otswap’s message, and configures withOFF.
0.4.0 — 2026-11-26¶
Changes marked Breaking require changes to code or builds that worked with 0.3.
Added¶
Periodic boxes.
reconstructBoxtakesperiodicafter the limits (Pythonreconstruct_box(..., periodic=True)), which it then requires; each side must be an integer multiple of the shortest, within a relative 1e-12. Distances are minimum-image; tracers and given randoms outside the limits are wrapped into them by whole periods instead of being left out;Result::tracersholds the wrapped tracers, each displacement is the minimum-image vector, in [−L/2, L/2) per axis within rounding, andlagrangianis wrapped into the box. A computed mps is (V/N)^(1/3), V the volume of the limits and N the number of tracers given, all of which are kept.Result::periodic(Result.periodic) records the flag;SelectionCountsgainsperiodic,tracersWrappedandrandomsWrapped(tracers_wrapped,randoms_wrapped), reported at Normal as “wrapped oftracers into the periodic box …”. Result.from_arraystakesperiodic=andbox=;box=alone records the limits of a box result that is not periodic.Result::cellSide(Result.cell_side): the cell side of the neighbour grids actually used, in coordinate units. In a periodic box it can be smaller thancellSizetimes the mps, since the cells divide the shortest side a whole number of times; the error for a grid too large to address covers that reduced side. Not written to files; NaN, None in Python, for a result not made by a reconstruction.Examples
periodic_box, a reconstruction and correction of halos in redshift space in a periodic box, andlightcone_cartesian, which also finds each tracer’s distance and direction withpointToSkyand measures the mps profile alone, in C++ and Python, andexamples/executable/periodic_box.ini; the dataperiodic_halos.dat, real- and redshift-space positions.Periodic correction of redshift-space distortions:
realSpaceBox(real_space_box) of a periodic result finds the neighbours across the faces and wraps the corrected coordinate into the box.neighbourAveragegains an overload with the box and the flag (Pythonneighbour_averagewithbox=andperiodic=True).shiftAlongAxisstill does not wrap.Lightcones in comoving Cartesian coordinates, the observer at the origin, without a cosmology:
reconstructLightcone(tracers, randoms, skyAreaDeg2 or mask, nBins, config, distances = nullptr, cut = {})and the two matchingmeasureMpsProfileoverloads (Pythonreconstruct_lightcone_cartesian,measure_mps_profile_cartesian). The mps is measured in bins of comoving distance from the origin, a profile in distance (MpsProfile::distance,distanceMin,distanceMax; Pythondistance,distance_min,distance_max); the mask is applied on the angles ofpointToSky. The optional distance table plays no part in the reconstruction: it fills the redshifts oftracersSkyandlagrangianSky, NaN without it, and is kept in the result.Result::lagrangianDistance(lagrangian_distance) holds the distance of each mean Lagrangian position.DistanceCut(PythonDistanceCut, keyworddistance_cut, or a pair(min, max)), the cut in comoving distance of the Cartesian overloads. Tracers outside it keep their row, flagged inResult::outsideDistanceCut(outside_distance_cut);SelectionCountsgainsdistanceCut,tracersOutsideDistanceCutandrandomsOutsideDistanceCut(distance_cut,tracers_outside_distance_cut,randoms_outside_distance_cut).Result.from_arraystakesoutside_distance_cut=.realSpaceLightcone(real_space_lightcone) corrects the result of a Cartesian overload: a tracer’s redshift is read fromtracersSkywhen it is not NaN, and otherwise derived from its distance with the distance table given. Results of the sky overloads are unchanged.pointToSky(Pythonpoint_to_sky): the distance, right ascension and declination of a Cartesian point, without a distance table; the geometric part oftoSky, bit for bit.Files. The displacement files write
PERIODIC = 1for a periodic box, with the box keywords at full precision in ASCII too, and the countsNTRWRAPandNRNWRAP; for a lightcone given in Cartesian coordinates, the columnoutsideDistanceCut(in theSelectiongroup of the mean file and last in the complete file), the keywordsDCUTMIN,DCUTMAX,NTRDCUTandNRNDCUT, and a profile in distance: the columndistancein place ofredshift, the keywordsDISTMINandDISTMAXin place ofZMINandZMAX, also inwriteMpsProfile. Without a distance table noDISTANCEpart is written. The readers read all of these back, and the files of otswap 0.3 as before.The executable takes four new keys, 45 in all:
periodicfor a box,lightcone_input(skyorcartesian) for a lightcone, andd_min,d_max, the distance cut of a Cartesian lightcone. Withlightcone_input = cartesianthe cosmology is optional unlessperform_reconsis set.examples/executable/lightcone_cartesian.iniruns the lightcone example on its catalogues converted to Cartesian coordinates, whichexamples/data/now holds.
Changed¶
Breaking (CMake): requires meshsearch 0.3.0 or a later 0.3.x, was 0.2.1 or a later 0.2.x; v0.3.0 is fetched when none is installed.
Breaking (C++, Python modules sharing the types): the layouts of
Result,SelectionCountsandMpsProfilegain the fields above. A nanobind module or a program built against the headers of 0.3 must be rebuilt.Breaking (CMake): the CMake package answers requests for 0.4 (
find_package(otswap 0.4 CONFIG)); a request for 0.3,find_package(otswap 0.3 CONFIG), does not find 0.4.0.Breaking (Python):
MpsProfile.attakesvalue, a redshift or a distance as the profile is: code that calledat(z=...)must callat(value)orat(value=...); positional calls are unaffected. In C++ only the parameter name ofMpsProfile::atchanged.atraises when a profile holds both redshift and distance nodes.Config::cellSize(cell_size) defaults to 3, was 4, and the executable’smesh_cellsizewith it. The cell size changes the speed only: results are unchanged. The files of a run with the default now recordCELLSIZE = 3.CorrectionStatus::LeftOut(LEFT_OUT) also covers the tracers left out by the distance cut.The displacement writers refuse a periodic result whose flags are not consistent (not a box, no limits, a tracer flagged outside the box, or
selection.periodicdifferent fromperiodic);writeMpsProfilerefuses a profile holding both redshift and distance nodes.writeDisplacementMeanin ASCII rounds the box keywordsBOXXLOtoBOXZHIof any box that is not periodic, given by limits or taken from the tracers, outward to the 9 significant digits of the coordinates, so the tracers as written lie within the limits as written. FITS files, periodic boxes and the complete file keep the limits exactly. The values of these keywords in ASCII mean files may differ from those of 0.3 in the last digit.uniformIntis defined inline inotswap/Random.h; its values are unchanged.The error for a redshift outside the distance table names the tracer or random and its row in the input arrays; from
measureMpsProfile, which takes no randoms, it says the redshifts of the tracers kept must lie in the table. The correction of a Cartesian lightcone result raises, naming the tracer, when its distance lies outside the table, and suggests a table of wider range.The examples
box,lightcone,full_recons_boxandfull_recons_lightconerun every feature they present, withcell_size = 3: the box example gives the box limits, so its output differs from that of 0.3, keeps every realization in a file with IDs and reads it back; the lightcone example measures the mps profile alone and reads the mean file back. Their parameter files inexamples/executable/setperiodicorlightcone_input.Messages say “catalogue”, where some said “catalog”.
Removed¶
Breaking (C++, Python): the overloads of
reconstructLightconethat took both Cartesian and sky arrays (C++), and thetracers=andrandoms=arguments of Pythonreconstruct_lightcone, which called them. Arrays made withtoCartesianand the same distance table gave the result of the sky overload, which takes their place; for Cartesian coordinates without sky ones, use the new Cartesian overloads.
Build and documentation¶
The package metadata lists classifiers: Python 3.10 to 3.14, Linux and macOS, astronomy and physics. The supported Python versions are unchanged.
Continuous integration builds and tests the Python package in a clean environment with Python 3.10, 3.12 and 3.14, on Linux and macOS.
tools/wheels/build_deps.shdownloads zlib from zlib.net, then its fossils directory, then GitHub, with the same SHA-256.The guide gives a numbered path of steps for each geometry (box, periodic box, lightcone on the sky, lightcone in Cartesian coordinates), each linking its example, and sections on the distance table, the inputs of the redshift-space correction, and files. It states that a
Resultmust not be read from one thread while another modifies it in place.A new page, “Using otswap from another package”, gathers the use of the library from CMake, the sharing of the Python types with another nanobind module and the loading of the same OpenMP runtime, formerly on the pages of names and of the Python reference.
The Python reference lists the members of each class in the order of the stubs, and
BoxLimitsunder “Configuration”.The method page writes the redshift-space correction with the mean displacement D = −Ψ_OT and the line of sight l̂, as
otswap/RSD.hand the module docstring do, and describes the first guess and the box as implemented. It cites the equations of Sartori et al. (2026) by their numbers in arXiv:2601.15378v1, and describes the neighbour average in a periodic box, with weights and with σ = 0.Each path of the guide ends with the redshift-space correction, linking its example, and sets the cut before the choice of the bins.
0.3.0 — 2026-11-05¶
Added¶
The header
otswap/Random.h:otswap::uniformInt,uniformRealandshuffle, random draws overstd::mt19937that give the same values on every supported platform and compiler. Their algorithms are fixed: later versions do not change them.uniformRealrefuses a bound that is not finite, a lower bound not below the upper one, or an infinite width, andshufflemore than 2^32 − 1 elements, each withotswap::Error.io::readDisplacementMean(Pythonio.read_displacement_mean) reads a mean displacement file, of this version or of otswap 0.2, into aResultof one realization holding the mean, with the counts of valid realizations and the number of realizations averaged.Result::nRealizationsMean(PythonResult.n_realizations_mean), the number of realizations averaged into a mean read from file; 1 otherwise. The displacement writers record a value above 1 as the new keyword NRECMEAN, with NREC = 1, and refuse 0, or a value above 1 with several realizations.validRealizationsis then the count of the realizations averaged that were valid, always at most nRealizations x nRealizationsMean;rejectMaskCrossingson such a result sets it to 0 for the objects it rejects and keeps it for the others.readDisplacementCompletereads NRECMEAN back, 1 when the file has none.io::columnNames(Pythonio.column_names): the names of the columns of a table, thoseio::readfinds.The mean displacement file of a lightcone holds the mps(z) profile and the distance table, as the complete file does: FITS extensions MPSPROF and DISTANCE, or ASCII twin files
.mpsand.distances, each with its own PRODUCT, and the keywords MPSPART and DISTPART.writeDisplacementMean(Pythonwrite_displacement_mean) takeslightconeTables(lightcone_tables), true by default, to leave them out.otswap.openmp_root(): the directory of the OpenMP runtime a macOS wheel ships,otswap/openmp/(lib/libomp.dylibwith install name@rpath/libomp.dylib,include/omp.h,include/ompx.h, LLVM’sLICENSE.TXT), or None. A package with OpenMP code of its own links that file and loads the same runtime as otswap; “Linking the same OpenMP runtime” in the Python reference says how.
Changed¶
rejectMaskCrossings(Pythonreject_mask_crossings), and the filter ofreconstructLightconewith a mask, judge a displacement by the longest run of unobserved pixels its arc crosses one after another, no longer by the number of distinct unobserved pixels:maxUnobservedPixelsCrossed(max_unobserved_pixels_crossed, keywords CFMAXPIX and MAXPIXCR) is the longest run tolerated. An arc crossing several small holes, each within the threshold, is now kept. Results change for thresholds above 0; with 0, the default, they are unchanged. The selection report says “unobserved pixels in a row”, and the comments of CFMAXPIX and MAXPIXCR say so too, now short enough to be written whole in FITS.io::read(Pythonio.read) reads ASCII strictly: every line that is not empty or a comment is a data row, and each requested field, and the first field of each row, must be a number as a whole (decimal, hexadecimal,nan,inf,infinity). Files that read before may now be refused where a field was skipped or cut silently:NA(the columns after it shifted), glued tokens such asx12,1,5with a blank delimiter (read as two fields),4.5abc,1e, and a header line or any line of text that does not start with the comment character, now an error where it was skipped. The message names the file, the line and the field. A comment may follow blanks, tabs or the delimiter: such a line, read as data before when it held a number, is now skipped. A line starting with###is the names line, skipped as data whatever the comment character, so columns are read by name with any comment character. A carriage return ending a line is ignored.Messages count as the file shows it, and say so: an ASCII line or FITS row from 1 (“line 7 (from 1)”), a field from 1, a row
io::writeis given in memory from 0.readBiasTablenames an ASCII entry by its file line, no longer its data row, andreadDisplacementCompletenames a row by its file line or FITS row from 1, no longer from 0. The checks of coordinate arrays and of a distance table built from arrays say “(from 0)”. The executable names a repeated ID by its file line or FITS row, from 1, no longer its data row.The other messages that number something say from what too: an object, an entry or a redshift bin of an array, from 0 (“object 3 (from 0)”), in the coordinate conversions, the correction of redshift-space distortions, the checks of a
Resultand the Python arguments; a line or an element of a parameter file, from 1.io::writeandio::writeParts(Pythonio.write,io.write_parts) refuse a column description longer than 68 characters, an apostrophe counting twice, and a keyword comment longer than the room its FITS card leaves: 47 characters after a value within 20 columns, fewer after a longer one. FITS cut both silently before; ASCII files are held to the same limits. The comment of MPSREPR and the descriptions of lagrRA, lagrDec and lagrRed, of displX, displY and displZ in the complete file, and of nNeighbours, which FITS cut, are now shorter and written whole.Each line of a report is written as soon as its step finishes, the log flushed after it, no longer all of them when the call ends; the text is unchanged. A call that throws leaves the lines of the steps it finished. Python prints each line to
sys.stdoutwhile the call runs, and Ctrl+C stops a reconstruction,measure_mps_profileor a correction at its next report line withKeyboardInterrupt.rejectMaskCrossings(Pythonreject_mask_crossings) requires finite values only in the valid displacements, which it reads, so it accepts a NaN in a cleared entry, as a mean read from file holds for a tracer without valid realizations.reconstructBoxandreconstructLightconerefuse more than 2^32 − 1 tracers.The executable writes the
MPS_file ofprintMpsonly when neither displacement file is written, those files holding the profile; in ASCII it reports the twin files of the mean file too.The executable takes
key =, with no value, as leaving the key out, for the keys whose default is none:id_column,random_file(box),z_min,z_max,box_min,box_maxandmps. Every other key still needs a value. The parameter files inexamples/executable/set every key that applies to their run, defaults included, and the keys without a default askey =, instead of leaving them commented out.The macOS wheels hold libomp in
otswap/openmp/lib/, where the module finds it through its rpath, instead ofotswap/.dylibs/, so that another package can link the same file (seeopenmp_root()).The README and the citation files say that a version of otswap is included in CosmoBolognaLib, and no longer ask to cite CosmoBolognaLib.
0.2.1 — 2026-10-28¶
Added¶
io::readKeywords(Pythonio.read_keywords) reads the keywords of a table, ASCII or FITS, from the first extension or one named by EXTNAME.io::writeParts,io::readPart,io::hasPartandio::twinFile(Pythonio.write_parts,read_part,has_part,twin_file, withio.TablePart) write and read files of several tables: FITS extensions named by EXTNAME, or ASCII twin files.
Changed¶
reconstructBoxwithout box limits and with randoms given:Result::boxis now the bounding box of the tracers and the given randoms, not of the tracers alone, so every random matched to a tracer lies inside it; also when mps is given. A computed mps follows that box, so such runs give a slightly different mps, and so different displacements, than in 0.2.0. Tracers that span no volume themselves, all in one plane for example, are accepted when the given randoms do. Drawn randoms and box limits are unchanged.Lengths are documented in coordinate units, the unit of the Cartesian coordinates: that of the tracers in a box, that of the distance table in a lightcone (Mpc/h from the cosmology constructor). The files otswap writes give length columns no unit (no TUNIT, no
[Mpc/h]) and say “in coordinate units” in the comments of their length keywords; screen and error messages say “in coordinate units”. The values are unchanged.Every translation unit is compiled with
-fno-math-errnoas well as-ffp-contract=off(except with MSVC). The functions it lets the compiler inline are exact, so results are unchanged, bit for bit.
0.2.0 — 2026-10-23¶
Added¶
The
otswapexecutable: a reconstruction, and optionally its redshift-space correction, run from a parameter file, with every key and the output files on the new “The executable” page. Built and installed intobin/by a standalone build of the C++ library (OTSWAP_BUILD_EXECUTABLE, off when otswap is a subproject); not in the Python package.examples/executable/has a commented parameter file per geometry.otswap::io::ParameterFile, in the new headerotswap/ParameterFile.h: a reader ofkey = valueparameter files, with typed reads of strings, booleans, integers, doubles, characters and lists of each, errors naming the file, line and key, the line that sets a key, and the list of the keys never read. The syntax is on the “File formats” page. C++ only.The cosmology constructor of
DistanceTabledefaultsw0to -1 andwato 0, flat LCDM; Python’sDistanceTable.flatalready did.The header
otswap/Maths.h:otswap::maths::sin,cos,exp,log1p,cbrt,asin,powandatan2, which return the same bits on every supported platform and compiler, within one unit in the last place.cbrtis vendored from the same FreeBSD commit as the others. C++ only.measureMpsProfile(Python:measure_mps_profile): the mps(z) profilereconstructLightconewould use, measured from the tracers alone through the same redshift cut, mask and checks, bit for bit. In Pythonangle_unitis required.Optional box limits in
reconstructBox: aBoxLimits(Python:box=, aBoxLimitsor a(lower, upper)pair), closed on every face. Tracers outside are flagged inResult::outsideBox(outside_box) and left out, given randoms outside are dropped, and drawn randoms and the mean particle separation come from the limits.Result::box(box) records the box used, the limits or the tracers’ bounding box.SelectionCountsgainsboxLimits,tracersOutsideBoxandrandomsOutsideBox, and its report a line for each.realSpaceBoxleaves the tracers outside with statusLeftOut. The mean displacement file of a box with limits adds theOutsideBoxgroup (outside_box) to its default, 11 columns. Without limits, results are unchanged.Object IDs:
Result::idsandRealSpaceCatalog::ids(Python:Result.ids, settable and checked on assignment, andRealSpaceCatalog.ids), 64-bit integers, one per object or empty for 0..N-1.realSpaceBoxandrealSpaceLightconecopy them into the catalogue, and the writers write them as theidcolumn (see Changed). They enter no computation.Result.from_arraystakesids=.DistanceTable::redshift,distanceandgrowthRate(Python: the propertiesredshift,distanceandgrowth_rate) return the table’s arrays.The complete displacement file is self-contained. It adds, for a lightcone, the tracers’
tracRA,tracDec,tracRed(right ascension as given, not folded into [0, 360)), the mps(z) profile and the distance table; andoutsideBoxin both geometries. In FITS the profile and the table are the HDUsMPSPROFandDISTANCEafter the main tableDISPLACEMENTS; in ASCII they are twin files,run.datgivingrun.mps.datandrun.distances.dat, each with its ownPRODUCT, declared by the keywordsMPSPARTandDISTPART.lightconeTables(lightcone_tables) false leaves them out.Both displacement files record the whole configuration (
CELLSIZE,REJCROSS,CFMAXPIX,VERBOSEadded toNREC,SEED,CONVERG), the box (BOXXLOtoBOXZHI,BOXLIM) and the selection counts (NTRACtoNDISPCR, each when not 0). In FITS their main table is namedDISPLACEMENTS(EXTNAME). Both writers refuse a result whosenRealizationsandconfig.nRealizationsdiffer, or whose box limits andboxdiffer.io::readDisplacementComplete(Python:io.read_displacement_complete, with a requiredangle_unit): rebuilds theResultfrom a complete displacement file, of this version or of otswap 0.1. Every double reads back identical, NaN as NaN (with its sign and payload in FITS only), but fortracersSky, equal within the rounding of the conversion to degrees and back. In a file of otswap 0.1 theindexcolumn is read as the IDs.
Changed¶
Requires Python 3.10 or later, was 3.9: nanobind 3 does not support 3.9. No wheel is built for CPython 3.9. Building the Python package requires nanobind 3.1.0 exactly, was 2.0 or later, the version the wheels are built with.
Config::nRealizations(n_realizations) defaults to 30, was 1.Requires meshsearch 0.2.1 or a later 0.2.x; 0.2.1 is fetched when none is installed.
Tracers at exactly the same distance from a tracer, or randoms at exactly the same distance from a first-guess starter, are now ordered by ascending index. Their order used to come from the standard library, so a result could differ between compilers when distances were tied, as on a lattice. Results for inputs with exactly tied distances change on every compiler; results without ties are unchanged.
The error messages for a wrong value of a configuration field, of the number of redshift bins, of a cosmological parameter, redshift range or sample count of a distance table, or of the smoothing width sigma now describe the quantity instead of naming the C++ field or argument, so they read the same from C++ and Python.
Python: the parameters of a reconstruction are an
otswap.Config, passed asconfig=toreconstruct_boxandreconstruct_lightcone, and the options of the correction anotswap.CorrectionConfig, passed ascorrection=toreal_space_lightconeandreal_space_box; both are the C++ structs, with every field a keyword of the constructor and a read/write attribute. The keywords they replace (n_realizations,convergence,seed,cell_size,reject_crossings,max_unobserved_pixels_crossed,verbosity,weight_by_realizations) are removed.measure_mps_profilekeeps its ownverbosity,reject_mask_crossingsitsmax_unobserved_pixels_crossedandneighbour_averageitsweight_by_realizations.Python:
otswap.RedshiftCutis a class;redshift_cut=takes one, a(min, max)pair or None, andSelectionCounts.redshift_cutreturns one.BoxLimitsandRedshiftCutcompare equal by value.Python:
Result.configandResult.distancesreturn copies of the result’s configuration and distance table;Result.seedis removed, its value isResult.config.seed.Result.from_arraystakesconfig=, in place ofseed=.Python:
ResultandRealSpaceCatalogare the C++ structs too, so another nanobind module can take and return them, as it canConfig,CorrectionConfig,RedshiftCut,BoxLimits,Mask,DistanceTable,MpsProfileandBiasTable(conditions in the “Names side by side” page). One made by another module is in radians, itsangle_unit"rad"; its array properties raiseotswap.Errorwhen the C++ arrays do not have the sizes the object declares.An error of the neighbour search reaches the caller as an
otswap::Error(otswap.Error) whose message starts withmeshsearch:, the original nested in it (std::rethrow_if_nested). C++ code that caughtmeshsearch::Error, and Python code that caught theRuntimeErrorofneighbour_averageand the real-space functions, must catch it instead.rejectMaskCrossings(reject_mask_crossings) refuses a box result, one built by hand included: aResultdefaults to the box geometry, andResult.from_arrayswithouttracers_skygives one.The
indexcolumn is nowid: the object’s ID, or its row when no IDs are set, so the values are unchanged when none are. The groupsDisplacementGroup::IndexandCatalogGroup::Indexare renamedId(Python:"index"becomes"id"), with no alias: code that names them no longer compiles, and Python raisesotswap.Errorfor the unknown group. The default columns start withidonly when IDs are set, so the default files of 0.1 are unchanged.Descriptions in every file:
statusof the real-space catalogue now reads “0 corrected, 1 moved by neighbours, 2 no valid neighbour, 3 left out”, short enough for a FITS card, andNOBJECTS“number of input objects”. Values and columns are unchanged.io::writeDisplacementsandio::writeDisplacementFieldare renamedwriteDisplacementMeanandwriteDisplacementComplete(Python:write_displacement_mean,write_displacement_complete). The complete file’sPRODUCTiscomplete displacements, wasdisplacement field.
Removed¶
Result::matchedRandom(Python:Result.matched_random), the random matched to each tracer in each realization; the tracer plus its displacement gives it within rounding. A result with the default 30 realizations takes about 45% less memory.Result.from_arraysno longer takes it: its positional arguments are nowdisplacement,valid,tracers.rejectMaskCrossingstakes the arcs from the tracers (Result::tracers, which it now requires) to the tracer plus its displacement.The columns lagrX, lagrY, lagrZ of the complete displacement file, which held the matched randoms.
readDisplacementCompleteignores them in a file of otswap 0.1.
Fixed¶
Python:
io.writereports an out-of-range precision with the value given; a value above 1000 was reported as 1000.The documentation of
reconstructLightconestated the random supply rule before the selection: the randoms kept by the redshift cut and the mask must number at leastnRealizationstimes the tracers kept.
0.1.0 — 2026-10-08¶
First release.
Compared with CosmoBolognaLib’s OTreconstruction¶
The same algorithm and inputs: a local first guess, then local search that tries every permutation of the partners of four neighbouring tracers.
With a fixed seed, the result does not depend on the number of threads, and is the same bit for bit on every supported platform and compiler: the assignment of the randoms, their draw, the seeding and the swap loop each draw from their own random stream.
Every tracer is examined in every sweep.
The seeding radius (8 mean particle separations) and the number of swap neighbours (113) are named constants, not parameters.
Mask crossings: the adaptive search along the arc, with a limit on the distinct unobserved pixels crossed (0 rejects at the first), and validity kept per realization.
Cosmology enters as a table of redshift, comoving distance and growth rate, computed from a flat w0-wa cosmology or given by the caller; no GSL.
The redshift-space correction is a library function for each geometry, with its four steps also available on their own.
Table writers for every product, ASCII and FITS, with column descriptions, units and header keywords.
A Python package on the same code.