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 is not the correct orientations for southern hemisphere #1

Open
dlangille opened this issue Apr 6, 2016 · 11 comments
Open

moon is not the correct orientations for southern hemisphere #1

dlangille opened this issue Apr 6, 2016 · 11 comments

Comments

@dlangille
Copy link

When in the southern hemisphere, the moon waxes and wanes in the opposite direction.

re: http://twitter.com/igor_chubin/status/717791483127066625

chubin pushed a commit that referenced this issue Nov 1, 2018
@martinbra
Copy link
Contributor

For showing the south hemisphere moon phases apparently it's only needed to rotate the moon drawing upside down and place the text accordingly.
So, I would like to propose 2 different steps:

  1. Prepare the upside down drawings (rotating the existing arrays with something as south=[a[::-1] for a in north[::-1]]) and add an optional command line argument -s --hemisphere [NORTH/SOUTH/AUTO] to show the moon upside down (auto to be implemented in step 2).
  2. Implement auto hemisphere detection by IP and/or localization as used in wttr.in/.

What are your thoughts on this?

@dlangille
Copy link
Author

That sounds good. Thank you.

@martinbra
Copy link
Contributor

oh, my mistake thinking it would only be needed to rotate the ascii art.
Look at the original and rotated moon:

             .---------.            
         .--'   o   .   `--.        
       .'@  @@@@@@    .   . `.      
     .'@@  @@@@@@@@  @@@@   . `.    
   .'    . @@@@@@@@ @@@@@@    . `.  
  / @@ o    @@@@@@.  @@@@    O   @\ 
  |@@@@              @@@@@@     @@| 
 / @@@@@   `.-.     @@@@@@@@  .  @@\ 
 |@ @@                @@@@@@ @@@   |
 \      @@    @   .()  @@   @@@@@  /
  |   @      @@@        @@@  @@@  | 
  \  .   @@  @\  .     .  @@    o / 
   `.   @@@@  _\ /    .      o  .'  
     `.  @@    ()--           .'    
       `.     / |      o    .'      
         `--./   .      .--'        
             `---------'           

rotated (look at the perimeter and the parentesis):

             '---------`
         '--.      .   /.--`
       '.    o      | /     .`
     '.           --)(    @@  .`
   '.  o      .    / \_  @@@@   .`
  / o    @@  .     .  \@  @@   .  \
  |  @@@  @@@        @@@      @   |
 /  @@@@@   @@  )(.   @    @@      \
 |   @@@ @@@@@@                @@ @|
 \@@  .  @@@@@@@@     .-.`   @@@@@ /
  |@@     @@@@@@              @@@@|
  \@   O    @@@@  .@@@@@@    o @@ /
   .` .    @@@@@@ @@@@@@@@ .    '.
     .` .   @@@@  @@@@@@@@  @@'.
       .` .   .    @@@@@@  @'.
         .--`   .   o   '--.
             .---------.

I will have to either swap some characters, like parentesis, or redo the ascii art.

I was thinking that keeping the art and making a swap table was better:

( --> )
) --> (
. --> `
` --> .
_ --> ^
' --> ,

which results in the following:

             ,---------.
         ,--`      `   /`--.
       ,`    o      | /     `.
     ,`           --()    @@  `.
   ,`  o      `    / \^  @@@@   `.
  / o    @@  `     `  \@  @@   `  \
  |  @@@  @@@        @@@      @   |
 /  @@@@@   @@  ()`   @    @@      \
 |   @@@ @@@@@@                @@ @|
 \@@  `  @@@@@@@@     `-`.   @@@@@ /
  |@@     @@@@@@              @@@@|
  \@   O    @@@@  `@@@@@@    o @@ /
   `. `    @@@@@@ @@@@@@@@ `    ,`
     `. `   @@@@  @@@@@@@@  @@,`
       `. `   `    @@@@@@  @,`
         `--.   `   o   ,--`
             `---------`

Which is not optimal, since some dots inside the moon have been replaced.

What are your thoughts on the matter?

@dlangille
Copy link
Author

My results are the same.

I started searching for flipping ascii art, but that was mostly table flipping. Next was: mirror ascii art

https://stackoverflow.com/questions/13112671/how-to-horizontally-mirror-ascii-art

@martinbra
Copy link
Contributor

Yeah, the issues are the same. Although rewriting every moon doesn't seen the smart thing to do, It's probably the best one can do to get a better outcome, to stay as faithful as possible to the original art.

What do you think @dlangille and @chubin ?

@chubin
Copy link
Owner

chubin commented Sep 16, 2020

@martinbra

I think that your last drawing with fixes was pretty good, and we should use it.
And for other cases (e.g. other moon sizes), we should just make the automatic flipping.
This program is not just some moonphase viewer, it is a port of the original program developed in 197x, almost 50 years ago, and so we wouldn't like to diverge from it substantively. That being said, I think it is ok to add some new features, especially if they are isolated in a separate modules.

I thik that you original plan #1 (comment) was pretty good, so let's do it. Please:

  1. Make the changes
  2. Open a PR with them
  3. It will be merged

Then we try to bind it to wttr.in as you said.

I think this feature is very important, at least it is steadily being requested from time to time since years

@chubin
Copy link
Owner

chubin commented Sep 18, 2020

#29 is merged now,

I've updated it on wttr.in, but it is not yet enabled in the wttr.in code

$ pyphoon -s south
                 ,	
             ,	
          ,	
       ,-	
      /	
    ,/	
   / 	
  / 	
  |	
 / 	 New Moon +
 | 	 0 21:17:30
 | 	 First Quarter -
 | 	 5 17:38:04
 \ 	
  |	
  \ 	
   \ 	
    `\	
      \	
       `-	
          `	
             `	
                 `

@chubin
Copy link
Owner

chubin commented Sep 18, 2020

I think, this issue can be closed now, and we can move to wttr.in:
chubin/wttr.in#247

@martinbra
Copy link
Contributor

I think so. Thanks Chubin.

@dlangille
Copy link
Author

I am happy with any solution. :)

@chubin chubin closed this as completed Sep 20, 2020
@chubin chubin reopened this Sep 28, 2020
@chubin
Copy link
Owner

chubin commented Sep 28, 2020

I've reopened the issue, because we want to add a note about the southern hemisphere in the output (chubin/wttr.in#247)

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

3 participants