Skip to main content

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 and matplotlib. Also, speed data files created by my AviUtl plugin are required as input.

Installation

Gxscalc is available on PyPI:

$ python -m 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, return_figure=False)

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.
return_figure: boolean
If this is true, mtp() returns figure of speed vs moving averaged acceleration graph as optional output.
returns: (float, float, [matplotlib.figure.Figure, matplotlib.axes.Axes])
Returns the tuple of (MT point [km/h], Acceleration at MT point [km/h/f]). If return_figure is True, returns (MT point, Acceleration at MT point, Figure of the graph, Axes of the graph) instead. If no cross points are detected from the inputs, it returns (None, None) or (None, None, Figure, Axes) since the MT point can not be calculated.

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.

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.

Source Distribution

gxscalc-0.0.5.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gxscalc-0.0.5-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file gxscalc-0.0.5.tar.gz.

File metadata

  • Download URL: gxscalc-0.0.5.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.11

File hashes

Hashes for gxscalc-0.0.5.tar.gz
Algorithm Hash digest
SHA256 77c55110c35aa2d8a9ef5fb3c52a858c9c3de9b537f4c00b6f9d904156f6a292
MD5 c399fce10498bd38c1ad660357278f58
BLAKE2b-256 e23f5f45f29c7953c4e81d021da03d8b3bfa82e89f86b78fb86ad652a1d21e72

See more details on using hashes here.

File details

Details for the file gxscalc-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: gxscalc-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.11

File hashes

Hashes for gxscalc-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 df9ab9c7654cbc5bb8fe7daa35bc1e80176a8ba78c61ef0eeb46df010e6477dd
MD5 cf5a1cfd517054f452608ebd725df357
BLAKE2b-256 ee3151622321a494f581481bd6b7a75863a8d870777b568d1b915d5d92b0b896

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page