Creating the AstroCalc

My requirements: Being able to do astronomical calculations while observing through my telescope during cold nights while not hurting my night vision.

With a smart phone, I’d have to use touch gloves or take off my gloves to press “buttons” on the screen. And then I’d have the hassle of filter programs to dim the screen and make it red to keep it from impacting my night vision.

With my HP-41, I’d have to use a led light to see the screen.

But with an old red led calculator, I could get all my requirements at once. Except there are few of these old pre-1980 calculators that would be capable of doing all the calculations I need; Date -> Julian Date -> Date, Sun rise/set, Moon rise/set, Moon Phase, Field of View calculations fro various eyepieces, etc. Fiddling with magnetic cards for the HP-67 would not be ideal.

hp-25e

HP-25E to the rescue! Bernhard Emese (Panamatik) has created a true piece of art with his “brain transplant” for the old HP-25 calculators. His HP-25E boast a 100x increase in programming memory, on-board GPS with time, Latitude, Longitude, heading, speed and more as well as a stop watch, chess clock, hexadecimal conversion and much, much more. It’s the ideal calculator for my requirements. Except it still had only 50 program steps memory per program. Although it had the possibility of storing 100 HP-25 programs in a constant memory (not lost when you turn the calc off – unlike the original HP-25), you couldn’t write programs with more than 50 steps. And this was way too small for the programs I need.

Talking to Berhard about the possibility of “stringing together” different “pages” of 50 program steps, we came up with a neat way of solving this issue. By using some available rare codes, the HP-25E can now jump between various programs – potentially creating programs with thousands of programming steps.

hp-25e_open

And so I embarked on the journey of creating the AstroCalc – the ideal tool for the amateur astronomer. So far, the GitHub repository only includes the calculation of Julian Date from a date and time and the backward conversion, from Julian Date to date and time. With the HP-25E’s possibility of constantly updating the time, this makes writing down the exact Julian Date on my observations a breeze.

I will add the Sun/Moon rise/set, Moon Phase and eyepiece calculations soon. Just check my HP-25E_astro Github page for updates.

I fucking love this calc.

My computer setup

Here’s a HyperList of my current computer setup – for reference in case someone is looking for inspiration:

PC = Samsung NP900X4C

OS = Ubuntu Linux (16.04) (http://www.ubuntu.com/)

Shell = zsh (http://www.zsh.org/)

Terminal = urxvt (http://software.schmorp.de/pkg/rxvt-unicode.html)

Text editor = VIM (http://www.vim.org/)

Document production = LaTeX (https://www.latex-project.org/)

Programming Languages

Mail User Agent = mutt (http://www.mutt.org/)

  • Mail filtering = mail_fetch (from GMail accounts)

SMTP client = msmtp (http://msmtp.sourceforge.net/)

Instant communication = Weechat (https://weechat.org/)

HP-41 link = pc41 (https://github.com/isene/pc41)

Newsreader (RSS) = Newsbeuter (http://newsbeuter.org/)

Window Manager = i3 (http://www.i3wm.org/)

Information display = Conky (https://github.com/brndnmtthws/conky)

Browser = Qutebrowser (https://github.com/The-Compiler/qutebrowser)

Office suite = LibreOffice (https://www.libreoffice.org/)

Presentation viewer = Impressive (http://impressive.sourceforge.net/)

 

conky-screenshot

Tech stuff: Julia, Vim & Vizardry

Been doing lots of tech stuff lately. Here’s a sharing of some highlights.

Through the years I’ve been programming in more than a dozen different languages. Since many years I have more or less settled on Ruby besides my HP-41 projects programmed in FOCAL and MCODE. Now and then I get this urge to learn a new programming language, and after an extensive search for something neat, I finally landed on Julia. I’m trying her out while reading the book, “Getting started with Julia Programming Language“.

The book is good. The programming language seems excellent. It boasts a complete GitHub-based package system to extend the language with various modules. Although it’s a general purpose language, its strength lies in maths and natural sciences. It’s very fast and with a pretty clean and natural syntax. You can even do straight forward math like this:

f(x) = 2sin(3x)^2

And by then executing the function “f” with x as 0.8, you get the answer straight:

f(0.8)
0.9125010165605526

There is a chance I could be falling in love here 🙂

I’ve also been doing lots of work on my Conky setup resulting in this as my “bare” desktop:

conky

If you have any questions about scripts or conky setups, just ask by leaving a comment here.

Then there is VIM – perhaps my the tool I use the most. I’ve been using VIM for writing everything from HyperLists and notes to e-mails, short stories and books since around 2001. It’s a fantstic text editor. But it lacks a good package manager for add-ons :-/

But then I found Vizardry. Using Pathogen as a base to install extensions, Vizardry will let you search for add-ons, install it with a breeze and remove it just as easily. If you’re a VIM user, this is a must. Go get it! You will thank me 🙂

HP-41: The Periodic Table of Chemical Elements

Have your HP-41 right where it should be (in your hand) and unable to find the Internetz to look up nifty details of obscure chemical elements? Worry no more, the solution is here, the HP-41 program, “PERIOD”.

14LaAc_periodic_table_IIb

The program will display:

  • Atomic number, Name and Symbol
  • Group, Period and Block
  • Atomic Weight
  • Property (Alkali metal, Noble Gas, etc.)
  • Type (Gas, Liquid, Solid or Unknown)
  • Occurrence in nature (Primordial, From Decay, Synthetic)
  • Melting Point, Boiling Point (in Kelvin)
  • Year of discovery (“OLD” if known in ancient times)
  • Electron Configuration
  • Atomic Radius (empirical and calculated)
  • Origin (Big Bang, Cosmic Rays, Small & Large Stars, Large Stars, Large Stars & Super Nova, Super Nova and Man Made)

You will find the ROM pages, program listing and element details on the Github project page. It is also included in the HP Museum’s “HP-41C Software Library“. Enjoy 🙂

Code is up

… on Github.

github-logo

Got around to putting my most useful programming projects up on Github.com. You can now easily get the newst versions, repost bugs, read the source code and fork the code to make your own version.

The projects that are up so far are:

  • npcg – the random encounters and NPC generator for the AMAR RPG
  • hyperlist.vim – the VIM plugin to easily and effectively manage HyperListS
  • hypergraph – the tool to make graphical representations of HyperListS
  • mailfetch – collect mail from different imap accounts, filter and store locally
  • imaptools – Client-side tools for imap mail
  • pc41 – Facilitating serial/USB connection to an HP-41 calculator

The next project up will probably be my collection of HP-41 programs found on this site.

Update (2015-08-28): I have now put all my relevant HP-41 related programs up on my Github page. The pages and links on this site is now updated to point to my Github projects.

Reverse Polish Notation explained

The Youtube channel “Computerphile” has some cool videos. This one explains very well what Reverse Polish Notation (RPN) is and how it works. The concept is central to the traditional HP calculators, something dear to my heart 🙂

Notice how I am drifting away from blogging about Scientology. Scientology blog posts generate a hell of a lot more action than any post on RPN of HP calculators. But it’s the logical evolutions as Scientology drifts away into the sunset. The church is dying and anything of value in the subject itself will find its way into the common pool og human knowledge. And all will be fine.