Skip to content

Commit 251bdbf

Browse files
committed
Merge branch 'develop-basic' of cau-git.rz.uni-kiel.de:astrophysik/ag-wolf/polaris into develop-basic
2 parents 19381cc + 5f5b3b5 commit 251bdbf

File tree

4 files changed

+31
-7
lines changed

4 files changed

+31
-7
lines changed

src/Detector.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ void CDetector::init(string _path,
5555
nr_spectral_bins = _nr_spectral_bins;
5656

5757
wavelength_list_det.resize(nr_spectral_bins);
58-
CMathFunctions::LogList(lam_min, lam_max, wavelength_list_det, 10);
58+
if(USE_LOG_SPACING)
59+
{CMathFunctions::LogList(lam_min, lam_max, wavelength_list_det, 10);}
60+
else
61+
{CMathFunctions::LinearList(lam_min, lam_max, wavelength_list_det);}
5962

6063
sedI = new double[nr_spectral_bins];
6164
sedQ = new double[nr_spectral_bins];

src/Detector.hpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,10 @@ class CDetector
158158
nr_extra = _nr_extra;
159159

160160
wavelength_list_det.resize(nr_spectral_bins);
161-
CMathFunctions::LogList(lam_min, lam_max, wavelength_list_det, 10);
161+
if(USE_LOG_SPACING)
162+
{CMathFunctions::LogList(lam_min, lam_max, wavelength_list_det, 10);}
163+
else
164+
{CMathFunctions::LinearList(lam_min, lam_max, wavelength_list_det);}
162165

163166
sedI = new double[nr_extra * nr_spectral_bins];
164167
sedQ = new double[nr_extra * nr_spectral_bins];
@@ -246,7 +249,10 @@ class CDetector
246249
nr_extra = _nr_extra;
247250

248251
wavelength_list_det.resize(nr_spectral_bins);
249-
CMathFunctions::LogList(lam_min, lam_max, wavelength_list_det, 10);
252+
if(USE_LOG_SPACING)
253+
{CMathFunctions::LogList(lam_min, lam_max, wavelength_list_det, 10);}
254+
else
255+
{CMathFunctions::LinearList(lam_min, lam_max, wavelength_list_det);}
250256

251257
sedI = new double[nr_extra * nr_spectral_bins];
252258
sedQ = new double[nr_extra * nr_spectral_bins];

src/DustMixture.cpp

+16-4
Original file line numberDiff line numberDiff line change
@@ -347,9 +347,15 @@ void CDustMixture::printParameters(parameters & param, CGridBasic * grid)
347347
uint pos = i / NR_OF_RAY_DET;
348348

349349
if(uint(dust_ray_detectors[i + 2]) > 1)
350-
cout << "- Emission detetector " << (pos + 1) << " : from " << dust_ray_detectors[i + 0]
350+
{if(USE_LOG_SPACING)
351+
{cout << "- Emission detetector " << (pos + 1) << " : from " << dust_ray_detectors[i + 0]
351352
<< " [m] to " << dust_ray_detectors[i + 1] << " [m] with "
352-
<< uint(dust_ray_detectors[i + 2]) << " logarithmic values" << endl;
353+
<< uint(dust_ray_detectors[i + 2]) << " logarithmic values" << endl;}
354+
else
355+
{cout << "- Emission detetector " << (pos + 1) << " : from " << dust_ray_detectors[i + 0]
356+
<< " [m] to " << dust_ray_detectors[i + 1] << " [m] with "
357+
<< uint(dust_ray_detectors[i + 2]) << " linear values" << endl;}
358+
}
353359
else if(uint(dust_ray_detectors[i + 2]) == 1)
354360
cout << "- Emission detetector " << (pos + 1) << " : " << dust_ray_detectors[i + 0]
355361
<< " [m]" << endl;
@@ -372,9 +378,15 @@ void CDustMixture::printParameters(parameters & param, CGridBasic * grid)
372378
uint pos = i / NR_OF_MC_DET;
373379

374380
if(uint(dust_mc_detectors[i + 2]) > 1)
375-
cout << "- Scattering detetector " << (pos + 1) << " : from " << dust_mc_detectors[i + 0]
381+
{if(USE_LOG_SPACING)
382+
{cout << "- Scattering detetector " << (pos + 1) << " : from " << dust_mc_detectors[i + 0]
376383
<< " [m]) to " << dust_mc_detectors[i + 1] << " [m]) with "
377-
<< uint(dust_mc_detectors[i + 2]) << " logarithmic values" << endl;
384+
<< uint(dust_mc_detectors[i + 2]) << " logarithmic values" << endl;}
385+
else
386+
{cout << "- Scattering detetector " << (pos + 1) << " : from " << dust_mc_detectors[i + 0]
387+
<< " [m]) to " << dust_mc_detectors[i + 1] << " [m]) with "
388+
<< uint(dust_mc_detectors[i + 2]) << " linear values" << endl;}
389+
}
378390
else if(uint(dust_mc_detectors[i + 2]) == 1)
379391
cout << "- Scattering detetector " << (pos + 1) << " : " << dust_mc_detectors[i + 0]
380392
<< " [m]" << endl;

src/Typedefs.hpp

+3
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,9 @@ using namespace std;
305305
// multiple scattering at dust grains
306306
#define SCATTERED_DUST_2 3
307307

308+
// Wavelength spacing for single detector (1 = logarithmic, 0 = linear)
309+
#define USE_LOG_SPACING 1
310+
308311
// Type of emission
309312
#define RESULTS_RAY 0
310313
#define RESULTS_MC 1

0 commit comments

Comments
 (0)