52 const Index& apply_tfit,
63 const Index n_xsec = abs_xsec_per_species.
nelem();
65 if (n_tgs != n_xsec) {
67 os <<
"The following variables must all have the same dimension:\n" 68 <<
"abs_species: " << n_tgs <<
"\n" 69 <<
"abs_xsec_per_species: " << n_xsec;
70 throw runtime_error(os.
str());
110 os <<
"The following variables must all have the same dimension:\n" 111 <<
"abs_p: " << n_p <<
"\n" 113 throw runtime_error(os.
str());
125 if (do_freq_jac) dxsec_temp_dF.
resize(f_grid.
nelem());
131 bool do_abort =
false;
136 for (
Index ii = 0; ii < abs_species_active.
nelem(); ii++) {
137 const Index i = abs_species_active[ii];
139 for (
Index s = 0; s < abs_species[
i].
nelem(); s++) {
140 const SpeciesTag& this_species = abs_species[
i][s];
146 out0 <<
"HITRAN XSEC Warning: No FFTW library support enabled, " 147 <<
"convolution will be extremely slow\n";
150 Index this_xdata_index =
152 if (this_xdata_index < 0) {
154 os <<
"Cross-section species " << this_species.
Name()
155 <<
" not found in *hitran_xsec_data*.";
156 throw std::runtime_error(os.
str());
158 const XsecRecord& this_xdata = hitran_xsec_data[this_xdata_index];
159 Matrix& this_xsec = abs_xsec_per_species[
i];
160 ArrayOfMatrix& this_dxsec = do_jac ? dabs_xsec_per_species_dx[
i] : empty;
163 #pragma omp parallel for if (!arts_omp_in_parallel() && abs_p.nelem() >= 1) \ 164 firstprivate(xsec_temp, dxsec_temp_dF) 165 for (
Index ip = 0; ip < abs_p.
nelem(); ip++) {
166 if (do_abort)
continue;
167 const Numeric current_p = force_p < 0 ? abs_p[ip] : force_p;
168 const Numeric current_t = force_t < 0 ? abs_t[ip] : force_t;
173 xsec_temp, f_grid, current_p, current_t, apply_tfit, verbosity);
175 this_xdata.Extract(dxsec_temp_dF,
185 }
catch (runtime_error& e) {
187 os <<
"Problem with HITRAN cross section species " 188 << this_species.
Name() <<
" at pressure level " << ip <<
" (" 189 << abs_p[ip] / 100. <<
" hPa):\n" 191 #pragma omp critical(abs_xsec_per_speciesAddHitranXsec) 194 fail_msg.push_back(os.
str());
200 this_xsec(
joker, ip) += xsec_temp;
202 for (
Index iv = 0; iv < xsec_temp.nelem(); iv++) {
203 this_xsec(iv, ip) += xsec_temp[iv];
204 for (
Index iq = 0; iq < jac_pos.
nelem(); iq++) {
206 this_dxsec[iq](iv, ip) +=
207 (dxsec_temp_dF[iv] - xsec_temp[iv]) / df;
211 else if (jacobian_quantities[jac_pos[iq]] ==
215 this_dxsec[iq](iv, ip) += xsec_temp[iv];
232 os <<
"Error messages from failures:\n";
233 for (
const auto& msg : fail_msg) {
236 throw std::runtime_error(os.str());
INDEX Index
The type to use for all integer numbers and indices.
ArrayOfIndex equivalent_propmattype_indexes(const ArrayOfRetrievalQuantity &js)
Returns a list of positions for the derivatives in Propagation Matrix calculations.
Index nelem() const
Number of elements.
String Name() const
Return the full name of the tag.
Declarations having to do with the four output streams.
Index Species() const
Molecular species index.
Index Type() const
Return the type of this tag.
Numeric frequency_perturbation(const ArrayOfRetrievalQuantity &js) noexcept
Returns the frequency perturbation if it exists.
This file contains basic functions to handle XML data files.
Index nelem() const
Returns the number of elements.
bool is_frequency_parameter(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a frequency parameter in propagation matrix calculations.
The global header file for ARTS.
bool supports_hitran_xsec(const ArrayOfRetrievalQuantity &js)
Returns if the array supports HITRAN cross-section derivatives.
_CS_string_type str() const
Methods and classes for HITRAN absorption cross section data.
A tag group can consist of the sum of several of these.
NUMERIC Numeric
The type to use for all floating point numbers.
Declarations required for the calculation of absorption coefficients.
bool species_match(const RetrievalQuantity &rq, const ArrayOfSpeciesTag &ast)
Returns if the Retrieval quantity is VMR derivative for all the species in the species tags...
basic_ostringstream< char, string_char_traits< char >, alloc > ostringstream
This can be used to make arrays out of anything.
void resize(Index n)
Resize function.
Index hitran_xsec_get_index(const ArrayOfXsecRecord &xsec_data, const Index species)
Get the index in hitran_xsec_data for the given species.
void abs_xsec_per_speciesAddHitranXsec(ArrayOfMatrix &abs_xsec_per_species, ArrayOfArrayOfMatrix &dabs_xsec_per_species_dx, const ArrayOfArrayOfSpeciesTag &abs_species, const ArrayOfRetrievalQuantity &jacobian_quantities, const ArrayOfIndex &abs_species_active, const Vector &f_grid, const Vector &abs_p, const Vector &abs_t, const ArrayOfXsecRecord &hitran_xsec_data, const Index &apply_tfit, const Numeric &force_p, const Numeric &force_t, const Verbosity &verbosity)
WORKSPACE METHOD: abs_xsec_per_speciesAddHitranXsec.
const Numeric SPEED_OF_LIGHT
bool do_frequency_jacobian(const ArrayOfRetrievalQuantity &js) noexcept
Returns if the array wants a frequency derivative.
This file contains declerations of functions of physical character.