本文整理汇总了C++中Units::obolsurfacebrightness方法的典型用法代码示例。如果您正苦于以下问题:C++ Units::obolsurfacebrightness方法的具体用法?C++ Units::obolsurfacebrightness怎么用?C++ Units::obolsurfacebrightness使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Units
的用法示例。
在下文中一共展示了Units::obolsurfacebrightness方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: calibrateAndWriteDataCubes
void SingleFrameInstrument::calibrateAndWriteDataCubes(QList< Array*> farrays, QStringList fnames)
{
WavelengthGrid* lambdagrid = find<WavelengthGrid>();
int Nlambda = lambdagrid->Nlambda();
// calibration step 1: conversion from bolometric luminosities (units W) to monochromatic luminosities (units W/m)
for (int ell=0; ell<Nlambda; ell++)
{
double dlambda = lambdagrid->dlambda(ell);
for (int i=0; i<_Nxp; i++)
{
for (int j=0; j<_Nyp; j++)
{
int m = i + _Nxp*j + _Nxp*_Nyp*ell;
foreach (Array* farr, farrays)
{
(*farr)[m] /= dlambda;
}
}
}
}
// calibration step 2: correction for the area of the pixels of the images; the units are now W/m/sr
double xpresang = 2.0*atan(_xpres/(2.0*_distance));
double ypresang = 2.0*atan(_ypres/(2.0*_distance));
double area = xpresang*ypresang;
foreach (Array* farr, farrays)
{
(*farr) /= area;
}
// calibration step 3: conversion of the flux per pixel from monochromatic luminosity units (W/m/sr)
// to flux density units (W/m3/sr) by taking into account the distance
double fourpid2 = 4.0*M_PI*_distance*_distance;
foreach (Array* farr, farrays)
{
(*farr) /= fourpid2;
}
// conversion from program SI units (at this moment W/m3/sr) to the correct output units;
// we use lambda*flambda for the surface brightness (in units like W/m2/arcsec2)
Units* units = find<Units>();
for (int ell=0; ell<Nlambda; ell++)
{
double lambda = lambdagrid->lambda(ell);
for (int i=0; i<_Nxp; i++)
{
for (int j=0; j<_Nyp; j++)
{
int m = i + _Nxp*j + _Nxp*_Nyp*ell;
foreach (Array* farr, farrays)
{
(*farr)[m] = units->obolsurfacebrightness(lambda*(*farr)[m]);
}
}
}
}