benyamindsmith / starBliss

Create beautiful, print quality maps of the night sky in R
43 stars 2 forks source link

More accurate rotation #10

Closed dieghernan closed 1 year ago

dieghernan commented 1 year ago

Fix #9

Following #7 and #9 this PR computes the rotation of the projection (lon) as per d3-celestial:

https://github.com/ofrohn/d3-celestial/blob/7e720a3de062059d4c5400a379146a601d9010e0/celestial.js#L1215-L1250

Again, MapsForMoments is incorrect, for a given day provides the star position as per 22:00 UTC (see post on #7 for more info), but this PR would replicate exactly their results:

https://mapsformoments.co.uk/modules/starnameregistry/js/map-builder.js?v=d3

                'copies': '1',
                'deliveryOption': 'post',
                'selectedHour': '22',
                'selectedMinute': '00',
                'message': '',
                'message1': '',
                'message2': '',
                'hours': hours,
                'minutes': minutes,
dieghernan commented 1 year ago

See comparisons:

9

plot_starmap( "Riyadh, Saudi Arabia",
              date = "2023-02-14")

image

dieghernan commented 1 year ago

5

plot_starmap( "Caracas",
              date = "1992-02-29")

image

benyamindsmith commented 1 year ago

@dieghernan Wow! Thank you! I saw your answer on the GIS StackExchange but I didn't get a chance to look over your answer!

I'm flattered that you took the time to contribute to the package and implementing the get_mst() function you authored. Also good catch for making a utils.R file.

Your PR looks good as far as I can tell. Thank you again!