Packages

o

o1.stars.io

SkyFiles

object SkyFiles

This singleton object has utilities for handling files that specify the locations of stars and (optionally) constellations on a star map.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SkyFiles
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. val DefaultStarListFile: String

    The default name of the file within a star map folder that contains a list of all the visible stars.

  2. def parseStarInfo(starAsString: String): Star

    Given a single-line description of a star in a particular format, creates and returns a Star object.

    Given a single-line description of a star in a particular format, creates and returns a Star object. The given string consists of six or seven parts separated by semicolons. Here is an example with seven parts:

    0.020891;0.991435;0.128917;39801;0.45;2061;BETELGEUSE

    The parts are, in order:

    1. the x coordinate of the star 2. the y coordinate of the star 3. the z coordinate of the star (ignored by this method) 4. the Henry Draper number of the star (used by this method as the star's ID) 5. the magnitude of the star 6. the Harvard Revised number of the star (an alternative ID ignored by this method) 7. (optional; may be missing) the name of the star

    This method assumes that the first six parts will appear in any input provided. If the optional seventh part is missing, as in the example below, the star is unnamed.

    0.015817;0.296915;-0.954773;39810;6.54;2062

    starAsString

    a star described in six or seven semicolon-separated parts

  3. def readStarMap(starMapFolder: String, starListFileName: String = DefaultStarListFile): Option[StarMap]

    Reads in a star map from the files in a given folder.

    Reads in a star map from the files in a given folder. The folder is expected to contain at least a file that lists all the visible stars (one per line as specified under parseStarInfo). If there are any other files in the folder, each of those files is expected to define a constellation: the name of the file names the constellation, and each line of text within specifies a single line of the constellation by listing the names of two stars separated by a comma.

    starMapFolder

    a path to a folder that contains the files that specify a star map

    starListFileName

    the name of file within the folder that lists all the stars; defaults to DefaultStarListFile