Vote for this post Share this post on:

Some months ago, I began running python code to compare Starlink TLE to DECAM image captures on two old MacBookPros proceeding chronologically. Given the number of DECAM images and the resulting calculations that must be made, the progress could be better. So, the question arose as to whether I could install Pycharm on an even older MacBookPro to use my code. Unfortunately, I ran into a problem with an cysgp4 installation. This article discusses how I resolved the issue.

SatBomb Code

For background reference, my code calculates the orbit positions of Starlink satellites during the period of observations at the DECam telescope in Chile. The code begins with a list of images acquired for each month. For each image, the code reads the portion of the sky to which the telescope had been directed, the time of observation, and the duration of the observation. In this way, the code can determine whether any satellites photobomb the DECam images (SatBomb Code).

System Software and IDE

To begin the experiment, I updated the MacBookPro (Retina, 15″, early 2013) to the latest version of Catalina it would support at 10.15.7. Then, I installed Pycharm and added an installation of Python 3.8.x (which is the version the SatBomb Code has been operating under on the other two MacBookPros).

From there, I copied the SatBomb Code, added it to a Jupyter notebook within the new environment, and installed the packages it required.

After running the code, Pycharm could not find the package cysgp4 (I had not listed this in the front end of my code). So, I attempted an initial cysgp4 installation, but quickly obtained errors. After about 24 hours of research and experimentation, I resolved the issue.

X Code and Command Line Tools

To begin with, I needed to install X Code and the Command Line Tools. However, the current version of X Code available at the Apple Store would not install and run on the old computer. Consequently, I logged into my Apple Developer account, determined the most recent compatible version of XCode, and downloaded XCode version 11.5. I also separately downloaded the Command Line Tools that would be similarly compatible.

Read the Instructions

I highly recommend reviewing the actual instructions at:

https://bwinkel.github.io/cysgp4/latest/install.html#source-install

In particular, after some significant time without Homebrew, I capitulated and installed Homebrew. This then enabled me to install gcc according to the instructions:

Instructions from cysgp4 for installation of gcc through Homebrew.

I had also installed clang and llvm.

After the foregoing, I received an error relating to a part of the setup.py file within cysgp4. Specifically, my Python build did not like ‘-stdlib=libc++’ as a compiler argument. Previously, I had viewed the cysgp4 code and remembered:

Code in cysgp4 to comment out if Python does not like -stdlib=libc++

So, I commented out this portion of the file and saved. Running the code again fixed the problem.

Of course, it appears that the MBP early-2013 runs slower than the other MBPs. Specifically, Python calculated 30 seconds of orbit for about 1900 satellites in 13 minutes. This equates to approximately 72 satellite-orbit-second calculations per second. In contrast, my MBP 15″ 2019 running Mac OS 12.5 Monterey runs 300 seconds for 780 satellites at approximately 30 minutes. This equates to approximately 130 satellite-orbit-second calculations per second.

Vote for this post Share this post on:
Avatar clmuddjr

Author: clmuddjr