chubin / pyphoon Goto Github PK
View Code? Open in Web Editor NEW:waning_gibbous_moon: ASCII Art Phase of the Moon (Python version)
Home Page: http://wttr.in/Moon
License: MIT License
:waning_gibbous_moon: ASCII Art Phase of the Moon (Python version)
Home Page: http://wttr.in/Moon
License: MIT License
Could you please use Let's Encrypt for ssl cert?
Preferably before August 2017 (next partial eclipse), or February 2017 if you want to also mention penumbral eclipses.
Any ideas how to make this print well when my shell background is white? I tried to modify the curl output to use a black background but couldn't get it to work. The colors don't work very well when the background is white.
Hi guys,
this looks like it may be related to issue 33? I assumed that dateutil understands proper ISO / RFC3339 dates, since https://pypi.org/project/python-dateutil/ claims "Parsing of RFC strings is supported as well". So I guess the proper UTC time arrives at the code.
$ pyphoon 2023-08-01T18:31:34Z # actually the super full moon of August 1st (according to timeanddate.com).
.------------.
.--' o . . `--.
.-' . O . . `-.
.-'@ @@@@@@@ . @@@@@ `-.
/@@@ @@@@@@@@@@@ @@@@@@@ . \
./ o @@@@@@@@@@@ @@@@@@@ . \.
/@@ o @@@@@@@@@@@. @@@@@@@ O \
/@@@@ . @@@@@@@o @@@@@@@@@@ @@@ \
|@@@@@ . @@@@@@@@@@@@@ o @@@@|
/@@@@@ O `.-./ . @@@@@@@@@@@@ @@ \ First Quarter +
| @@@@ --`-' o @@@@@@@@ @@@@ | 6 19:23:21
|@ @@@ ` o . @@ . @@@@@@@ | Full Moon -
| @@ @ .-. @@@ @@@@@@@ | 0 1:01:52
\ . @ @@@ `-' . @@@@ @@@@ o /
| @@ @@@@@ . @@ . |
\ @@@@ @\@@ / . O . o . /
\ o @@ \ \ / . . /
`\ . .\.-.___ . . .-. /'
\ `-' `-' /
`-. o / | o O . .-'
`-. / . . .-'
`--. . .--'
`------------'
Applying the delta, I get ;-)
$ pyphoon 2023-08-01T19:33:27Z # not a full moon in the sky, but sure a beauty in the console
.------------.
.--' o . . `--.
.-' . O . . `-.
.-'@ @@@@@@@ . @@@@@ `-.
/@@@ @@@@@@@@@@@ @@@@@@@ . \
./ o @@@@@@@@@@@ @@@@@@@ . \.
/@@ o @@@@@@@@@@@. @@@@@@@ O \
/@@@@ . @@@@@@@o @@@@@@@@@@ @@@ \
|@@@@@ . @@@@@@@@@@@@@ o @@@@|
/@@@@@ O `.-./ . @@@@@@@@@@@@ @@ \ Full Moon +
| @@@@ --`-' o @@@@@@@@ @@@@ | 0 0:00:00
|@ @@@ ` o . @@ . @@@@@@@ | Last Quarter -
| @@ @ .-. @@@ @@@@@@@ | 6 15:56:29
\ . @ @@@ `-' . @@@@ @@@@ o /
| @@ @@@@@ . @@ . |
\ @@@@ @\@@ / . O . o . /
\ o @@ \ \ / . . /
`\ . .\.-.___ . . .-. /'
\ `-' `-' /
`-. o / | o O . .-'
`-. / . . .-'
`--. . .--'
`------------'
Do you have have a phoon/phoon-c version handy to see if this difference was in there, too?
Apparently ephem by Elwood Charles Downey on which XEphem, (nowadays) and PyEphem was based, produces output that looks suspiciously similar to pyphoon's (some whitespace omitted):
Select: Sky dome, Alt/az sky, Solar system, Earth, Moon, No trails
CET 20:31:34 8/01/2023
LST 11:59:16
.--------------.
.----' o . `----.
.-' . O . . `-.
.-' @@@@@@ . `-.
.'@ @@@@@@@@@@@ @@@@@@@@ . `.
.'@@ @@@@@@@@@@@@@@ @@@@@@@@@@ `.
.'@@@ o @@@@@@@@@@@@@@ @@@@@@@@@@ o `.
/@@@ @@@@@@@@@@@@@@ @ @@@@@@@@@@ @@ . \
/ @@@@@@@@@@@ . @@ @@@@@@@@@@@@ @@ \
/@ o . @@@@@@ o @ @@@@@@@@@@@@@@ o @@@@ \
/@@@ . @@@@@@@@@@@@@@@ @@@@@ \
/@@@@@ @ . @@@@@@@@@@@@@@ @@@ \
|@@@@@ o `.-./ . @@@@@@@@@@@@ @@@ . |
/ @@@@@ __`-' o @@ . @@@@@@ \
|@ @@@@ . @ ` @ @@ . @@@@@@ | First Quarter +
| @@ @ o @@@ o @@@@@@. | 6 20:23:21
| @ @@@@@ @@@ | Full Moon -
| . . @ @ @ o @@@@@ . . | 0 0:01:52
\ @ .-. . @@@ . . /
| @ @ @ @ `-' . /
\ . @ @ . o /
\ o @@@@ . . /
\ @@@ @@@@@@ . o /
\ @@@@@ @@\@@ / o . /
\ o @@@ \ \ / ___ . . .--. /
`. . \.-.--- `--' .'
`. `-' . .'
`. o / | O . .'
`-. / | o .-'
`-. . . .-'
`----. . .----'
`--------------'
Select: Sky dome, Alt/az sky, Solar system, Earth, Moon, No trails
CET 20:33:26 8/01/2023
LST 12:01:09
.--------------.
.----' o . `----.
.-' . O . . `-.
.-' @@@@@@ . `-.
.'@ @@@@@@@@@@@ @@@@@@@@ . `.
.'@@ @@@@@@@@@@@@@@ @@@@@@@@@@ `.
.'@@@ o @@@@@@@@@@@@@@ @@@@@@@@@@ o `.
/@@@ @@@@@@@@@@@@@@ @ @@@@@@@@@@ @@ . \
/ @@@@@@@@@@@ . @@ @@@@@@@@@@@@ @@ \
/@ o . @@@@@@ o @ @@@@@@@@@@@@@@ o @@@@ \
/@@@ . @@@@@@@@@@@@@@@ @@@@@ \
/@@@@@ @ . @@@@@@@@@@@@@@ @@@ \
|@@@@@ o `.-./ . @@@@@@@@@@@@ @@@ . |
/ @@@@@ __`-' o @@ . @@@@@@ \
|@ @@@@ . @ ` @ @@ . @@@@@@ | First Quarter +
| @@ @ o @@@ o @@@@@@. | 6 20:25:13
| @ @@@@@ @@@ | Full Moon -
| . . @ @ @ o @@@@@ . . | 0 0:00:00
\ @ .-. . @@@ . . /
| @ @ @ @ `-' . /
\ . @ @ . o /
\ o @@@@ . . /
\ @@@ @@@@@@ . o /
\ @@@@@ @@\@@ / o . /
\ o @@@ \ \ / ___ . . .--. /
`. . \.-.--- `--' .'
`. `-' . .'
`. o / | O . .'
`-. / | o .-'
`-. . . .-'
`----. . .----'
`--------------'
My guess was: Some messup with daylight saving time being applied (to UTC dates) when it shouldn't (would explain the extra hour), plus some outdated ephemerides for the remaining 00:01:52. But when I researched further, things get confusing...
Current XEphem 4.1 has full moon occur on 2023-08-01T18:33:44Z. Different sources give the times as 18:31Z or 18:33Z, depending on the website one checks.
NASA JPL Horizons with geocentric, airless gives the greatest illumination around 1841Z, which lasts for 3 minutes at the given precision. That may explain why most sources disagree about 3 minutes.
*******************************************************************************
Ephemeris / PORT_LOGIN Tue Aug 8 14:22:20 2023 Pasadena, USA / Horizons
*******************************************************************************
Target body name: Moon (301) {source: DE441}
Center body name: Earth (399) {source: DE441}
Center-site name: GEOCENTRIC
*******************************************************************************
Start time : A.D. 2023-Aug-01 18:30:00.0000 UT
Stop time : A.D. 2023-Aug-01 19:00:00.0000 UT
Step-size : 1 minutes
*******************************************************************************
Target pole/equ : MOON_ME {East-longitude positive}
Target radii : 1737.4, 1737.4, 1737.4 km {Equator_a, b, pole_c}
Center geodetic : 0.0, 0.0, -6378.137 {E-lon(deg),Lat(deg),Alt(km)}
Center cylindric: 0.0, 0.0, 0.0 {E-lon(deg),Dxy(km),Dz(km)}
Center pole/equ : ITRF93 {East-longitude positive}
Center radii : 6378.137, 6378.137, 6356.752 km {Equator_a, b, pole_c}
Target primary : Earth
Vis. interferer : MOON (R_eq= 1737.400) km {source: DE441}
Rel. light bend : Sun {source: DE441}
Rel. lght bnd GM: 1.3271E+11 km^3/s^2
Atmos refraction: NO (AIRLESS)
RA format : HMS
Time format : CAL
Calendar mode : Mixed Julian/Gregorian
EOP file : eop.230806.p231030
EOP coverage : DATA-BASED 1962-JAN-20 TO 2023-AUG-06. PREDICTS-> 2023-OCT-29
Units conversion: 1 au= 149597870.700 km, c= 299792.458 km/s, 1 day= 86400.0 s
Table cut-offs 1: Elevation (-90.0deg=NO ),Airmass (>38.000=NO), Daylight (NO )
Table cut-offs 2: Solar elongation ( 0.0,180.0=NO ),Local Hour Angle( 0.0=NO )
Table cut-offs 3: RA/DEC angular rate ( 0.0=NO )
******************************************************************************************************************
Date__(UT)__HR:MN phi PAB-LON PAB-LAT Illu% Def_illu ang-sep/v SN.ang SN.dist TDB-UT
******************************************************************************************************************
$$SOE
2023-Aug-01 18:30 4.9116 308.9234 -2.4651 99.81640 3.6807 0.0/* 164.36 85.82 69.183292
2023-Aug-01 18:31 4.9114 308.9291 -2.4650 99.81641 3.6803 0.0/* 164.24 85.82 69.183292
2023-Aug-01 18:32 4.9112 308.9347 -2.4649 99.81643 3.6801 0.0/* 164.13 85.81 69.183292
2023-Aug-01 18:33 4.9111 308.9403 -2.4648 99.81644 3.6798 0.0/* 164.01 85.81 69.183292
2023-Aug-01 18:34 4.9109 308.9460 -2.4647 99.81645 3.6796 0.0/* 163.89 85.81 69.183292
2023-Aug-01 18:35 4.9108 308.9516 -2.4646 99.81646 3.6794 0.0/* 163.77 85.81 69.183292
2023-Aug-01 18:36 4.9107 308.9573 -2.4645 99.81647 3.6793 0.0/* 163.65 85.80 69.183292
2023-Aug-01 18:37 4.9106 308.9629 -2.4644 99.81647 3.6791 0.0/* 163.53 85.80 69.183292
2023-Aug-01 18:38 4.9105 308.9686 -2.4644 99.81648 3.6790 0.0/* 163.41 85.80 69.183292
2023-Aug-01 18:39 4.9105 308.9742 -2.4643 99.81648 3.6790 0.0/* 163.29 85.80 69.183292
2023-Aug-01 18:40 4.9104 308.9799 -2.4642 99.81649 3.6789 0.0/* 163.17 85.80 69.183292
2023-Aug-01 18:41 4.9104 308.9855 -2.4641 99.81649 3.6789 0.0/* 163.05 85.80 69.183292
2023-Aug-01 18:42 4.9104 308.9912 -2.4640 99.81649 3.6790 0.0/* 162.93 85.80 69.183292
2023-Aug-01 18:43 4.9105 308.9968 -2.4639 99.81648 3.6790 0.0/* 162.81 85.80 69.183292
2023-Aug-01 18:44 4.9105 309.0024 -2.4638 99.81648 3.6791 0.0/* 162.69 85.80 69.183292
2023-Aug-01 18:45 4.9106 309.0081 -2.4637 99.81647 3.6792 0.0/* 162.57 85.80 69.183292
2023-Aug-01 18:46 4.9107 309.0137 -2.4637 99.81647 3.6793 0.0/* 162.45 85.81 69.183292
2023-Aug-01 18:47 4.9108 309.0194 -2.4636 99.81646 3.6795 0.0/* 162.33 85.81 69.183292
2023-Aug-01 18:48 4.9109 309.0250 -2.4635 99.81645 3.6797 0.0/* 162.21 85.81 69.183292
2023-Aug-01 18:49 4.9111 309.0307 -2.4634 99.81644 3.6800 0.0/* 162.10 85.81 69.183292
2023-Aug-01 18:50 4.9112 309.0363 -2.4633 99.81643 3.6802 0.0/* 161.98 85.82 69.183292
2023-Aug-01 18:51 4.9114 309.0420 -2.4632 99.81641 3.6805 0.0/* 161.86 85.82 69.183292
2023-Aug-01 18:52 4.9116 309.0476 -2.4631 99.81640 3.6808 0.0/* 161.74 85.82 69.183292
2023-Aug-01 18:53 4.9119 309.0533 -2.4630 99.81638 3.6812 0.0/* 161.62 85.83 69.183292
2023-Aug-01 18:54 4.9121 309.0589 -2.4629 99.81636 3.6816 0.0/* 161.50 85.83 69.183292
2023-Aug-01 18:55 4.9124 309.0646 -2.4629 99.81634 3.6820 0.0/* 161.38 85.84 69.183292
2023-Aug-01 18:56 4.9127 309.0702 -2.4628 99.81632 3.6824 0.0/* 161.26 85.84 69.183292
2023-Aug-01 18:57 4.9130 309.0758 -2.4627 99.81630 3.6829 0.0/* 161.14 85.85 69.183292
2023-Aug-01 18:58 4.9133 309.0815 -2.4626 99.81627 3.6834 0.0/* 161.02 85.85 69.183291
2023-Aug-01 18:59 4.9137 309.0871 -2.4625 99.81624 3.6839 0.0/* 160.90 85.86 69.183291
2023-Aug-01 19:00 4.9140 309.0928 -2.4624 99.81622 3.6845 0.0/* 160.78 85.87 69.183291
$$EOE
******************************************************************************************************************
Hmm, today I learned that there is no single answer to when a full moon occurs, evidently, so maybe the only fix you could reasonably make is about the DST being applied incorrectly.
Cheers!
The following messages:
should be localized
Hello there .... i need to know how output is colorized
thx
The README gives the email address and website of Jef Poskanzer's original phoon, as well as some background info about it (Written in PASCAL in 1979, ported to C). But not the link to the actual project page (https://acme.com/software/phoon/). This makes locating the original C source code for study or analysis a difficult, involved process.
In astro.py there is a link to John Walkers original version of moontool
which the astronomical calculations are based off of. It feels natural to also provide a link to Jef Posanker's code somewhere (possibly in the README with the other info) too.
We are missing translations of North/South Hemisphere for:
bg, ca, cs, da, et, el, es, fi, hr, ia, it, ja, nl, pl, ro, sk and sr.
Would love for this to be included in brew! Thanks!
When in the southern hemisphere, the moon waxes and wanes in the opposite direction.
re: http://twitter.com/igor_chubin/status/717791483127066625
I installed pyphoon on Arch Linux and on windows. On it works properly but on windows:
pyphoon 1960-04-02
says cannot parse date, but strangely later dates like 1980-10-31 or 1993-10-31 work fine.
I'm guessing its an issue with python-dateutils on windows.
I am a beginner and I would like to be told the exact steps to install these scripts.
Thank you
Are you the owner of https://pypi.org/project/pyphoon/ ?
stitny$ python3 -mpip install --user pyphoon
Collecting pyphoon
Downloading pyphoon-0.1-py3-none-any.whl (30 kB)
Installing collected packages: pyphoon
Successfully installed pyphoon-0.1
stitny$ pyphooon
bash: pyphooon: command not found
I had to install from pip install git+https://github.com/chubin/pyphoon.git
to get a working version.
'en': ["New Moon", "First Quarter", "Full Moon", "Last Quarter", "Northern Hemisphere", "Southern Hemisphere"],
'am': ["Նորալուսին", "Առաջին քառորդ", "Լիալուսին", "Վերջին քառորդ", "Հյուսիսային կիսագունդ", "Հարավային կիսագունդ"],
sorry i don't know how to pull)
Created from chubin/wttr.in#56
To correctly show delta time to last and next phase, and the correct phase at the days when there's a phase change, a timezone option is needed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.