Name Description Size Visibility
Stephen is a professional programmer and systems tester. The python snippets here were developed in 2023-2024 but he also has experience of C and assembler for the aerospace and Comms sectors. @gmail.com
128 Bytes Public
A guide to my python (Numworks lacks folders). These all work on Numworks, some are portable.
163 Bytes Public
Astronomy: Eclipse Algorithms are based on Jean Meeus. Calculates eclipses (lunar eclipse and solar eclipse). Functions: DTm(JDE): JDE->Date-Time (rounded to minutes) eclipse(realyear,koff)->eclipse characteristics (or None) koff=0 for solar, -0.5 or 0.5 for lunar Example usage is in aeclipseuse.py (calendar). PLATFORMS: Numworks : ok BBC microbit-serial: ok Results: Itsa: eclipse type (string) DT: Date and time (minutes may be rounded) Magnitude: The fraction of diameter (note: not the obscuration, or brightnesss) 0<magnitude<1 indicates partial 1<=magnitude indicates total (but see versions). Accuracy: ~2 sig figs when valid (solar annular, total and hybrid should be disregarded). Gamma: How central the eclipse is, Accuracy ~ 3 sig figs. Angled: Several angles in degrees JDE: accurate time of peak mins: semidurations (add or subtract from peak time) time should be adjusted by deltaT (currently < 2mins) to give UTC.
176 Bytes Public
Astronomy: Eclipse V0.1 Algorithms based on Jean Meeus Calculate eclipses (solar eclipse and lunar eclipse). Call eclipse, or DTm for JDE to date. See aeclipseuse for example calls. Known bugs V0.1: “adjustdays(True “ always calculates adjustment for lunar eclipse. Workaround: “adjustdays(koff” will calculate the correct adjustment. (For the Oct 2023 solar eclipse, the mistake is less than 2 minutes) This source is at the limit for Numworks source size. Known bugs v0.1 The adjust JDE time calculation always performs the lunar eclipse adjustment, so my JDE time for solar eclipses will be incorrect. Workaround: change adjustdays(True to adjustdays(False when a solar eclipse is to be calculated V0.2 has been released which fixes that.
8.12 KB Public
Astronomy: Eclipse V0.2 Algorithms based on Meeus. See aeclipse.py for general description. V0.2 fixes a bug in my implementation of solar eclipse time, and returns results. Note: It reports a magnitude of 2.0 for the solar eclipse of October 2023, whereas online sources suggest 0.9…Initial investigation suggests that the calculation used should only apply to a partial eclipse, and a different calculation should be used for annular eclipses [or NaN until new calculation included]. I am surprised that an annular eclipse is apparently not considered a type of partial eclipse. Workaround: Until fixed, ignore magnitude when the solar eclipse is not partial. Magnitudes of partial solar eclipses are ok, but not annular, hybrid or total. (The magnitude of lunar eclipses is OK). Valid solar magnitudes are accurate to 2 sig figs. Note: To find the 2008 Feb 7 annular solar eclipse , an unusually precise date is required: Eg 2008+1.5/12 (1/12 or 2/12 will miss it). [So a smaller calendar stepsize is needed].
8.29 KB Public
Illustrates example calls to aeclipse. Calendar will show a 1-year calendar (but None for most months is not yet suppressed).
2.29 KB Public
Uses aeclipse. Illustrates usage.
3.83 KB Public
Astronomy: Lunar (AL) v 0.1 Version 0.1 is a simple astronomy program showing orbital characteristics (circular simplified) using Turtle. It includes an animation of the light Comms delay to commemorate the anniversary of Apollo 11 in July. I am experienced, but this is my first Numworks script. There is a similar program by me on HP Prime. If your platform supports keyboard, change waittime to 0. (Numworks app has EXE key) https://www.hpmuseum.org/forum/thread-13311.html Tested on Numworks 19.4.0 Tested on Numworks 20 3.2
3.65 KB Public
Astronomy: Lunar Eclipse Includes lunar eclipse and JDE/date conversion routines based on Jean Meeus and a one-year calendar routine. Select edition1 or edition2 to choose appropriate constants. Example: calendar(2023.75,0.5) or calendar(2023+9/12,0.5) will list a calendar of lunar eclipses for the school year 2023-24. Key user functions: calendar : for 1 year real yyyy date: formatted as yyyy mm DD including decimals DTm: Date Time formatted to minutes lunar eclipse: near 1 date real yyyy CAUTION: Chromebook displays incomplete source visually on long lines. Eg in phases_meanm01 JDE= misses several terms. It compiles ok and the missing source is shown when you inspect page source. Results: Magu: Umbral magnitude of eclipse (fraction eclipsed). Gamma: How central the eclipse is. Mins: semidurations (total, partial, penumbral, rounded to minutes).. The date-time given is peak time (probably accurate to a couple of minutes UTC). Note: This source is at the Numworks size limit. See also my eclipse module, which calculates both lunar and solar eclipses: https://my.numworks.com/python/steveg1cmz/aeclipse
96 Bytes Public
Astronomy: Lunar Eclipse V0.2 PLATFORMS Numworks BBC microbit-serial ok
8.09 KB Public
Calculates solar distance (centre Sun-centre Earth) given a JDE. Based on low-precision Jean Meeus algorithm (precision maybe 1000’s of km)
2.08 KB Public
Implement savage benchmark. Works without clock. Platforms: Numworks, Pyscript
1.16 KB Public
References providing formulae and examples Simple Earthquake calculations suitable for local earthquakes (using an average velocity - no layering). References 1. https://www.e-education.psu.edu/earth520…l7_p4.html - Earthquake magnitude and energy 2. https://www.hpmuseum.org/forum/thread-13239.html - Relative strength of 2 earthquakes 3. https://www.google.com/url?sa=t&source=w…NFcE6pGX2B” - PDF - Earthquake location and speed
40 Bytes Public
Earthquakes 0.0 Earthquake calculations api. Compares 2 earthquakes (comparing a list tbd)
4.24 KB Public
Initial Bezier curves (quadratic, cubic, line) implementation, implemented using matplotlib. Tested on Numworks 19 4.0 Tested on Numworks 20.3.2 Only simple parameters are handled (no polybeziers, no full SVG syntax).
2.47 KB Public
Draws filled circles (using turtle pensize technology). Parameters mimic those of SVG. Set scl=1 to use pixels, or scale drawings.
5.97 KB Public
Draws filled circles (using turtle pensize technology). Parameters mimic those of SVG. Set scl=1 to use pixels, or scale drawings. V0.2 fixes bugs affecting scaling. Tested on Numworks 19.4.0 Tested on Numworks 20 3.2
6.02 KB Public
Compares graphic clear screen for various calculators. (Set isNumworks etc. yourself) (turtle.reset is an alternative to turtle.clear) Maybe call gcls(), or just use it as a reminder of what’s available on a platform. Tested on 19.4.0
1.27 KB Public
Geodesy(Circular): Geodesy (circular) algorithms. Caution: This implement is largely untested. Tested on: Numworks 19.4.0 Numworks 20.3.2
3.18 KB Public
geometer: A simple protractor. (A straight edge would be nice if we knew the screen size). Its not the neatest, but should you need one… Tested on: Numworks 19.4.0 Numworks 20.3.2
577 Bytes Public
Torch/Beacon (with keydown) Choice of Blink/Steady Choice of White/Red/Green/Blue/dimred Use can have medical or legal consequences, liability not accepted
2.11 KB Public
Torch/beacon. The torchknob version is for platforms with no buttons, like the Numworks on Android. Ask for inputs or use defaults.
1.96 KB Public
Zsys mimics the built-in sys module, missing from most calculators. V0.1 aims to discover which calculator maker python is running on. Note: This logic has been tested on Numworks Android, but will not run in “My Numworks”. https://www.hpmuseum.org/forum/thread-19989.html Platforms tested: Numworks, Pyscript
33 Bytes Public
Calculates the distance of a thunderstorm. Also measures the time interval. No liability accepted. (More timer interval functions are in ztimer)
3.55 KB Public
ztime emulates the time module for those platforms lacking it (eg Casio) monotonic() sleepms(ms) sleep(s) Try loopms=125 on a Casio CG50.
1.01 KB Public
Rudimentary timer functionality: No buttons version for Android.
1.71 KB Public

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.