1 \documentclass[12pt]{article}
3 \newcommand{\cmdshell}[1]{\vspace{0.3cm}\centerline{
4         \colorbox{lightgrey}{\makebox[\textwidth][l]{#1}}
5         \vspace{0.3cm}}
6 }
8 \parindent 0.0pt
9 \textwidth 7.in
10 \textheight 9.0in
11 \topmargin -0.7in
12 \oddsidemargin -0.5in
14 %%**** Authors macros ******
15 \renewcommand{\i}{\item}
16 \renewcommand{\theenumi}{\arabic{enumi}}
17 \def\as{\prime\prime}
18 \def\i{\item}
19 \newcommand{\msun}{M_{\odot}}
20 \newcommand{\mbh}{M_{\bullet}}
21 \newcommand{\mblue}{M_{\rm B}}
22 \newcommand{\msigma}{\mbh\text{-}\s}
23 \newcommand{\mmblue}{\mbh\text{-}M_{\rm B}}
24 \def\barr{\begin{array}}
25 \def\earr{\end{array}}
26 \def\berr{\begin{eqnarray}}
27 \def\err{\end{eqnarray}}
28 \def\berrno{\begin{eqnarray*}}
29 \def\errno{\end{eqnarray*}}
30 \def\be{\begin{equation}}
31 \def\ee{\end{equation}}
32 \def\fr{\frac}
33 \def\la{\langle}
34 \def\ra{\rangle}
35 \def\var{\varphi}
36 \def\half{\frac{1}{2}}
37 \def\quart{\frac{1}{4}}
38 \def\third{\frac{1}{3}}
39 \def\quart{\frac{1}{4}}
40 \def\fifth{\frac{1}{5}}
41 \def\sixth{\frac{1}{6}}
43 \def\barr{\begin{array}}
44 \def\earr{\end{array}}
46 \def\berr{\begin{eqnarray}}
47 \def\err{\end{eqnarray}}
49 \def\berrno{\begin{eqnarray*}}
50 \def\errno{\end{eqnarray*}}
52 \def\be{\begin{equation}}
53 \def\ee{\end{equation}}
55 \def\fr{\frac}
56 \def\la{\langle}
57 \def\ra{\rangle}
58 \def\var{\varphi}
59 \def\half{\frac{1}{2}}
60 \def\quart{\frac{1}{4}}
61 \def\third{\frac{1}{3}}
62 \def\quart{\frac{1}{4}}
63 \def\fifth{\frac{1}{5}}
64 \def\sixth{\frac{1}{6}}
66 \providecommand{\appendixname}{}
67 \renewcommand{\appendixname}{Appendix}
69 \newcommand{\susic}{supersymmetric }
70 \newcommand{\susy}{supersymmetry }
71 \newcommand{\Susy}{Supersymmetry }
72 \newcommand{\sss}{superstring\,\,}
73 \newcommand{\sg}{supergravity\,\,}
75 \newcommand{\antis}{anti-symmetric\,\,}
76 \newcommand{\assyl}{asymmetrical\,\,}
78 \newcommand{\sst}{superstring theory\,\,}
79 \newcommand{\hsst}{heterotic superstring theory\,\,}
80 \newcommand{\CC}{cosmological constant\,\,}
81 \newcommand{\eos}{equation of state\,\,}
82 \newcommand{\hsg}{heterotic superstring\,\,}
83 \newcommand{\IP}{indeterminacy principle\,\,}
84 \newcommand{\ccs}{complex chiral supermultiplets\,\,}
86 \newcommand{\ws}{world-sheet\,\,}
88 \newcommand{\flucs}{fluctuations\,\,}
89 \newcommand{\fluc}{fluctuation\,\,}
91 \newcommand{\gv}{gravitational\,\,}
92 \newcommand{\st}{space-time\,\,}
94 \newcommand{\coffs}{coefficients\,\,}
95 \newcommand{\coff}{coefficient\,\,}
97 \newcommand{\coos}{coordinates\,\,}
98 \newcommand{\coo}{coordinate\,\,}
100 \newcommand{\perbs}{perturbations\,\,}
101 \newcommand{\perb}{perturbation\,\,}
103 \newcommand{\subs}{substitution\,\,}
104 \newcommand{\Subs}{Substituting\,\,}
106 \newcommand{\comps}{components\,\,}
107 \newcommand{\bg}{background\,\,}
108 \newcommand{\hd}{higher-derivative\,\,}
109 \newcommand{\U}{Universe\,\,}
110 \newcommand{\rmov}{right-moving\,\,}
111 \newcommand{\lmov}{left-moving\,\,}
112 \newcommand{\comp}{component\,\,}
113 \newcommand{\rep}{representation\,\,}
114 \newcommand{\go}{goldstino\,\,}
115 \newcommand{\mo}{modulino\,\,}
116 \newcommand{\eq}{equation\,\,}
117 \newcommand{\eqs}{equations\,\,}
118 \newcommand{\emt}{energy-momentum tensor\,\,}
119 \renewcommand{\dim}{dimensional\,\,}
120 \newcommand{\inv}{invariant\,\,}
121 \newcommand{\ed}{energy-density\,\,}
122 \newcommand{\eom}{equation of motion\,\,}
124 \newcommand{\ns}{\!\!}
125 \newcommand{\tc}{\textcircled}
126 \newcommand{\dder}[2]{\frac{\partial{#1}}{\partial{#2}}}
127 \newcommand{\dd}[1]{\frac{\partial}{\partial {#1}}}
128 \newcommand{\llsim}{\genfrac{}{}{0pt}{2}{\ll}{\sim}}
129 \newcommand{\pol}[1]{\stackrel{\rm LCP}{\mathrm{RCP}}}
130 \newcommand{\tx}{\ensuremath{\underset{\textstyle\small\sim}{x}}}
131 %\newcommand{\rss}{\scriptscriptstyle}
132 \newcommand{\app}{\approx}
133 \newcommand{\del}{\partial}
134 \newcommand{\bit}[1]{\ensuremath{\textit{\bfseries{#1}}}}
135 \newcommand{\me}{\mathrm{e}}
136 \newcommand{\mi}{\mathrm{i}}
137 \newcommand{\no}{\nonumber}
138 \newcommand{\und}{\underline}
139 \renewcommand{\a}{\alpha}
140 \renewcommand{\b}{\beta}
141 \newcommand{\g}{\gamma}
142 \newcommand{\G}{\Gamma}
143 \renewcommand{\d}{\delta}
144 \newcommand{\D}{\Delta}
145 \newcommand{\e}{\epsilon}
146 \renewcommand{\l}{\lambda}
147 \renewcommand{\L}{\Lambda}
148 \renewcommand{\O}{\Omega}
149 \newcommand{\s}{\sigma}
150 \newcommand{\Sig}{\Sigma}
151 \renewcommand{\t}{\theta}
152 \renewcommand{\k}{\kappa}
153 \newcommand{\om}{o}
156 \begin{document}
158 \centerline{\LARGE\bf UV SKY MODEL}
160 %\vskip 0.2in
162 \begin{center}
163 \textbf{Author: }Jayant Murthy ({\bf E-mail}: murthy@iiap.res.in)\\
164 \end{center}
166 %\vskip 0.2in
168 .\hrulefill
170 This program is free software; you can redistribute it and/or modify it under the terms of
171 the GNU General Public License as published by the Free Software Foundation; either version 2
172 of the License, or (at your option) any later version.
174 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
175 without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
176 See the GNU General Public License for more details.
178 .\hrulefill
180 \section{Introduction}
182 Sky model  is a tool to predict the appearance of the sky at any wavelength.
183 It comprises three parts: the zodiacal light background, the diffuse galactic
184 light and the stars. Provision is made for different filters. All programs are
185 written in ANSI C.
188 \section{Contents of the package}
190 \subsection{Data files}
192 Inside the folder {\tt data/}
194 \newenvironment{listing}{\begin{trivlist}\itemsep 0.02pt}{\end{trivlist}}
196 \begin{listing}
197 \item{\bit{-- stellar models:}} Castelli and Kurucz Atlas: stellar\_data/castelli/
198 \item{\bit{-- Hipparcos Catalogue:}} stellar\_data/hip\_main.txt
199 \item{\bit{-- Cross-sections from Draine (2003):}} stellar\_data/cross\_sec.txt
200 \item{\bit{-- Sample filter response files: }} sample\_filters/galex\_FUV.txt,
201 sample\_filters/galex\_NUV.txt, sample\_filters/uvit\_FUVBAF2.txt, sample\_filters/uvit\_NUVN2.txt
202 \item{\bit{-- Diffuse background spectrum file:}}  diffuse\_data/bkgd\_spectrum.txt
203 \item{\bit{-- GALEX NUV and FUV all sky data:}}  diffuse\_data/nuv\_allsky.txt,
204 diffuse\_data/fuv\_allsky.txt
205 \item{\bit{-- Zodiacal light spectrum file:}}  zodiacal\_data/zodiacal\_spec.txt
206 \item{\bit{-- Zodiacal Data model file (Leinert et al. 1998):}}  zodiacal\_data/leinert\_dist.txt
207 \end{listing}
209 \subsection{Source Code}
213 Inside the folder {\tt src/}\\
214 -- source codes  and coresponding header files.
216 \subsection{Other files}
217 \begin{listing}
218 \i -- README.txt: \bit{A quick guide to the features, installation and running the software}
219 \i -- INSTALL.txt:\bit{ Generic installation instructions}
220 \i -- COPYING.txt: \bit{GNU Public License}
221 \i -- AUTHORS.txt: \bit{Author's name}
222 \i -- ChangeLog.txt: \bit{Log of versions}
223 \end{listing}
226 \section{Installation}
228 \begin{listing}
229 \i{\bf Obtaining the source file.}
230 \newenvironment{small_listing}{\begin{enumerate}\itemsep 0.001pt}{\end{enumerate}}
231 \begin{small_listing}
232 \i  Download the package from the following web page:
233 {\tt http://cads.iiap.res.in/downloads}.
234 Source packages are available as (a) zipped and (b) tar-gzipped files,
235 which contains the sources.\\
236 \i Since you are reading this manual, you would have already downloaded the
237 package and extracted the contents.
238 \i Binary packages are available for a few Redhat-Linux based operating systems.
239 \end{small_listing}
240 \i{\bf Installing Pre-requisites.}\\
241 The following libraries are needed to run this software :\\
242 $CFITSIO$ for FITS routines from: {\tt http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html}\\
243 $Libnova$ to calculate Sun position from: {\tt http://libnova.sourceforge.net/}. If you
244 are compiling the source code, you will have to install the libraries and their respective
245 header files.
246 \end{listing}
248 \section{Compilation}
250     Follow these 4 steps:
252 \begin{enumerate}
254 \item  `cd' to the directory containing the package's source code and type`./configure'
255 to configure the package for your system. If $CFITSIO$ library
256 and header files are not in the standard path, then you may need to pass on the
257 following argument to configure `--with-cfitsio=path/to/cfitsio'. The code will
258 search $fitsio$ header files in:
259 \begin{enumerate}
260 \item{path/to/cfitsio}
261 \item{path/to/cfitsio/include}
262 \item{path/to/cfitsio/include/cfitsio}
263 \end{enumerate}
264 and library (libcfitsio.so or libcfitsio.a) in:
265 \begin{enumerate}
266 \item{path/to/cfitsio}
267 \item{path/to/cfitsio/lib}
268 \item{path/to/cfitsio/lib64}
269 \end{enumerate}
270 Similarly, for $libnova$ (in case `configure' failed to detect it):
271 `--with-libnova=/path/to/libnova'. Running `configure' takes a
272 few seconds. While running, it prints some messages telling which
273 features it is checking for.
275 If configuration ended without errors, you shall receive the following messages:
276 \begin{verbatim}
277 checking for cfitsio... yes
278 checking for libnova... yes
279 configure: creating ./config.status
280 config.status: creating Makefile
281 config.status: creating src/Makefile
282 config.status: creating doc/Makefile
283 config.status: creating config.h
284 config.status: config.h is unchanged
285 config.status: executing depfiles commands
287  +------------------------------------------------------------------+
288  | Configuration complete                                           |
289  | Type 'make' to compile the software, followed by 'make install'  |
290  |                   All the very best! :-)                         |
291  |                                             --CADS Software Team |
292  +------------------------------------------------------------------+
294 \end{verbatim}
295 \item Type `make' to compile the package.
296 \item Type `make install' to install the programs and any data files and
297      documentation. By default the binary is copied to /usr/local/bin and in that
298      case, you need to run 'make install' as root on linux/unix machines. You may
299      change this destination by passing on the following argument to configure:
300 '--prefix=/your/chosen/destination', which would result in the binary in
301 /your/chosen/destination/bin. You may need to ensure that in \$PATH to run the program.
302 \item You can remove the program binaries and object files from the source code
303      directory by typing `make clean'. You may read more about configure script
304 and others in the accompanying file named `INSTALL.txt'.
306 If everything is correct there should be no error or warning messages during this process.
308 \end{enumerate}
310 \section{Typical Run}
311 \newenvironment{small_listing}{\begin{enumerate}\itemsep 0.001pt}{\end{enumerate}}
312 \begin{small_listing}
313 \i Run sky\_model to generate the default parameter file by typing the command `sky\_model'.
314 \i Edit the default parameter file:
316 \begin{center}
317 \begin{tabular}{|l|l|}
318 \hline
319 \bf Keyword          &   \bf Description\\
320 \hline
321 \multicolumn{2}{|c|}{\bf Time \& date information}                        \\
322 \hline
323 TIME\_UT           &    Time of the day (UT, hours. range: $0.0 - 24.0$) \\
324 DAY\_OF\_MONTH      &  Day of the month (unitless, range: $0 - 31$) \\
325 MONTH             & Month of the year (unitless, range: $1 - 12$) \\
326 YEAR              & Year (unitless, range: $1900 - 2100$ for max. accuracy) \\
327 \hline
328 \multicolumn{2}{|c|}{\bf List of files}\\
329 \hline
330 ZODIAC\_MODEL      &  Zodiacal Data model file\\
331 ZODIAC\_SPECTRUM   &  Zodiacal light spectrum file\\
332 BKGD\_MODEL        &  GALEX NUV and FUV all sky data\\
333 BKGD\_SPECTRUM     &  Diffuse background spectrum file\\
334 OUTPUT\_FILE       &  Location and name of output fits file\\
335 STELLAR\_SPECTRUM  &  Stellar models\\
336 CROSS\_SEC         &  Drain's extinction model\\
337 STAR\_CAT          &  Hipparcos Catalogue\\
338 FILTER\_SPECTRUM   &  Filter response\\
339 \hline
340 \multicolumn{2}{|c|}{\bf WCS parameters for output FITS file}\\
341 \hline
342 XREFVAL    &   Galactic coordinate at the center\\
343 YREFVAL    &  Galactic coordinate at the center\\
344 XINC       &  Pixel size\\
345 YINC       &  Pixel size\\
346 ANGSIZE    &  Angular size\\
347 COORDTYPE  &  Projection type \\
348            & Valid types are: -TAN, -STG, -SIN, -NCP, -ARC, -CAR, -MER, -AIT\\
349 GAL\_COORD  &  Flag for galactic coordinates(0=no, 1=yes)   \\
350 \hline
351 \multicolumn{2}{|c|}{\bf Background parameters}\\
352 \hline
353 ANG\_LIMIT  &  The number of degrees to smooth over (default value 3 deg.) \\
354 CSC\_LAW    &  Cosecent law constant\\
355 \hline
356 \multicolumn{2}{|c|}{\bf Which elements to include}\\
357 \hline
358 ZOD\_INC    &  Flag for including zodaical light (0=no, 1=yes) \\
359 GAL\_INC    &  Flag for including diffuse background (0=no, 1=yes) \\
360 STAR\_INC   &  Flag for including star catalogue (0=no, 1=yes) \\
361 \hline
362 \end{tabular}
363 \end{center}
365 \i Run the code again to generate a desired output.
366 \end{small_listing}
368 \newpage
370 \section{Program Operation}
372 The program is modular and self-documenting. The steps are as follows:
373 \begin{enumerate}
374 \i{\bf READ\_PARAMS}: Read the parameters from the parameter file which has to named
375 {\bf diffuse\_initparams.txt}. If this file does not exist, it will be created with a
376 default set of parameters.
377 \i The output image data, stored in ({\bf data}) array is defined by the
378 WCS parameters as defined in the parameter file. We also define an array to hold
379 the errors ({\bf err}), the predicted
380 galactic background ({\bf diffuse\_data}) and the predicted zodiacal light ({\bf zod\_data}).
381 \i The wavelength and spectral arrays for the zodiacal light are defined with {\bf ZOD\_SPEC}
382 elements. The default value is 25763 elements for the solar spectrum, defined by
383 Colina et al. (1996).
384 \i If {\bf gal\_in}c $= 1$ we calculate the diffuse sky background; otherwise
385 the array is filled with zeros.
386 \i {\bf CALC\_BKGD\_FLUX}: This module calculates the diffuse sky background.
387 The inputs are the name of the background file ({\bf bkgd\_file}),
388 the axes {\bf (naxes}), the WCS parameters ({\bf wcs\_in}), the angle within which
389 to include data ({\bf ang\_limit}) and $k$ -- the factor for the cosecant law ({\bf csc\_law}).
390 The output parameters are the calculated backgrounds ({\bf data}) and error ({\bf err}) arrays.
391 \begin{enumerate}
392 \i Begin by reading data into arrays. The maximum size of the array is set to \\
393 {\bf MAX\_BKGD\_ELEM} (100,000 by default).
394 \i  Convert coordinates into cartesian coordinates $(x, y, z)$.
395 \i Loop through all $i$ and $j$ in the array.
396 \i Use {\bf fits\_pix\_to\_world} from {\it CFITSIO} to convert the $i,j$ into galactic
397 coordinates using the WCS.
398 \i  If the point is vaild then convert it into cartesian coordinates $(x0, y0, z0)$.
399 \i  Run through all the input background points to find those within {\bf ang\_limit}.
400 \i Add them together weighting by the square of the cosine of the angle.
401 \i  If there is no data nearby, fill the pixel according to the cosecant law:
402 $$
403 \mathit{val} = \fr{k}{abs(\sin{(b))}}\,
404 $$
405 where $b$ is the galactic latitude and $k$ is the cosecant law factor, specified
406 in the input parameter file. $\mathit{val}$ = $k$ at the poles (abs(sin~b) = 1).
409 \end{enumerate}
410 \i Calculate the total background flux in the field.
411 \i If {\bf zod\_in}c $= 1$ we calculate the zodiacal light.
412 \i {\bf ZOD\_SPECT\_READ} reads in the spectral dependence of the zodiacal light.
413 The input is the name of the file and the outputs are the wavelength and spectrum.
414 \i {\bf CALC\_ZOD\_FLUX}: This module calculates the zodiacal light with inputs of
415 the name of the zodiacal distribution ({\bf zod\_file}), the time ({\bf hour, day,
416 month, year}), the axis definition ({\bf naxes}) and the WCS parameters ({\bf wcs\_in}).
417 All of these parameters are defined in the parameter file.
418 \begin{enumerate}
419 \i Begin by reading the zodiacal light into an array. This is done using
420 {\bf ZOD\_DIST\_READ} which reads the distribution of the  zodiacal light ({\bf zod\_dist})
421 and the ecliptic coordinate axes ({\bf table\_ecl, table\_beta}) from the distribution file
422 ({\bf zod\_file}).
423 \i Calculate the position of the Sun from the observation date and time $t_{\rm UT}$ (UT).
424 The Julian date is calculated from the time using the formula:\\
425             if (month $\leq 2$) { month=month$+12$; year=year$-1$;}
426 $$
427 JD  = \mbox{Int}\left(365.25\times \mbox{year})\right) +\mbox{Int}\left(30.6001
428 \times \mbox{(month+1)}\right) \no \\
429 - 15 + 1720996.5 + \mbox{day} +\fr{t_{\rm UT}}{24.0}\,,
430 $$
431 where Int means the integer of the value. 
432 \i Equatorial coordinates of the Sun is calculated using the $libnova$ routines.
433 \i In the same manner as the galactic background, we step through all pixels $(ix, iy)$
434 \i Use {\bf fits\_pix\_to\_world} to convert into galactic coordinates.
435 \i If the point is valid, convert the galactic coordinates into ecliptic coordinates.
436 \i Convert the ecliptic coordinates into helioecliptic coordinates (angle from Sun).
437 \i Get the values for the zodiacal light from the table. Note that this is the scale value at
438  5000\, \AA.
439 \end{enumerate}
440 \i Find the subscript for the observation value in the zodiacal light spectrum. This
441 multiplied by the zodiacal light distribution will give the zodiacal light in photon units
442 because the spectrum is scaled.
443 \i Calculate the total zodiacal light in the field.
444 \i If star\_inc $= 1$ we add stars.
445 \i Read stellar data.
446 \begin{enumerate}
447 \i The spectral type from the Hipparcos file is converted into a temperature $T$ and surface
448 gravity $g$ as recommended in the STScI
449 page\footnote{\tt http://www.stsci.edu/hst/observatory/cdbs/castelli\_kurucz\_atlas.html}.
450 We assume that all the stars are main sequence with flux scaled to the observed magnitude.
451 \i Read cross-sections from cross-section file.
452 \i  Read Hipparcos data.
453 \i  Convert spectral type into a Castelli model.
454 \i  Scale the model flux to the magnitude at the Earth and correct for extinction by
455 the function {\bf CALC\_FLUX}.
456 $$
457 \mbox{scale} = 3.64\times 10^{-9} \fr{10^{-0.4(V_{\rm mag} - 3.2  ebv)}}{vflux}\,,
458 $$
459 where $ebv$ is $E(B-V)$.
460 \i Complete for all Hipparcos stars so that they are all read into memory.
461 \i Begin reading locations from location file and process each location individually.
462 \i Calculate $x,y,z$ of position and find distance from star. The stellar flux is scaled by
463 the square of the distance. Assume that the flux is extincted by the distance times the
464 average density.
465 \i  Loop over all the Hipparcos stars.
466 \end{enumerate}
467 \i Calculate the total contribution of stars in the filed.
468 \i Add together the zodiacal light and the galactic background.
469 \i Write out the result as a FITS file.
470 \end{enumerate}
473 \section{References}
476 Draine, B.~T. ``Interstellar Dust Grains", 2003, Ann. Rev. Astr. Astrophys., 41, 241-289\\
478 Leinert, C., Bowyer, S., Haikala, L. K., 1998, Astron. Astrophys. Suppl., 127, 1 \\
480 Colina, L., Bohlin, R.~C., \& Castelli, F., ``The 0.12-2.5 micron Absolute Flux Distribution
481 of the Sun for Comparison With Solar Analog Stars", 1996, AJ, 112, 307
482 \end{document}