Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
iPad Sun Calculator with Google Maps Support
-
-
Hello there!
The iPhone version is ready and uploaded to a separate github repository:
https://github.com/Bambla78/Pythonista_SunCalculator_for_iPhone
Changes:
-
More compact ui
-
Weekeday abbreviations in English now (I forgot to translate
-
No more manual renaming of pyui and ttf required for local installation - it works with json and txt suffix now
-
I used ccc‘s optimized iPad code as a starting point for the iPhone version - still I had to put the „import arrow“ Statement at the end of the import block due to overwrite problems (ccc put it at a place where it fits better into the readability of the Code)
-
I still have too much cyclomatic complexity and after I re-placed the „import arrow“ Statement github sent me a message that lint tests failed. The Script works fine though, I still must learn what clean code is about.
-
Please see below in the Screenshots the way to copy new locations to clipboard from Google Maps to process the clipboard data in the app for calculations
-
-
This post is deleted! -
Thank you.
For everyone who has already downloaded the App from Github, please go to
https://github.com/Bambla78/Pythonista_SunCalculator_iPad
for iPad and
https://github.com/Bambla78/Pythonista_SunCalculator_for_iPhone
for iPhone
and import the current file suncalc.py from there to your local Pythonista app directory.
When you use „My Location“ and „Current date“ the app did not recognize switch to Standard time since Oct 31st 2021.
This should now be fixed on both iPhone and ipad.
-
Hello, I added an additional script to both archives
https://github.com/Bambla78/Pythonista_SunCalculator_for_iPhone/blob/main/sunquickview.py
https://github.com/Bambla78/Pythonista_SunCalculator_iPad/blob/main/sunquickview.py
This program (works both on iPad and iPhone) shows instant sun data of your current location at the current time, no matter where in the world you are.
The program works offline, you only need GPS enabled. A correct timezone recognition is implemented, too.
This program was originally supposed to be a widget but Pythonista won‘t display it because it is too complex.
Instead, I released it as a regular Pythonista Script. I hope it is useful to some of you.
-
Please find my latest addition for the iPhone version: a sun compass that uses the iPhone magnetometer and GPS.
The compass is precise, but you might need to calibrate the compass by moving the iPhone in the shape of a horizontal „8“.
When using the compass, hold the iPhone horizontal and parallel to the ground and rotate without rolling or pitching your phone, otherwise the compass fails.
I don’t know the magic the iOS compass app from Apple does to keep the value stable even if you roll and pitch the phone around.
Thecompass is realtime-tracking the time, your heading and the sun position and the app stays permanently open, but the GPS coordinate are not updated permanently, I decided it to be CPU waste to do so.
Instead, you get a position refresh at each new launch.
The app recognizes your time zone and DST Status, also if the sun does not rise or set at all. It works all offline, only GPS is required.
I had also memory leak issues with ui.imageview and bytesio first and switched to using scene. The app ran much longer but Pythonista still crashed. I finally fixed the issue by placing a gc command at the end of my while loop.
I stopped measuring run time with active Display after 1 hour. Note that your battery is being sucked empty quicker when the app is running.
https://github.com/Bambla78/Pythonista_SunCalculator_for_iPhone/blob/main/suncompass.py
-
Latest addition:
https://github.com/Bambla78/Pythonista_SunCalculator_for_iPhone/blob/main/suncompass.py
Roll and pitch values of your iPhone for optimal horizontal positioning of your compass.
The values in the upper right corner must be both < 0.009xx in order to show the same heading as the official Apple iPhone compass app, given there are no other disturbing influences on the magnetometer.
As I already said above, the official iPhone compass app is more robust and you don’t need to treat it like a raw egg to ensure precision, but I don’t know what Apple does to achieve this.
-
This post is deleted! -
New version available on github:
iPad-Version:
https://github.com/Bambla78/Pythonista_SunCalculator_iPadiPhone-Version:
https://github.com/Bambla78/Pythonista_SunCalculator_for_iPhoneFor both iPhone and iPad version the installation process has been simplified by not needing to manually rename files to *.pyui anymore.
Further, the result output of a selected date and a selected location now additionaly shows a 2D graphic containing the location of the earth on its path around the sun and the relative position of the sun towards earth at the given location including latitude.
In the example below we see the latitude of a location in Australia on the southern hemisphere as a long horizontal line, showing the longest duration of day length at winter solistice on December 21st, which is on the southern hemisphere actually a summer solistice.
On the iPhone version, the sun compass apps are still included. These are not contained in the iPad version, though.
The new 2D graphics use generic dates, i.e. 21.3., 21.6, 23.9. and 21.12 for astronomic seasons, whereas in reality, these dates can differ slightly. Further, the earth path around the sun is depicted as a perfect circle instead of an ellipse and I assume a constant moving speed of the earth, which is not true, but as an approximiation and to get a general understanding, I consider the picture to be useful.
-
When the commented line near the end is uncommented, it becomes modal and works, but it becomes slow and stutters when scrolling. Any ideas as https://valódijogosítvány.com/ to why it slows down?