ARTS 2.5.4 (git: 31ce4f0e)
m_star.cc
Go to the documentation of this file.
1/* Copyright (C) 2021
2 Jon Petersen <jon.petersen@studium.uni-hamburg.de>
3 Manfred Brath <manfred.brath@uni-hamburg.de>
4
5 This program is free software; you can redistribute it and/or modify it
6 under the terms of the GNU General Public License as published by the
7 Free Software Foundation; either version 2, or (at your option) any
8 later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
18 USA. */
19
20/*===========================================================================
21 === File description
22 ===========================================================================*/
23
24#include "messages.h"
25#include "physics_funcs.h"
26#include "arts.h"
27#include "auto_md.h"
28#include "star.h"
29
30
44using Constant::pi;
45
46/*===========================================================================
47 === The functions
48 ===========================================================================*/
49
50/* Workspace method: Doxygen documentation will be auto-generated */
52 Index &stars_do,
53 // Inputs:
54 const Vector &f_grid,
55 const Index &stokes_dim,
56 const Numeric &radius,
57 const Numeric &distance,
58 const Numeric &temperature,
59 const Numeric &latitude,
60 const Numeric &longitude,
61 const Verbosity &) {
62
63 // some sanity checks
64 ARTS_USER_ERROR_IF (distance<radius,
65 "The distance to the center of the star (",distance," m) \n"
66 " is smaller than the radius of the star (", radius," m )")
67
68 Star& new_star = stars.emplace_back();
69
70 // spectrum
71 new_star.spectrum=Matrix(f_grid.nelem(), stokes_dim,0. );
72
73 planck(new_star.spectrum(joker,0), f_grid, temperature);
74 new_star.spectrum *= pi ; // outgoing flux at the surface of the star.
75
76
77 new_star.description = "Blackbody star" ;
78 new_star.radius = radius;
79 new_star.distance = distance;
80 new_star.latitude = latitude;
81 new_star.longitude = longitude;
82
83 // set flag
84 stars_do = 1;
85}
86
87/* Workspace method: Doxygen documentation will be auto-generated */
89 Index &stars_do,
90 // Inputs:
91 const Vector &f_grid,
92 const Index &stokes_dim,
93 const GriddedField2& star_spectrum_raw,
94 const Numeric &radius,
95 const Numeric &distance,
96 const Numeric &temperature,
97 const Numeric &latitude,
98 const Numeric &longitude,
99 const String &description,
100 const Verbosity &verbosity) {
101
102 // some sanity checks
103 ARTS_USER_ERROR_IF (distance<radius,
104 "The distance to the center of the star (",distance," m) \n"
105 " is smaller than the radius of the star (", radius," m )")
106
107 // interpolate field
108 Matrix int_data = regrid_star_spectrum(star_spectrum_raw, f_grid, stokes_dim, temperature, verbosity);
109
110 // create star
111 Star& new_star = stars.emplace_back();
112
113 new_star.spectrum = int_data; // set spectrum
114 new_star.spectrum *= pi; // outgoing flux at the surface of the star.
115
116 new_star.description = description;
117 new_star.radius = radius;
118 new_star.distance = distance;
119 new_star.latitude = latitude;
120 new_star.longitude = longitude;
121
122 // set flag
123 stars_do = 1;
124
125}
126
127void starsOff(Index &stars_do,
128 ArrayOfStar &stars,
129 const Verbosity &){
130
131 // set flag to False (default)
132 stars_do = 0;
133
134 // create empty Array of Matrix for the star_spectrum
135 stars.resize(0);
136
137}
The global header file for ARTS.
This can be used to make arrays out of anything.
Definition: array.h:48
Index nelem() const noexcept
Returns the number of elements.
Definition: matpackI.h:536
The Matrix class.
Definition: matpackI.h:1261
The Vector class.
Definition: matpackI.h:899
#define ARTS_USER_ERROR_IF(condition,...)
Definition: debug.h:134
void starsOff(Index &stars_do, ArrayOfStar &stars, const Verbosity &)
WORKSPACE METHOD: starsOff.
Definition: m_star.cc:127
void starsAddSingleBlackbody(ArrayOfStar &stars, Index &stars_do, const Vector &f_grid, const Index &stokes_dim, const Numeric &radius, const Numeric &distance, const Numeric &temperature, const Numeric &latitude, const Numeric &longitude, const Verbosity &)
WORKSPACE METHOD: starsAddSingleBlackbody.
Definition: m_star.cc:51
void starsAddSingleFromGrid(ArrayOfStar &stars, Index &stars_do, const Vector &f_grid, const Index &stokes_dim, const GriddedField2 &star_spectrum_raw, const Numeric &radius, const Numeric &distance, const Numeric &temperature, const Numeric &latitude, const Numeric &longitude, const String &description, const Verbosity &verbosity)
WORKSPACE METHOD: starsAddSingleFromGrid.
Definition: m_star.cc:88
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
const Joker joker
Declarations having to do with the four output streams.
constexpr Numeric pi
The following mathematical constants are generated in python Decimal package by the code:
Numeric radius(const Numeric h, const Numeric lat, const Numeric lon, const Numeric a, const Numeric e) ARTS_NOEXCEPT
Get the radius from ellipsoidal coordinates.
Definition: igrf13.cc:222
invlib::Matrix< ArtsMatrix > Matrix
invlib wrapper type for ARTS matrices.
Definition: oem.h:33
Numeric planck(const Numeric &f, const Numeric &t)
planck
This file contains declerations of functions of physical character.
Matrix regrid_star_spectrum(const GriddedField2 &star_spectrum_raw, const Vector &f_grid, const Index &stokes_dim, const Numeric &temperature, const Verbosity &verbosity)
regrid_star_spectrum
Definition: star.cc:466
Declaration of functions in star.cc.
The structure to describe a propagation path and releated quantities.
Definition: star.h:58
Numeric latitude
latitude of the star in the sky of the planet
Definition: star.h:68
String description
star description
Definition: star.h:60
Numeric radius
Star radius.
Definition: star.h:64
Matrix spectrum
Star spectrum, monochrmatic radiance spectrum at the surface of the star.
Definition: star.h:62
Numeric distance
star distance from center of planet to center of star
Definition: star.h:66
Numeric longitude
longitude of the star in the sky of the planet
Definition: star.h:70