亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? vislimit.cpp

?? This is a pgm can be used for astronomy
?? CPP
字號:
//----------------------------------------------------------------------------
// VisLimit - calculates the visual limiting magnitude
//
// Astro library based on open-source code from project pluto
//
// mark huss 11/2000
//----------------------------------------------------------------------------

/*
The computations for sky brightness and limiting magnitude can be
logically broken up into several pieces.  Some computations depend
on things that are constant for a given observing site and time:
the lunar and solar zenith distances,  the air masses to those objects,
the temperature and relative humidity,  and so forth.  For use in Guide,
I expect to compute brightness at many points in the sky,  while all
these other values hold constant.  So my first step (after putting
lat/lon and these other data into the BRIGHTNESS_DATA struct) is to
call the set_brightness_params() function.  This function does a lot
of "setup work",  figuring out the absorption per unit air mass at
various wavelengths from various causes (gas,  aerosol,  ozone),
the number of air masses to the sun and moon,  and so forth.

Once you've done all this,  you can call compute_sky_brightness() for
any point in the sky.  You do need to provide the zenith angle,  and the
angular distance of that point from the moon and sun.  The brightnesses
are returned in the brightness[] array.  The 'mask' value can be used to
specify which of the five bands is to be computed.  (For example,  if I
use this to make a realistic sky background,  I may just concern myself
with the V band... maybe with B and R if I want to attempt a colored sky.
In either case,  computing all five bands would be excessive.)

Next,  you can call compute_extinction( ) to set any or all of the five
extinction values.  Normally,  I wouldn't see much use for this data.
But you do need to have that data if you intend to call the
compute_limiting_mag( ) function.

All of what follows is adapted from Brad Schaefer's article and code
on pages 57-60,  May 1998 _Sky & Telescope_,  "To the Visual Limits".

NOTICE that I modified his test conditions.  He had the moon and sun
well below the horizon;  I found that this didn't make testing
contributions from those objects any easier,  so I put them where they
could contribute more brightness.

At some point when I have the time,  I'll break out the main( ) portion,
tack in the code for CCD mag limits on page 121 of the same magazine,
and make proper header files.

*/

#include <math.h>
#include <stdlib.h>
#include "VisLimit.h"

#define MAG_TO_BRIGHTNESS( X) (exp( -.4 * (X) * LOG_10))
#define BRIGHTNESS_TO_MAG( X) (-2.5 * log( X) / LOG_10)
#define PI 3.141592653589793
#define LOG_10 2.302585093

double VisLimit::computeAirMass( const double zenithAngle)
{
   double rval = 40., cosAng = cos( zenithAngle);

   if( cosAng > 0.)
      rval = 1. / (cosAng + .025 * exp( -11. * cosAng));

   return( rval);
}

double VisLimit::computeFFactor( double objDist)
{
   double objDistDegrees = objDist * 180. / PI;
   double rval, cosDist = cos( objDist);

   rval = 6.2e+7 / (objDistDegrees * objDistDegrees)
                        + exp( LOG_10 * (6.15 - objDistDegrees / 40.));
   rval += 229086. * (1.06 + cosDist * cosDist);  /* polarization term? */
   return( rval);
            /* Seen on lines 2210 & 2200 for the moon,  and on lines */
            /* 2320 & 2330 for the moon.  I've only foggy ideas what  */
            /* it means;  I think it attempts to compute the falloff in */
            /* scattered light from an object as a function of distance.  */
}

int VisLimit::setBrightnessParams(FixedBrightnessData& b)
{
  fixed = b;
  double monthAngle = (fixed.month - 3.) * PI / 6.;
  double kaCoeff, krCoeff, koCoeff, kwCoeff, moonElong;
  int i;

  krCoeff = .1066 * exp( -fixed.htAboveSeaInMeters / 8200.);
  kaCoeff = .1 * exp( -fixed.htAboveSeaInMeters / 1500.);
  if( fixed.relativeHumidity > 0.)
    {
    double humidityParam;

    if( fixed.relativeHumidity >= 100.)
        humidityParam = 1000000.;
    else
        humidityParam = 1. - .32 / log( fixed.relativeHumidity / 100.);
    kaCoeff *= exp( 1.33 * log( humidityParam));
    }
  if( fixed.latitude < 0.)
    kaCoeff *= 1. - sin( monthAngle);
  else
    kaCoeff *= 1. + sin( monthAngle);
  koCoeff = (3. + .4 * (fixed.latitude * cos( monthAngle) -
                    cos( 3. * fixed.latitude))) / 3.;
  kwCoeff = .94 * (fixed.relativeHumidity / 100.) *
                      exp( fixed.temperatureInC / 15.) *
                      exp( -fixed.htAboveSeaInMeters / 8200.);

  yearTerm = 1. + .3 * cos( 2. * PI * (fixed.year - 1992) / 11.);
  airMassMoon = computeAirMass( fixed.zenithAngMoon);
  airMassSun  = computeAirMass( fixed.zenithAngSun);
  moonElong = fixed.moonElongation * 180. / PI;
  lunarMag = -12.73 + moonElong * (.026 +
                          4.e-9 * (moonElong * moonElong * moonElong));
              /* line 2180 in B Schaefer code */
  for( i = 0; i < 5; i++)
    {
    static const double fourthPowerTerms[5] =
                      { 5.155601, 2.441406, 1., 0.381117, 0.139470 };
    static const double onePointThreePowerTerms[5] =
                      { 1.704083, 1.336543, 1., 0.730877, 0.527177 };
    static const double oz[5] = {0., 0., .031, .008, 0.};
    static const double wt[5] = {.074, .045, .031, .02, .015};

    kr[i] = krCoeff * fourthPowerTerms[i];
    ka[i] = kaCoeff * onePointThreePowerTerms[i];
    ko[i] = koCoeff * oz[i];
    kw[i] = kwCoeff * wt[i];

    k[i] = kr[i] + ka[i] + ko[i] + kw[i];
    c3[i] = MAG_TO_BRIGHTNESS( k[i] * airMassMoon);
            /* compute dropoff in lunar brightness from extinction: 2200 */
    c4[i] = MAG_TO_BRIGHTNESS( k[i] * airMassSun);
    }
  return( 0);
}


/* If all you want is the sky brightness,  all the data concerning */
/* separate air masses for gas, aerosols,  and ozone and such is   */
/* an unnecessary drain on computation.  So that's broken out as a */
/* separate process in computeExtinction(). */

int VisLimit::computeExtinction()
{
   double cosZenithAng = cos( angular.zenithAngle );
   double tval;
   int i;

   airMassGas =
               1. / (cosZenithAng + .0286 * exp( -10.5 * cosZenithAng));
   airMassAerosol =
               1. / (cosZenithAng + .0123 * exp( -24.5 * cosZenithAng));
   tval = sin( angular.zenithAngle ) / (1. + 20. / 6378.);
   airMassOzone = 1. / sqrt( 1. - tval * tval);
   for( i = 0; i < 5; i++)
      if( (mask >> i) & 1)
         extinction[i] = (kr[i] + kw[i]) * airMassGas +
                             ka[i] * airMassAerosol +
                             ko[i] * airMassOzone;
   return( 0);
}

double VisLimit::computeLimitingMag()
{
   double c1, c2, bl = brightness[2] / 1.11e-15;
   double th, tval, rval;

   if( bl > 1500.) {
     c1 = 4.4668e-9;
     c2 = 1.2589e-6;
   }
   else {
     c1 = 1.5849e-10;
     c2 = 1.2589e-2;
   }
   tval = 1. + sqrt( c2 * bl);
   th = c1 * tval * tval;        // brightness in foot-candles?
   rval = -16.57 + BRIGHTNESS_TO_MAG( th) - extinction[2];
   return( rval);
}

int VisLimit::computeSkyBrightness(AngularBrightnessData& abd)
{
   angular = abd;

   double sinZenith;
   double brightnessDrop2150, fs, fm;
   int i;

   double airMass = computeAirMass( angular.zenithAngle );
   sinZenith = sin( angular.zenithAngle );
   brightnessDrop2150 = .4 + .6 / sqrt( 1.0 - .96 * sinZenith * sinZenith);
   fm = computeFFactor( angular.distMoon );
   fs = computeFFactor( angular.distSun );

   for( i = 0; i < 5; i++)
      if( (mask >> i) & 1)
         {
         static const double bo[5] = {8.0e-14, 7.e-14, 1.e-13, 1.e-13, 3.e-13};
               /* Base sky brightness in each band */
         static const double cm[5] = {1.36, 0.91, 0.00, -0.76, -1.17 };
               /* Correction to moon's magnitude */
         static const double ms[5] = {-25.96, -26.09, -26.74, -27.26, -27.55 };
               /* Solar magnitude? */
         static const double mo[5] = {-10.93, -10.45, -11.05, -11.90, -12.70 };
               /* Lunar magnitude? */
         double bn = bo[i] * yearTerm, directLoss;
                        /* accounts for a 30% variation due to sunspots? */

         double brightnessMoon, twilightBrightness;
         double brightnessDaylight;

         directLoss = MAG_TO_BRIGHTNESS( k[i] * airMass);
         bn *= brightnessDrop2150;
                    /* Not sure what this is.. line 2150 in B Schaefer code */
         bn *= directLoss;
                   /* drop brightness to account for extinction: 2160 */

         if( fixed.zenithAngMoon < PI / 2.)      /* moon is above horizon */
            {
            brightnessMoon = MAG_TO_BRIGHTNESS( lunarMag + cm[i]
                                 - mo[i] + 43.27);
            brightnessMoon *= (1. - directLoss);
                  /* Maybe computing how much of the lunar light gets */
                  /* scattered?   2240 */
            brightnessMoon *= (fm * c3[i] + 440000. * (1. - c3[i]));
            }
         else
            brightnessMoon = 0.;

         twilightBrightness = ms[i] - mo[i] + 32.5 -
                           (90. - fixed.zenithAngSun * 180. / PI) -
                           angular.zenithAngle / (2 * PI * k[i]);
                  /* above is in magnitudes,  so gotta do this: */
         twilightBrightness = MAG_TO_BRIGHTNESS( twilightBrightness);
                  /* above is line 2280,  B Schaefer code */
         twilightBrightness *= 100. / (angular.distSun * 180. / PI);
         twilightBrightness *= 1. - MAG_TO_BRIGHTNESS( k[i]);
                  /* preceding line looks suspicious to me... line 2290 */
         brightnessDaylight = MAG_TO_BRIGHTNESS( ms[i] - mo[i] + 43.27);
                     /* line 2340 */
         brightnessDaylight *= (1. - directLoss);
                     /* line 2350 */
         brightnessDaylight *= fs * c4[i] + 440000. * (1. - c4[i]);
         if( brightnessDaylight > twilightBrightness)
            brightness[i] = bn + twilightBrightness + brightnessMoon;
         else
            brightness[i] = bn + brightnessDaylight + brightnessMoon;
#ifdef TEST_STATEMENTS
         if( i == 0)
            printf( "Brightnesses: %lg %lg %lg %lg\n", bn,
                  brightnessMoon, twilightBrightness, brightnessDaylight);
#endif
         }
   return( 0);
}

#ifdef TEST_PROGRAM
#include <stdio.h>

int main( int argc, char **argv)
{
   if (argc < 2) {
     fprintf( stderr, "usage: %s <zenith angle>\n", argv[0] );
     return 1;
   }
   FixedBrightnessData f;
   AngularBrightnessData a;
   VisLimit v;
   int i;

   f.zenithAngMoon = 40. * PI / 180.;
   f.zenithAngSun = 100. * PI / 180.;
   f.moonElongation = 180. * PI / 180.;        // full moon
   f.htAboveSeaInMeters = 1000.;
   f.latitude = 30. * PI / 180.;
   f.temperatureInC = 15.;
   f.relativeHumidity = 40.;
   f.year = 2000.;
   f.month = 11.;
   v.setBrightnessParams(f);

   // values varying across the sky:
   a.zenithAngle = atof( argv[1]) * PI / 180.;
   a.distMoon = 50. * PI / 180.;
   a.distSun = 40. * PI / 180.;

   v.setMask(31);

   v.computeSkyBrightness(a);
   v.computeExtinction();
   for( i = 0; i < 5; i++)
      printf( "%lf  %lg  %.5lf\n",
          v.getK(i), v.getBrightness(i), v.getExtinction(i));
   printf( "Limiting magnitude: %.5lf", v.computeLimitingMag());

   return 0;
}
#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩精品在线一区二区| 精品国产乱码久久久久久免费| 麻豆精品一区二区综合av| 国产欧美综合色| 欧美日本免费一区二区三区| 成人app下载| 国内精品久久久久影院色| 亚洲成人在线观看视频| 国产欧美一二三区| 日韩一区二区三区三四区视频在线观看 | 337p日本欧洲亚洲大胆精品 | 91精彩视频在线| 蜜桃av一区二区在线观看| 亚洲另类在线视频| 日本一区二区成人在线| 日韩精品一区二区三区中文不卡| 欧美午夜在线一二页| 99久久婷婷国产精品综合| 韩国视频一区二区| 日韩精彩视频在线观看| 一区二区久久久久| 亚洲精选视频在线| 国产精品乱人伦| 欧美激情在线一区二区三区| 精品国产伦理网| 欧美成人福利视频| 欧美一区二区在线不卡| 欧美色涩在线第一页| 色综合av在线| 91同城在线观看| 99久久精品免费看国产| 成人精品鲁一区一区二区| 国产一区二区毛片| 激情成人午夜视频| 欧美变态tickle挠乳网站| 91精品国产综合久久久久久漫画| 欧美色精品在线视频| 色婷婷av一区二区三区大白胸| aaa国产一区| 91丨porny丨在线| 99国产麻豆精品| 91丨porny丨蝌蚪视频| 91视频你懂的| 欧美影片第一页| 欧美日韩激情一区| 91精品婷婷国产综合久久性色| 欧美三级电影在线看| 欧美日韩精品久久久| 91精品麻豆日日躁夜夜躁| 91精品国产一区二区| 91精品久久久久久蜜臀| 欧美成人a∨高清免费观看| 精品日韩av一区二区| 久久久高清一区二区三区| 国产精品免费av| 一个色综合网站| 视频一区中文字幕国产| 免费成人性网站| 韩国一区二区在线观看| 成人夜色视频网站在线观看| 色综合天天综合网国产成人综合天| 日本韩国视频一区二区| 在线播放中文一区| 精品国产乱码久久久久久久久| 久久九九久久九九| 亚洲男人都懂的| 日韩精品五月天| 国产黄人亚洲片| 色综合天天综合狠狠| 日韩午夜在线观看| 国产午夜精品福利| 亚洲综合偷拍欧美一区色| 免费在线观看视频一区| 国产999精品久久| 欧美视频三区在线播放| 精品国产一区二区精华| 亚洲色图在线视频| 日本sm残虐另类| youjizz国产精品| 欧美一区二区三区四区五区| 久久精品日产第一区二区三区高清版 | 国产高清亚洲一区| 色婷婷综合激情| 日韩美一区二区三区| 国产精品成人在线观看| 视频一区欧美精品| 成人黄页在线观看| 91精品国产黑色紧身裤美女| 国产清纯美女被跳蛋高潮一区二区久久w| 亚洲欧美一区二区在线观看| 蜜臀av性久久久久av蜜臀妖精| 成人免费高清在线| 4438x成人网最大色成网站| 国产精品女人毛片| 麻豆国产精品官网| 欧美在线你懂得| 国产成人av电影在线| 欧美亚洲综合一区| 国产精品欧美一级免费| 久久99精品国产| 欧美日韩卡一卡二| 亚洲色图.com| 国产宾馆实践打屁股91| 欧美一区二区三区喷汁尤物| 一区二区三区中文在线观看| 国产成人自拍网| 精品久久五月天| 日欧美一区二区| 在线看日韩精品电影| 国产欧美日韩一区二区三区在线观看| 日本亚洲电影天堂| 欧美日韩国产小视频| 亚洲激情av在线| 成人国产亚洲欧美成人综合网 | 色婷婷久久99综合精品jk白丝| 久久综合一区二区| 麻豆国产欧美一区二区三区| 欧美日本韩国一区二区三区视频| 日韩一区日韩二区| a美女胸又www黄视频久久| 久久精品视频网| 国产黄人亚洲片| 欧美国产国产综合| 国产乱人伦精品一区二区在线观看| 91精品国产色综合久久不卡蜜臀| 亚洲动漫第一页| 欧美视频日韩视频在线观看| 亚洲综合在线电影| 欧美主播一区二区三区美女| 中文字幕一区在线观看视频| 成人一级视频在线观看| 亚洲国产精品v| 成人综合在线观看| 中文成人综合网| 成人avav在线| 亚洲色图在线看| 色哦色哦哦色天天综合| 一区二区三区欧美久久| 欧美日韩色一区| 日韩电影在线一区| 日韩一区二区三区电影| 美女网站色91| 亚洲精品在线三区| 国产精品亚洲午夜一区二区三区| 欧美国产一区二区| 成人精品亚洲人成在线| 国产精品不卡在线| 色综合久久天天| 亚洲综合在线电影| 欧美一区二区在线视频| 久久99国产精品免费| 国产视频在线观看一区二区三区| 成人国产亚洲欧美成人综合网| 亚洲日本在线看| 欧美精品视频www在线观看| 免费在线视频一区| 国产日韩欧美高清| 91在线高清观看| 亚洲成av人影院| 日韩欧美国产综合| 成人性生交大片免费| 色综合久久中文综合久久97| 亚洲午夜在线视频| 日韩亚洲欧美综合| 粉嫩在线一区二区三区视频| 一区二区三区色| 日韩免费福利电影在线观看| 成人一区二区三区在线观看 | 激情综合网av| 综合久久一区二区三区| 欧美日韩国产美| 国产一区999| 亚洲一区在线看| 欧美tk丨vk视频| 一本色道综合亚洲| 久久精品国产精品青草| 中文在线一区二区| 欧美片网站yy| 国产成人免费视| 亚洲va中文字幕| 国产精品―色哟哟| 欧美福利视频一区| 9人人澡人人爽人人精品| 日韩精品三区四区| 亚洲天堂免费在线观看视频| 日韩精品专区在线影院观看 | 99久久综合精品| 日韩在线一区二区| 18涩涩午夜精品.www| 日韩免费性生活视频播放| 91美女片黄在线观看91美女| 精品亚洲免费视频| 亚洲国产日韩一级| 国产精品久久久久久久久图文区 | 欧美日韩精品三区| 不卡一二三区首页| 久久国产视频网| 亚洲成人777| 亚洲狼人国产精品| 亚洲国产精品ⅴa在线观看|