Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moon localisation to town #247

Closed
Gy0m opened this issue Nov 13, 2018 · 39 comments
Closed

Moon localisation to town #247

Gy0m opened this issue Nov 13, 2018 · 39 comments

Comments

@Gy0m
Copy link

Gy0m commented Nov 13, 2018

"Is it possible to localize moon to town it appears ?"
the command : curl -4 https://fr.wttr.in/Moon show me the moon in the coutry where i live

@chubin
Copy link
Owner

chubin commented Dec 23, 2018

@Gy0m Actually, there should be no difference for different locations.
The location wouldn’t alter enough to see a different phase of the Moon around the world.
The only important factor in this case could be the hemisphere.
People in different hemispheres see the moon in a slightly different way.
In the Southern Hemisphere, people see the moon 'upside down' so the side which is shining (sunlit) seems the opposite from the Northern Hemisphere.
We already have a related issue (by @dlangille) for pyphoon:

chubin/pyphoon#1

Probably, we should detect the hemisphere basing on the IP of the client querying wttr.in/Moon,
and visualize the moon-phase based on it.

@Gy0m Or do you mean some other localisation?

@Asternitix
Copy link

Asternitix commented Dec 30, 2018

Should be able to specify a location as well or whatever.

Sent with GitHawk

@chubin
Copy link
Owner

chubin commented Sep 18, 2020

pyphoon supports hemispheres now (thanks to @martinbra),
so now we can enable this feature in wttr.in, so that the hemisphere will be chosen automatically, basing on the observer location (it should be possible to override it though)

@martinbra
Copy link

Thanks @chubin , I'm glad to help!
I gave a quick glance over the wttr.in code to see how the localization works and I didn't grasped how one would bring the functionality over. It should be simple once we have the latitude. (positive is north hemisphere, negative is south), but do we always have it?
Chubin, if you want to do it yourself, go ahead. Otherwise I will try to do it this weekend and see how far I get.

@chubin
Copy link
Owner

chubin commented Sep 20, 2020

I've activated it and it seems to be working:

Selection_053

Maybe we should show a warning, that the user is in the Southern Hemisphere,
that is why the moon is rotated. Also, the moon symboles should be rotated
in the Moon line in the v2 view.

@iago-lito
Copy link
Contributor

Maybe we should show a warning, that the user is in the Southern Hemisphere,

I'm not sure there is anything to "warn" the user about. I suspect that if the user is in the southern hemisphere, then they are aware of that :P

What about tropical/equatorial zones? Is this (wonderful btw) moon picture flexible enough to be rotated by an arbitrary angle?

@martinbra
Copy link

What about tropical/equatorial zones? Is this (wonderful btw) moon picture flexible enough to be rotated by an arbitrary angle?

Unfortunately no. Ascii art is difficult to rotate. Chubin has a link to Unicode about equatorial zones (pdf warning) in the main readme.md which humorously talk about why it is a little bit of non sense to rotate the moon to the tropical viewer.

Check out https://github.com/chubin/pyphoon/blob/master/src/lib/moons.py for the original moon ascii art. Actually, it comes from a 1979's pascal code by Jef Poskanzer, as stated in the pyphoon readme.

@chubin , I tried, but windows was making things hard for me (V2 uses pyjq which doesn't work on windows), so I gave up trying to run the server (this and a lot different configurations for windows).

I am for the warning, as some users may be unaware of the changes made.
For the single line emojis, I think that following the Unicode idea of just assuming that the moon surface is a fantasy drawing and then changing the emojis to reproduce the correct phase is enought.

@chubin
Copy link
Owner

chubin commented Sep 21, 2020

I believe moon rotation for tropical zones is an overkill. Of course, it is an interesting feature, but we have so many feature requests in other areas, so I think that it is better to implement them first.

@martinbra I believe, the best option for running/developing linux apps on Windows, is Docker; it is quite easy to install/manage Docker on Windows now.
If we need a warning, we should implement it in pyphoon (for example, add a command line option: -S, that would mean the same as -s but show warning about the southern hemisphere if needed), and the word combination southern hemisphere must be added to translated list then, because it should be translated

@iago-lito
Copy link
Contributor

Unfortunately no. Ascii art is difficult to rotate. Chubin has a link to Unicode about equatorial zones (pdf warning) in the main readme.md which humorously talk about why it is a little bit of non sense to rotate the moon to the tropical viewer.

@martinbra Yeah, I incidentally happen to be the author of that link addition in the readme X) Fair enough, I agree that it's much more difficult to rotate ascii art than to rotate yourself while gaping at the moon ;) Thank you for this nice addition!

@martinbra
Copy link

martinbra commented Sep 21, 2020

@iago-lito , oops, "blame" on me for not having blamed the readme.md. Thanks for the documentation.

If we need a warning, we should implement it in pyphoon (for example, add a command line option: -S, that would mean the same as -s but show warning about the southern hemisphere if needed), and the word combination southern hemisphere must be added to translated list then, because it should be translated

@chubin Ok, I will do it. Is google translator accurate enough to fullfill every language?

@chubin
Copy link
Owner

chubin commented Sep 24, 2020

@martinbra no, of course not, but we have a lot of supporters, who will help us with the translation. We should just add the English version, and they will do the rest. Martin, a short question: do you have a twitter account? I want to publish the moon update, and wanted to mention you

@martinbra
Copy link

martinbra commented Sep 24, 2020 via email

@iago-lito
Copy link
Contributor

I'm up for the French translation btw, where/when do I get started? :)

@martinbra
Copy link

@chubin and @iago-lito :
which option you think is best for the warning (opt1 or opt2)?
What do you thing of the warning message?

# pyphoon -S south -n 18
             ,-------
         ,--`       `
       ,`    o    `  |
     ,`           ---()
   ,`  o      `     / \^
  / o    @@  `      `  \@
  |  @@@  @@@         @@@
 /  @@@@@   @@  () `   @         Quarto crescente +
 |   @@@ @@@@@@                  1 15:48:43
 |      @@@@@@@  o  `  ,-        Lua cheia -
 \@@  `  @@@@@@@@ `    `-        6  3:21:37
  |@@     @@@@@@                 As seen from south hemisphere (opt1)
  \@   O    @@@@   `@@@@@
   `. `    @@@@@@  @@@@@
     `. `   @@@@   @@@@@
       `. `   `   O @@@
         `--.   `    o
             `-------
As seen from south hemisphere (opt2)

# pyphoon -S south -n 6
    ,,--
  /,````o        Quarto crescente +
 `|| ()``        1 15:48:55
 `( O            Lua cheia -
  `.`  oo        6  3:21:25
    ``--         As seen from south hemisphere (opt1)
As seen from south hemisphere (opt2)

@martinbra
Copy link

I think I'm pending to opt for the opt2, since any moon with argument n > 27 will hide the text to the right of the moon.

@martinbra
Copy link

and... should pyphoon -x -S south show the warning or not? (not showing would be the same as pyphoon -x -s south)

@iago-lito
Copy link
Contributor

I like opt1 because it packs informations together, but I'm not sure I understand your concern about "moon with argument"? If it's about text width, would dropping the leading As be enough?
Anyway, both are really fine, and I understand that opt2 is easier to format :)

@martinbra
Copy link

@iago-lito the thing is that pyphoon (actually the original phoon too), hides the text to the right of the moon if we show a moon with size bigger than 27. Since wttr.in/moon uses a standard size, it won't impact the users here, only those who use pyphoon from the CLI. See the example below:

# pyphoon -n 27
                      @@@@@@@@@@@@@
                  @@@@@@@@@@@@@@@@@@@@@@
                @@@@@@@@@@@@@@@@@@@@@@@@@@@@
              @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
            @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
           @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
          @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
         @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
        @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
        @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
       @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
       @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  Quarto crescente +
       @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  4  8:59:07
       @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  Lua cheia -
       @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  3 10:11:13
       @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
       @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
        @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
        @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
         @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
          @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
           @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
            @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
              @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
                @@@@@@@@@@@@@@@@@@@@@@@@@@@@
                  @@@@@@@@@@@@@@@@@@@@@@
                      @@@@@@@@@@@@@


# pyphoon -n 28
                       @@@@@@@@@@@@@
                   @@@@@@@@@@@@@@@@@@@@@@@
                @@@@@@@@@@@@@@@@@@@@@@@@@@@@@
              @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
             @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
            @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
          @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
         @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
         @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
        @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
        @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
       @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
       @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
       @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
       @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
       @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
       @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
        @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
        @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
         @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
         @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
          @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
            @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
             @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
              @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
                @@@@@@@@@@@@@@@@@@@@@@@@@@@@@
                   @@@@@@@@@@@@@@@@@@@@@@@
                       @@@@@@@@@@@@@


would dropping the leading As be enough?

That's an interesting idea. I would then change the argument -S to show the shown hemisphere, instead of just warning if it was rotated as in "North|South Hemisphere", just below the phase/time as it follows. @chubin what do you think?

# pyphoon -n 6 -S south
    ,,--,.
  /,````o``      First Quarter +
 `|| ()``^.c     4  9:08:44
 `( O    `~o     Full Moon -
  `.`  oo .      3 10:01:36
    ``--``       South Hemisphere

# pyphoon -n 6 -S north
    ,,--,.
  /,````o``      First Quarter +
 `|| ()``^.c     4  9:08:44
 `( O    `~o     Full Moon -
  `.`  oo .      3 10:01:36
    ``--``       North Hemisphere

@chubin
Copy link
Owner

chubin commented Sep 28, 2020

I agree that South Hemisphere is better than As seen from south hemisphere;
maybe we should wrap it in () just to make it clear that it is not about the Moon itself.

Another question is should we show the hemisphere warning for the north hemisphere (which I expect is 98% of the queries), or just imply it.

@chubin
Copy link
Owner

chubin commented Sep 28, 2020

I've added Northern Hemisphere/Southern Hemisphere for en/de/fr/be/uk/eo.

@iago-lito veuillez vérifier ma traduction en français, car mon français laisse beaucoup à désirer :)

@martinbra
Copy link

Oh, I see. Yes, better to just imply it.
Opt1 or Opt2? Opt1 is cleaner. Mais, c'est à vous de le décider. En tout cas, les deux sont déjà écrit. :)

@chubin
Copy link
Owner

chubin commented Sep 28, 2020

Je préférerais la première (l'option 1), mais court (simplement Hémisphère sud)

@iago-lito
Copy link
Contributor

Notice that the shortening introduces a slight ambiguity, since it is unsure now whether the message refers to the moon hemisphere, or the earth hemisphere from which the moon is looked at. Can we afford Seen from North hemisphere?

I would rather keep the "warning" in both hemispheres, even if 98% the queries involve north hemisphere:

  • more inclusive
  • northean folks will occasionally learn cool things about the moon :)

BTW, not even sure why to call it a "warning", this information is perfectly expected, right?

Ok for the French-checking, mais je ne suis pas certain d'avoir compris où trouver les fichiers à traduire, où sont-ils ? X)

(how come you two like switching to French this way? :P)

@martinbra
Copy link

Open https://github.com/chubin/pyphoon/blob/master/src/lib/translations.py and check chubin's translation. Click on edit if needed (top right)... maybe you will have to fork the repository first.
image

@martinbra
Copy link

@chubin I created a PR, but didn't considered @iago-lito last considerations, since I hadn't seen them at the time. Let me know what you think and if there is any modification needed.

@chubin
Copy link
Owner

chubin commented Sep 28, 2020

This: northean folks will occasionally learn cool things about the moon :)
I think it is a very useful and important pro argument for the northern hemisphere "warning".
I believe almost nobody knows (or at least never thought) about the fact, the Moon must be rotated when in the Southern hemisphere :)

And regarding the as seen from moon/from earth controversy, I think it is enough to add some brackets, braces or make it somehow visible, that the southern hemisphere is related to something different and not to the moon, but if you insist on the full text, then it should be printed below the Moon I think, and maybe even without colors, or maybe even grayed out.

Selection_056

Oups, je suis désolé, j'ai lié le fichier à une Issue, mais pas à celle-ci.
Voilà:

chubin/pyphoon#1
https://github.com/chubin/pyphoon/blob/master/src/lib/translations.py

(I believe, it would be very an interesting experience to live in the world, where Github, and in general the software developers lingua-franca is French; sort of the world of Jules Verne; very very cool :)

@martinbra
Copy link

martinbra commented Sep 29, 2020

I like the idea of the text with both North and South warnings at the side of the moon.

Notice that the shortening introduces a slight ambiguity, since it is unsure now whether the message refers to the moon hemisphere, or the earth hemisphere from which the moon is looked at. Can we afford Seen from North hemisphere

I think that we could explain it in the function 'help' text and in README.md, that we are seeing the moon from the Earth northern/southern hemisphere, and keep the displayed text short. We could also explain that due to the revolution and rotation of the moon being synced, we always see the same face of the moon (with little variation), so there is no point in talking about the moon hemisphere.

Qu'est-ce que vous en pensez?

@iago-lito
Copy link
Contributor

All ok for me :) This fr line looks perfect, @chubin ton français lunaire ne laisse rien à désirer :P Thank you @martinbra for your PR, I appreciate that you honour the moon, and please ping me if I've forgotten something (or whenever you need).

(I believe, it would be very an interesting experience to live in the world, where Github, and in general the software developers lingua-franca is French; sort of the world of Jules Verne; very very cool :)

(I'm not sure I'm getting you on this one. Do you mean you would like it if the OSS community default language were French instead of English, because it is so romantic? Yeah, that would definitely be cool :)

@martinbra
Copy link

martinbra commented Sep 29, 2020

Thanks @iago-lito , would you like to write about the hemispheres warning to be included in the documentation? Look at the pyphoon README.md and see how we can benefit from a hearthwarming explanation. :)

I've updated it on my branch, if you want to see the latest version.

@chubin
Copy link
Owner

chubin commented Sep 29, 2020

Looks good to me. Let's merge it, deploy it and see how it looks like live
(by the way, we have full Moon now, so that there is no difference in what hemisphere we are)

@martinbra
Copy link

Thanks. I will update the PR.
Oh, there is a difference. It will be upside down here in the southern hemisphere...

@iago-lito
Copy link
Contributor

iago-lito commented Sep 30, 2020

@martinbra Okay, I'm having a look at this file (although I'm too lazy to open a PR, maybe I can just post a draft here ? 0:)

I see only 3 relevant lines. My intent is to flesh them so they feel both informative and crystal clear.

  -s {north,south}, --hemisphere {north,south}
                        Hemisphere from where to show moon. North by default

-> 


  -s {north,south}, --hemisphere {north,south}
                        Earth hemisphere from which to observe the Moon. Defaults to north.
The Moon can be shown as seen from both the northern (default) and southern hemisphere.

->

Pyphoon only displays the [near side](https://en.wikipedia.org/wiki/Near_side_of_the_Moon) of the Moon
because the [far side](https://en.wikipedia.org/wiki/Far_side_of_the_Moon) is never visible from Earth.
This said, the near side either shows North pole up
(for people living in northern Earth hemisphere)
or South pole up
(for people living in southern Earth hemisphere).
This in turn changes the direction of the observable crescent:
*e.g.* 🌒 or 🌘 for the first quarter.
To accomodate this, pyphoon draws the moon either side on request,
defaulting to `-S north`ern hemisphere.
If you happen to live in equatorial zones,
then the Moon shows either side up
depending on [how you rotate your feet](https://www.unicode.org/L2/L2017/17304-moon-var.pdf),
so you only need to pick the one you like most.
- Hemisphere from where the moon was displayed (if the -S switch is used).

->

- Hemisphere from which the moon is observed (with `-S` switch on).

What do you think ? :)

@iago-lito
Copy link
Contributor


I bet someone will come up in the next few months with a feature request that pyphoon should also draw the far side on demand :P

@martinbra
Copy link

@iago-lito Thanks for your work! Very well explained. Do you want me to commit it? I have some considerations below:

-s {north,south}, --hemisphere {north,south}
Earth hemisphere from which to observe the Moon. Defaults to north.

I liked it. I would only keep North by default. to be aligned with the other commands "default grammar".

defaulting to -S northern hemisphere

Actually it defaults to -s northern hemisphere, without the warning text. Maybe on wttr.in/moon it will default to -S.

I bet someone will come up in the next few months with a feature request that pyphoon should also draw the far side on demand :P

In this case we will politely ask them to provide the relevant ASCII art in all the needed sizes 0:)

@martinbra
Copy link

@iago-lito , I was re-reading your sugestions, and would like to exchange some ideas. What do you think of the following?

To accomodate this, pyphoon draws the moon either side on request,
defaulting to -S northern hemisphere.

Shouldn't it be either pole up on request? (to avoid misunderstanding with near/far side). Or even better, since -s says Earth hemisphere from which to observe the Moon, what about draws the moon as seen from either hemisphere on request ?

then the Moon shows either side up

change to -> then the Moon shows either *pole* up

I think it would clarify even further.

@iago-lito
Copy link
Contributor

@martinbra Yupe, okay to all :)

  • North by default is fine

  • -s northern instead of -S north

  • "either side" is ambiguous indeed, I like your "either pole up", neat :)

Don't hesitate to commit if you like it now :)

@chubin
Copy link
Owner

chubin commented Oct 4, 2020

What is open here? Only the translations or something else?
I think we should release it and check reaction of our Australian users :)

@martinbra
Copy link

Oh, sorry @chubin we ended up talking about pyphoon here. You can close this issue.

@Gy0m Gy0m closed this as completed May 12, 2024
@Gy0m
Copy link
Author

Gy0m commented May 12, 2024

i was right
but i'm sorry to drop the conversation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants