AstronomyAPI / Samples

Examples for Astronomy API
https://astronomyapi.com
MIT License
30 stars 3 forks source link

Moonphase rotated #18

Closed Romkabouter closed 2 years ago

Romkabouter commented 3 years ago

Hi there,

I was investigating the moonphase api and the image looks nice. However, the moonphase seems to be rotated. The Last Quarter is show as First Quarter and also all other phase look incorrectly rotated. It seems that the image has northern and southern hemisfere switched

astroanu commented 3 years ago

Hi, thanks for noticing this. Will take a look.

Romkabouter commented 3 years ago

Thanks, I also noticed the phase is called Wanning Crescent instead of Waning :)

astroanu commented 3 years ago

Hi, the calculations are based on an observer facing south, so it's similar to looking at a star chart. Can you compare again with stellarium's results ?

astroanu commented 3 years ago

Thanks, I also noticed the phase is called Wanning Crescent instead of Waning :)

i've fixed the typo

Romkabouter commented 3 years ago

stellarium's image

Generated with api: https://widgets.astronomyapi.com/moon-phase/generated/402a266de480117c0e52b8e72b5d5178a206295ff7d615d7e51ae7a3753fcad1.svg

image

astroanu commented 3 years ago

Could you send me the payload you're sending. It seems to be something related to your lat,long.

Romkabouter commented 3 years ago

This is my payload:

payload = {     "format": "svg",     "style": {         "moonStyle": "default",         "backgroundStyle": "solid",         "backgroundColor": "none",         "headingColor": "white",         "textColor": "red"     },     "observer": {         "longitude": xxxxxxxxxx,         "latitude": xxxxxxxxxxxxxx,         "date": "2021-03-08"     },     "view": {         "type": "portrait-simple"     } }

astroanu commented 3 years ago

I'm not sure what exactly was the problem but these are the images i generated. All i did was clear the cdn cache.

https://widgets.astronomyapi.com/moon-phase/generated/402a266de480117c0e52b8e72b5d5178a206295ff7d615d7e51ae7a3753fcad1.svg

https://widgets.astronomyapi.com/moon-phase/generated/c24464410b717824057e6eb52c1242bb49040df6aeee7ab4f582b7aa99cd0e15.png

btw svg images has an alignment issue we're aware.

Romkabouter commented 3 years ago

That is mighty strange, looks good to me!

I have tried calling it again and now generates the correct image :) https://widgets.astronomyapi.com/moon-phase/generated/402a266de480117c0e52b8e72b5d5178a206295ff7d615d7e51ae7a3753fcad1.svg

Thanks for the help!

astroanu commented 3 years ago

hey, must be something with the cache key. i'll take a look later. happy to help. :)

astroanu commented 2 years ago

Hi, I have added a new parameter to change the rotation of the moon as needed. Modify the view object to add the new parameter as follows: Valid values are either "north-up" or "south-up". The parameter is optional, default value is "north-up"

"view": {
    "type": "portrait-simple",
    "orientation": "north-up"
}