star-cem

Compute the position of the sun
git clone git://git.meso-star.com/star-cem.git
Log | Files | Refs | README | LICENSE

scem.1 (4629B)


      1 .\" Copyright (C) 2025 |Méso|Star> (contact@meso-star.com)
      2 .\"
      3 .\" This program is free software: you can redistribute it and/or modify
      4 .\" it under the terms of the GNU General Public License as published by
      5 .\" the Free Software Foundation, either version 3 of the License, or
      6 .\" (at your option) any later version.
      7 .\"
      8 .\" This program is distributed in the hope that it will be useful,
      9 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
     10 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     11 .\" GNU Lesser General Public License for more details.
     12 .\"
     13 .\" You should have received a copy of the GNU Lesser General Public License
     14 .\" along with this program. If not, see <http://www.gnu.org/licenses/>.
     15 .Dd October 17, 2025
     16 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
     17 .Dt SCEM 1
     18 .Os
     19 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
     20 .Sh NAME
     21 .Nm scem
     22 .Nd compute the position of the sun
     23 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
     24 .Sh SYNOPSIS
     25 .Nm
     26 .Op Fl DhVvr
     27 .Op Fl a Ar algo
     28 .Op Fl d Ar utc_date
     29 .Ar latitude
     30 .Ar longitude
     31 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
     32 .Sh DESCRIPTION
     33 .Nm
     34 computes the position of the sun relative to a given point on the Earth's
     35 surface, on a given date.
     36 .Pp
     37 The latitude must be in [-90, 90] degrees relative to the equator.
     38 It is positive towards the north.
     39 The longitude must be in [-180, 180] degrees relative to Greenwich.
     40 The angle is positive towards the east.
     41 .Pp
     42 The output depends on two options,
     43 .Fl D
     44 and
     45 .Fl V .
     46 If
     47 .Fl D
     48 is not provided,
     49 .No
     50 outputs the position of the sun in elevation and azimuth to the standard
     51 output with the following format:
     52 .Bd -literal -offset Ds
     53 "%f %f\\n", elevation, azimuth
     54 .Ed
     55 .Pp
     56 The elevation angle is in [-90, 90] degrees.
     57 It defines the elevation of the sun relative to the horizon.
     58 The azimuth angle is in [0, 360] degrees, with 0° indicating north,
     59 90° east,
     60 180° south,
     61 and 270° west.
     62 .Pp
     63 If
     64 .Fl V
     65 is provided,
     66 .Nm
     67 outputs the direction from the sun as a 3D vector to the standard output
     68 with the following format:
     69 .Bd -literal -offset Ds
     70 "%f %f %f\\n", vec[0], vec[1], vec[2]
     71 .Ed
     72 .Pp
     73 The options are as follows:
     74 .Bl -tag -width Ds
     75 .\""""""""""""""""""""""""""""""""""""""
     76 .It Fl a Ar algo
     77 Defines the algorithm to be used to calculate the position of the sun.
     78 By default, use the
     79 .Cm meeus
     80 algorithm.
     81 .Pp
     82 The solar position algorithms are as follows:
     83 .Bl -tag -width Ds
     84 .It Cm meeus
     85 The algorithm described in Jean Meeus' book,
     86 .Dq Astronomical Algorithms .
     87 .It Cm psa
     88 The algorithm developed by the
     89 .Dq Plataforma Solar de Almería .
     90 .El
     91 .\""""""""""""""""""""""""""""""""""""""
     92 .It Fl D
     93 Suppress the sun direction from the output.
     94 .It Fl d Ar utc_date
     95 Date on which the position of the sun is calculated at the specified
     96 location.
     97 Must be defined in Coordinated Universal Time
     98 .Pq UTC+00:00 .
     99 By default, use the local date.
    100 .Pp
    101 The date must be in the format
    102 .Dq YYYY-MM-DDThh:mm:ss ,
    103 i.e., as printed for the current date by the following date command:
    104 .Bd -literal -offset Ds
    105 date -u +"%Y-%m-%dT%H:%M:%S"
    106 .Ed
    107 .\""""""""""""""""""""""""""""""""""""""
    108 .It Fl h
    109 Output short help and exit.
    110 .\""""""""""""""""""""""""""""""""""""""
    111 .It Fl V
    112 Add the 3D vector from the sun to the observer to the output with the first,
    113 second and third components pointing east, north and up, respectively.
    114 .It Fl v
    115 Make
    116 .Nm
    117 verbose.
    118 .\""""""""""""""""""""""""""""""""""""""
    119 .It Fl r
    120 Output the solar direction in radians rather than degrees.
    121 Meaningless if
    122 .Fl D
    123 is defined.
    124 .El
    125 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    126 .Sh EXIT STATUS
    127 .Ex -std
    128 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    129 .Sh EXAMPLES
    130 Compute the current position of the sun for a latitude of 43.559962° north and a
    131 longitude of 1.468150° east.
    132 Output both the direction in radians and the corresponding 3D vector:
    133 .Bd -literal -offset Ds
    134 scem -V -r 43.559962 1.468150
    135 .Ed
    136 .Pp
    137 Same location as above, setting the observation date to October 21, 2015, at
    138 11:28:00 AM UTC+2.
    139 Output the 3D vector only:
    140 .Bd -literal -offset Ds
    141 scem -D -V -d 2015-10-21T09:28:00 43.559962 1.468150
    142 .Ed
    143 .\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    144 .Sh SEE ALSO
    145 .Rs
    146 .%A Jean Meeus
    147 .%B Astronomical Algorithms
    148 .%D 1991
    149 .Re
    150 .Rs
    151 .%A Manuel Blanco
    152 .%A Kypros Milidonis
    153 .%A Aristides Bonanos
    154 .%T PSA+ updated PSA sun position algorithm
    155 .%U https://github.com/CST-Modelling-Tools/Updated-PSA-sun-position-algorithm
    156 .%D 2025
    157 .Re