Is phasecurvefit right for my data?

Is phasecurvefit right for my data?#

phasecurvefit fits when three things hold. You have many samples. Each sample has a position and a velocity, given as dictionaries of arrays with the same keys. And the samples lie along one curve whose order you don’t know. The tables below match what you have and what you want to the call to use and the page to read.

What you have#

You have

Use

Read more

positions and velocities along a curve, and no known start point

pcf.order(pos, vel), the default pipeline

Quick start, Ordering a Mock Stream with the MST Backbone

a known start point, such as a stream’s progenitor

LocalFlowOrderer with start_idx, and direction="both" if the curve flows away from it both ways

Use the local-flow walk, Learning a Stream with an Autoencoder

a curve that crosses itself

once: the default pipeline, whose MST weighs edges by velocity and crosses straight over. Many times: LocalFlowOrderer, or MSTOrderer with sever_cos_threshold.

Choose an orderer, Learning an Epitrochoid with an Autoencoder, Ordering a Self-Intersecting Epitrochoid with the MST Backbone

samples with some missing velocities (NaN)

the default pipeline, which joins a sample with a missing velocity by position alone and skips it when orienting the ordering

Prepare your data

unxt Quantities with physical units

any orderer, with metadata=pcf.StateMetadata(usys=...)

Use physical units

a dataset where background points mix with the curve

an MST with edge_clip_sigma, then the mixture membership model

Reject outliers with the mixture model, Outlier rejection with mixture-model membership

an ordering to run inside jit, vmap or grad

any orderer, the default pipeline included, except the ones that run on the host: RidgeOrderer and MSTOrderer(neighbors=SciPy())

Compile, batch and differentiate with JAX

What you want#

You want

phasecurvefit gives

Read more

the order of the samples along the curve

result.ordering, or pcf.order_w(result) for the reordered arrays

Quick start, The ordering result

an ordering coordinate \(\gamma\) for every sample

fitted.gamma from fit_track() or train_autoencoder()

Fill gaps and fit a track with the autoencoder

a smooth mean track \(x(\gamma)\)

calling the fitted result, fitted(gamma)

Fill gaps and fit a track with the autoencoder, Interpolate positions along an ordering

a track fast enough for every step of an MCMC

RunningMeanDecoder, which needs no training

Learning a Stream with a Running Mean

a probability that each sample belongs to the curve

fitted.membership_prob, or posterior_membership() with the mixture model

Reject outliers with the mixture model

positions at given values of \(\gamma\) from an ordering alone

calling the ordering result, result(gamma)

Interpolate positions along an ordering

What phasecurvefit does not do#

  • Each call orders one curve. The default pipeline joins disconnected pieces into one ordering, so separate distinct streams in a catalogue before you order them.

  • It does not model the dynamics. The track is a smooth curve through the data in phase space, and phasecurvefit fits no orbit, potential or progenitor.

  • The local-flow walk does not choose its own start point. Chaining an MSTOrderer in front of it supplies an end of the curve (Chain orderers).