#!/usr/bin/perl
#
# calculate approx number of photons per sec for star of mag 0
#    for SNAP telescope
#
# this is based on a fit to three data points, at filters 1, 3.5, 6.5
#    see notes 4/9/2004
#
# MWR 4/15/2004

$debug = 1;

$yint = 1225000.0;
$slope = -122600.0;

# collecting area of SNAP, in sq.cm.
$snap_diam = 2.0;
$snap_area = 3.14159*(($snap_diam/2.0)*($snap_diam/2.0));
$snap_area_sqcm = $snap_area*100.0*100.0;


for ($i = 0; $i < 9; $i++) {

  # calc number of photons per sq. cm. per sec for star of mag 0
  $mag_sqcm_sec = $yint + $slope*$i;

  # now calc number of photons per sec collected by SNAP
  $mag_sec = $mag_sqcm_sec*$snap_area_sqcm;

  printf "%4d      %12.4e \n", $i, $mag_sec;

}



exit 0;
