Skip to content

Add analemma layer#61

Draft
Carifio24 wants to merge 4 commits into
cosmicds:mainfrom
Carifio24:analemma
Draft

Add analemma layer#61
Carifio24 wants to merge 4 commits into
cosmicds:mainfrom
Carifio24:analemma

Conversation

@Carifio24

Copy link
Copy Markdown
Member

This PR adds functionality for creating a layer representing an analemma. Currently the analemma can be created with a few options:

  • Calendar year to use. In general this could be from any yearlong window, but I just made it a calendar year to start to keep things simple
  • When during the day to determine the alt/az of the Sun, represented as a fraction of 24 hours.
  • How many days between points - decreasing this number will increase the point density of the layer

Right now this layer is connected to the current location - when the location is changed, the underlying alt/az positions will be recauclated.

There is one issue with this - I imagine that the analemma is more useful as something represented relative to the horizon (i.e. in alt/az space), but WWT wants positions in RA/Dec. This means that we need to recalculate the RA/Dec on each frame. When the engine is playing this doesn't look too bad, but it can be slightly jumpy when moving the time slider.

Finally, this doesn't take daylight savings into account at all - the analemma points are all 24 hours apart, without any adjustment when the time zone for a given location changes. Not sure how/if we want to consider that.

CC @patudom

@johnarban

Copy link
Copy Markdown
Contributor

It looks like you are doing it correctly, at least consistently, to me. The analemma shows the difference between clock time and solar time. Since you start on the first of the year, then at least for the US, your implementation of just skipping for 86,400,000 ms at a time should keep you inline with UTC. Some southern hemisphere places seem to do daylight savings in the winter.

So the only change I might make would be to createAnalemmaAltAz to specifically use Date.UTC to make the starting date, new Date(Date.UTC(options.year, 0)), and then to integrate the timezone by subtracting getTimezoneOffset(selectedTimezone.value, start) from time where it is declared. this doesn't fix the southern hemisphere issue though

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

Successfully merging this pull request may close these issues.

2 participants