Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including node-red-contrib-astrodata with all npm packages installed. Try it out:

node-red-contrib-astrodata lists no main file and has no index.js, so it can't be directly required. If this is a mistake, please let us know. It may however contain internal files that you can require manually:

// require("node-red-contrib-astrodata/[??]")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

node-red-contrib-astrodata v0.0.3

Nodes for calculation of sun and moon position, sunset, sunrise etc.

node-red-contrib-astrodata

NPM version

This package contains two node-red nodes to calculate astronomical data for a given position.

The implementation based on the algorithm of http://lexikon.astronomie.info/java/sunmoon/sunmoon.html. Thanks to Mr. Arnold Barmettler for permission to use these algorithms for these nodes.

Requirements

  • The nodes have no special reqirements and should work with node-red 0.12 and newer.

Description

Node astrodata dayvalues

The node astrodata dayvalues calculates astonomical data for the current day. Set longitude and Latitude of the place in decimal form and height of the place in meters in the properties dialog.

The msg object also contains the attributs

  • msg.sunAstronomicalTwilightMorning
  • msg.sunNauticalTwilightMorning
  • msg.sunCivilTwilightMorning
  • msg.sunRise, msg.sunTransit
  • msg.sunSet, msg.sunCivilTwilightEvening
  • msg.sunNauticalTwilightEvening
  • msg.sunAstronomicalTwilightEvening
  • msg.sunSign, msg.moonRise
  • msg.mondkulmination
  • msg.moonSet
  • msg.moonPhaseNumber
  • msg.moonPhase
  • msg.moonSign.

The msg object also contains the attributs

  • msg.sunDistance in km
  • msg.sunDistanceObserver in km
  • msg.sunDeclination in Grad
  • msg.sunAzimut in Grad
  • msg.sunAltitude in Grad
  • msg.sunDiameter
  • msg.moonDistance in km
  • msg.moonDistanceObserver in km
  • msg.moonDeclination in Grad
  • msg.moonAzimut in Grad
  • msg.moonAltitude in Grad
  • msg.moonDiameter and
  • msg.MoonAge in Grad

for the current time.

All other attributes ob the input msg object will be passed to the output msg object.

Node astrodata sunposition

The node astrodata sunposition calculates sun position for the current time. Set longitude and Latitude of the place in decimal form and height of the place in meters in the properties dialog.

Set longitude and Latitude of the place in decimal form in the properties dialog. The moon phases and star signs support different languages (english, german and french). Set the target language in the properties dialog. Field offset or in msg.offset allows the calculation for different dates. An numeric value changes the date relative from now (Whole numbers for days).

The msg object also contains the attributs

  • msg.sunDistance in km
  • msg.sunDistanceObserver in km
  • msg.sunDeclination in Grad
  • msg.sunAzimut in Grad
  • msg.sunAltitude in Grad
  • msg.sunDiameter
  • msg.moonDistance in km
  • msg.moonDistanceObserver in km
  • msg.moonDeclination in Grad
  • msg.moonAzimut in Grad
  • msg.moonAltitude in Grad
  • msg.moonDiameter
  • msg.MoonAge in Grad.

All other attributes ob the input msg object will be passed to the output msg object.

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free