A Python package for speed-based calculation of F-ZERO GX.
Project description
Gxscalc
This is a Python package for speed-based calculation of F-ZERO GX.
Requirements
This package requires pandas. Also, speed data files created by my AviUtl plugin are required as input.
Installation
Gxscalc is available on PyPI:
$ pip install gxscalc
Usage
from gxscalc import mtp
mtp('./sample/sa70_on.txt', './sample/sa70_off.txt') #=> (1224.330134264905, -2.4656191600475066)
gxscalc.mtp(on, off, *, std=5, rng=10)
Calculate the approximated MT point from two speed data files of deceleration. The accuracy compared to Naegleria's spreadsheet is within about 3 km/h.
on
: str- File path of speed data for deceleration while going on the accelerator.
off
: str- File path of speed data for deceleration while going off the accelerator.
std
: numeric- Standard deviation of gaussian window for moving average.
rng
: numeric- Values farther than
std*rng
will not be used for moving average. - returns: (float, float)
- Returns the tuple of (MT point [km/h], Acceleration at MT point [km/h/f]).
gxscalc.distance(file, fps=60)
Calculate the approximated travelled distance of given speed data file via trapezoidal rule. The unit of input speed is km/h and the unit of output length is m. Note that, frames per real-second is 59.94 (except PAL version), but frames per in-game-second is 60.
file
: str- File path of speed data to be calculated.
fps
: numeric- The reciprocal of time between the adjacent speed values, in seconds.
- returns: float
- Returns the travelled distance in meter.
Notice
The input speed data files are assumed to be created by my AviUtl plugin. The files should include frame numbers and separators should be spaces (default settings of the plugin). './sample/sa70_on.txt' and './sample/sa70_off.txt' are sample input files, which are data of Space Angler at 70%.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/cycloawaodorin/gxscalc.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.