Skip to content

Conversation

@wei-lingfeng
Copy link
Collaborator

@wei-lingfeng wei-lingfeng commented Dec 22, 2025

Major changes are:

  • Updated the strategy of choosing motion models:
    • Select the motion models among the given lists with no fewer observed epochs than the number of fit parameters, i.e., n_obs >= n_param. By default, motion_models=[Empty, Fixed, Linear] in StarTable.fit_motion_model. Empty and Fixed are always added.
    • When 'motion_model_input' column is specified, MotionModel will automatically downgrade the given ones if there are not enough observed points, until n_obs >= n_param. Empty and Fixed are always added.
  • Removed any MotionModel metadata and changed them into fixed_params, so initialization parameters are no longer needed.
    • default_motion_model is now removed, as the actually used motion model is determined by the number of available epochs to fit and the list of provided models in motion_models.
    • motion_model_dict is now removed, and all the model-related parameters go into fixed_params_dict.
    • t0 is now optional and will be calculated as np.average(t, weights=1./np.hypot(xe, ye)) if not provided.
  • Merged get_star_position_at_time and get_batch_star_positions into MotionModel.model, which is now fully vectorized and returns positions and uncertainties in shapes of (N_stars, N_times), or (N_stars,) when N_times=1, or (N_times,) when N_stars=1.
  • Accelerated StarTable.fit_motion_model significantly for n_epochs < 300! Now achieving > 10,000 iterations per second for 5 epochs!

Name Changes:

  • MotionModel.fit_motion_model -> MotionModel.fit
  • StarTable.fit_velocities -> StarTable.fit_motion_model
  • MotionModel.get_star_position_at_time / get_batch_star_positions -> MotionModel.model

wei-lingfeng and others added 30 commits September 9, 2025 20:10
Update data fitting logic: Compare observed data points with model parameters. If n_obs < n_params, return fill value for the parameters and infinity for the uncertainties; Otherwise, calculate parameters normally. If n_obs = n_params and absolute_sigma=False, return infinity for uncertainties (Same behavior as scipy curve fit).
…motion models. Update fitting logic: Provide multiple motion models, use the available model with the most number of parameters to fit according to the observed data points (i.e., choose the model with n_obs >= n_params). Removed motion_model_input and default_motion_model for clarity.
…atch_pos at_time into model; Renamed get_ functions into calc_ functions
… and get_batch_pos_at_time into model; Replaced MotionModel.fit_motion_model with MotionModel.fit; Rewrote and accelerated StarTable.fit_velocities with StarTable.fit_motion_model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant