当前位置: 首页>>代码示例>>C++>>正文


C++ Units::obolsurfacebrightness方法代码示例

本文整理汇总了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]);
                }
            }
        }
    }
开发者ID:wsaftly,项目名称:SKIRT-1,代码行数:61,代码来源:SingleFrameInstrument.cpp


注:本文中的Units::obolsurfacebrightness方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。