\documentstyle{article}
\setlength{\topmargin}{-45pt}
\setlength{\oddsidemargin}{0cm}
\setlength{\evensidemargin}{-0cm}
\setlength{\textheight}{24cm}
\setlength{\textwidth}{16cm}

\newcommand{\ind}{\par\hangindent=0.5cm\hangafter=1\noindent}
\newcommand{\indd}{\par\hangindent=1.0cm\hangafter=1\hspace*{0.5cm}}
\newcommand{\idl}{\hspace*{5mm}{\tt IDL>\ }}
\newcommand{\unix}{\hspace*{5mm}{\tt unix\%\ }}
\newcommand{\crmk}{{\bf $<$CR$>$}}
\newcommand{\ssw}{{\tt \$\{SSW\}}}
\newcommand{\norp}{{\tt \$\{NORP\}}}



\begin{document}
\title{\bf Nobeyama Radio Polarimeters (NoRP) \\
Analysis Manual
\\
ver. 1.0
}
\author{Nobeyama Radio Observatory / NAOJ}
\date{\today}
\maketitle

\clearpage
\tableofcontents

\clearpage
\section{Introduction}

This is a manual for analysis of the data
obtained by Nobeyama Radio Polarimeters (NoRP; Nakajima et al. 1985) 
and Toyokawa Radio Polarimeters (TYKW; Torii et al. 1979; Shibasaki et al. 1979).

For any questions and requests, please send an e-mail to \\
\bigskip
\hspace*{1cm}{\tt service@solar.nro.nao.ac.jp}

The latest information on NoRP is updated on NRO solar web site.
The URL is \\
\bigskip
\hspace*{1cm} {\tt http://solar.nro.nao.ac.jp/norp/}\\

\section{How to setup}

\medskip
\noindent
(1) Installation of the {\it SolarSoftware}.

Install the SolarSoftware (SSW) with the subpackage 'Radio/NoRP'.
We strongly recommend to install
the SolarSoftware with the sub-packages for Radio/NoRH and Yohkoh/SXT.
If these softwares were not installed, please contact your system manager.
The primary distribution site for SolarSoftware is:
{\tt http://www.lmsal.com/solarsoft/}
We define the top directory of SSW as \ssw\ and that of NoRP subpackage
as \norp\ (usually {\ssw}{\tt /radio/norp}) in this manual.

\medskip
\noindent
(2) Installation of {\it NoRP data base}

Copy the NoRP data base  after getting them 
from the NRO solar archive at\\
{\tt ftp://solar.nro.nao.ac.jp/pub/norh/data}.
The recommended destination is \norp{\tt/data}.

\medskip
\noindent
(3) Setup of your personal environment

Include the followings in your environment setup file 
({\tt \char126/.cshrc}). \\
{\tt
\hspace*{10mm} setenv SSW {\it SSW-directory}\footnote{
{\tt /sgi1/ssw} in NRO} \\
\hspace*{10mm} setenv SSW\_INSTR ``norp'' \\
\hspace*{10mm} source \$\{SSW\}/gen/setup/setup.ssw \\
}
Note that the enviroment variable {\ssw} can be different
(Ask your system manager)\footnote{In NRO, it is {\tt /sgi1/ssw}}.
In case you analyze many kinds of
data at the same time, define SSW\_INSTR as follows, e.g. \\
{\tt
\hspace*{10mm} setenv SSW\_INSTR ``sxt hxt norh norp'' \\
}

\section{Analysis}

\subsection{Start Analysis}

The NoRP IDL procedures described in this section all depend on the
SolarSoftware (SSW). When you start the analysis, start up
the SSW/IDL as follows:

\unix {\bf sswidl \crmk}

\subsection{Database}

\subsubsection{Event List}

There is a data base for the events ('evx' data)
from January 1990 to May 1992\footnote{For the events after June 1992,
see the event list of Nobeyama Radioheliograph}.
In order to list them, e.g. on June 9, 1991 UT, \\
\idl {\bf norp\_pr\_evx,'1991-06-09' \crmk} \\
From June 5, 1991 UT to June 8, 
\idl {\bf st\_day='1991-06-05' \crmk} \\
\idl {\bf ed\_day='1991-06-08' \crmk} \\
\idl {\bf norp\_pr\_evx,st\_day,ed\_day \crmk} \\
For only strong events which have 1000 SFU peak flux in 17GHz,\\
\idl {\bf norp\_pr\_evx,st\_day,ed\_day,criterion=1000 \crmk}

\subsubsection{Daily Averaged Flux}

Daily averaged flux values after choosing non-flaring-time data
are installed in the database (after November 1987). These data
can be used for obtaining pre-flare flux or for studying the
long-term variation.

\medskip
\noindent
Toyokawa (1, 2, 3.75, 9.4 GHz) : Nov 1987 -- Feb 1994 \\
Toyokawa (3.75 GHz only) : Mar 1994 -- Apr 1994 \\
Nobeyama (17, 35, 80 GHz) : Mar 1990 -- Feb 1994 \\
Nobeyama (1, 2, 3.75, 9.4, 17, 35, 80 GHz) : May 1994 -- Present date\\
Note that the data for quiet Sun 
are fixed for 35 GHz (2400 SFU) and 80 GHz (9000 SFU)
due to their instrumental limits.

In order to read the data, e.g. from Jan 1, 1999 to Jun 30, \\
\idl {\bf st\_day='1999-01-01' \crmk} \\
\idl {\bf ed\_day='1999-06-30' \crmk} \\
\idl {\bf norp\_rd\_avg,st\_day,ed\_day,timavg,fiavg,fvavg \crmk} \\
for plot, e.g. of 1GHz  \\
\idl {\bf utplot,timavg,fiavg(0,*) \crmk}\\
of 2GHz  \\
\idl {\bf utplot,timavg,fiavg(1,*) \crmk}

\subsection{Where is the Data ?}

\subsubsection{Calibrated Data in XDR (IDL save) format}

Some already-calibrated NoRP data are put in the NRO solar archive
(see section \ref{archive}).
You can obtain them by anonymous FTP. Before synthesizing
by yourself, try them first.
They are loaded into the IDL session by using the IDL command
{\tt restore}.
There are 1-sec resolution data for steady observatin and
0.1-sec resolution data for events.\\
\idl {\bf file=getenv('NORP\_XDR')+'/1999/08/norp19990828\_0056.xdr' \crmk}\\
\idl {\bf restore,file \crmk}\\
\idl {\bf help \crmk}\\
\hspace*{0.5cm} \begin{minipage}[t]{15cm} \small
\begin{verbatim}
DAY             STRING    = '1999-08-28'
FI              FLOAT     = Array[7, 7590]
FIAVG           FLOAT     = Array[7]
FREQ            FLOAT     = Array[7]
FV              FLOAT     = Array[7, 7590]
FVAVG           FLOAT     = Array[7]
MVD             BYTE      = Array[7, 7590]
TIM             STRUCT    = -> ANYTIM2INTS Array[7590]
\end{verbatim}
\end{minipage}\medskip\\
{\tt freq} is observing frequencies in units of GHz
(in this example, 1, 2, 3.75, 9.4, 17, 3, 80 GHz), {\tt tim} is
observing time, {\tt fi},{\tt fv} are I (R+L), V (R--L) 
comonents of flux density and {\tt fiavg}, {\tt fvavg} are daily average,
respectively. {\tt mvd} is an array including the values of unity (1) for
valid data or zero (0) for non-valid data.

\subsubsection{Raw Data}

Some raw NoRP data are put in the NRO solar archive (see section \ref{archive}).
You can obtain them by anonymous FTP.

\subsection{Read the Data --- Nobeyama Radio Polarimeters}

There are two kinds of formats for Nobeyama Radio Polarimeters (NoRP).
One is before unifing with Toyokawa Radio Polarimeters and the other
is after that. For older format, the files include only 1, 2, 3.75 9.4 GHz
data.

In order to read the data into IDL session, give the date (JST) as follows: \\
\idl {\bf day='1992-4-23'} \\
\idl {\bf norp\_rd\_dat,day,mvd,tim,fi,fv,freq \crmk} \\
or give the file name as follows: \\
\idl {\bf file='pl920423'} \\
\idl {\bf norp\_rd\_dat,file,mvd,tim,fi,fv,freq \crmk} \\
{\tt freq} is observing frequencies in units of GHz
(in this example, 1, 2, 3.75, 9.4, 17, 3, 80 GHz), {\tt tim} is
observing time, {\tt fi},{\tt fv} are I (R+L), V (R--L) 
comonents of flux density,
respectively. {\tt mvd} is an array including the values of unity (1) for
valid data or zero (0) for non-valid data. \\
%
In order to read the data in specified duration: \\
\idl {\bf timerange=['1992-4-23 2:00','1992-4-23 4:00'] \crmk} \\
\idl {\bf norp\_rd\_dat,day,mvd,tim,fi,fv,freq,timerange=timerange \crmk} \\
%
In order to read the data of specified frequency, e.g. for 17 GHz, \\
\idl {\bf rdfreq=[0,0,0,0,1,0,0] \crmk} \\
\idl {\bf norp\_rd\_dat,day,mvd,tim,fi,fv,rdfreq=rdfreq \crmk} \\
For 1GHz and 9.4GHz, \\
\idl {\bf rdfreq=[1,0,0,1,0,0,0] \crmk} \\
\idl {\bf norp\_rd\_dat,day,mvd,tim,fi,fv,rdfreq=rdfreq \crmk} \\
Each element in the array {\tt rdfreq} corresponds to the data of
one frequency  among 1, 2, 3.75, 9.4, 17, 35 and 80 GHz.


\subsection{Read the Data --- Toyokawa Radio Polarimeters}

The Toyokawa Radio Polarimeters were observing in 4 frequencies,
namely , 2, 3.75, and 9.4 GHz.

In order to read the data into IDL session, give the date (JST) as follows: \\
\idl {\bf day='2000-4-8'} \\ 
\idl {\bf tykw\_rd\_dat,day,mvd,tim,fi,fv,freq \crmk} \\
or give the file name as follows: \\
\idl {\bf file='ty921102.01i' \crmk} ; 1GHz I-component \\
\idl {\bf file0pa='ty921102.0pa' \crmk} ; 0PA calibration data\\
\idl {\bf filestt='ty921102.stt' \crmk} ; status data\\
\idl {\bf tykw\_rd\_dat,file,file0pa,filestt,mvd,tim,data \crmk} \\
{\tt freq} is observing frequencies in units of GHz,
{\tt tim} is observing time, {\tt fi},{\tt fv} are I (R+L), V (R--L) 
comonents of flux density,
respectively. {\tt mvd} is an array including the values of unity (1) for
valid data or zero (0) for non-valid data. \\
%
In order to read the data in specified duration: \\
\idl {\bf timerange='1992-11-2 '+['2:00','4:00'] \crmk} \\
\idl {\bf tykw\_rd\_dat,day,mvd,tim,fi,fv,freq,timerange=timerange \crmk} \\
In order to read the data of specified frequency, e.g. for 9 GHz, \\
\idl {\bf rdfreq=[0,0,0,1] \crmk} \\
\idl {\bf tykw\_rd\_dat,day,mvd,tim,fi,fv,rdfreq=rdfreq \crmk} \\
For 1GHz and 9.4 GHz, \\
\idl {\bf rdfreq=[1,0,0,1] \crmk} \\
\idl {\bf tykw\_rd\_dat,day,mvd,tim,fi,fv,rdfreq=rdfreq \crmk} \\
Each element in the array {\tt rdfreq} corresponds to the data of
one frequency  among 1, 2, 3.75, and 9.4 GHz. 

\subsection{Plot}

For plotting, \\
\idl {\bf mfreq=0 \crmk} \\
\idl {\bf norp\_plot,mfreq,file,mvd,tim,fi \crmk} \\
where {\tt mfreq} is the index number of the plotting frequency
in the array {\tt freq}. \\
To overlay another plot \\
\idl {\bf mfreq1=1 \crmk} \\
\idl {\bf norp\_plot,mfreq1,file,mvd,tim,fi,/over \crmk} \\
Or by directly;
\idl {\bf utplot,tim(where(mvd(mfreq,*))),fi(mfreq,where(mvd(mfreq,*))) \crmk} \\
%

\subsection{Spectrum Analysis}
\label{section:spectrum}

By coordinating multiple frequency observation, we may dervive the
spectrum of the emission. The obtained variable is $\alpha$ whose 
definition is
$$
F_{\nu} \propto {\nu}^{\alpha}.
$$
In real, $\alpha$ is not uniform over the frequencies.
But the spectrum in microwave range is approximately fitted by the fucntion
in the form :
\begin{equation}
F_{\nu} = \widehat{F_{\nu}}
\left(\frac{\nu}{\widehat{\nu}}\right)^{\alpha_{\rm tk}}
\left\{
1-\exp\left[
-\left(\frac{\nu}{\widehat{\nu}}\right)^{\alpha_{\rm tn}-\alpha_{\rm tk}}
\right]
\right\}
\approx
\left\{
\begin{array}{cc}
\widehat{F_{\nu}}
\left({\nu}/{\widehat{\nu}}\right)^{\alpha_{\rm tk}}
  & \mbox{for $\nu \ll \widehat{\nu}$}\\
\widehat{F_{\nu}}
\left({\nu}/{\widehat{\nu}}\right)^{\alpha_{\rm tn}}
  & \mbox{for $\nu \gg \widehat{\nu}$}
\end{array}
\right.
\label{equation:fitting}
\end{equation}
Here are 4 fitting parameters: $\widehat{\nu}$ is turn-over frequency,
$\widehat{F_{\nu}}$ is turn-over flux density,
$\alpha_{\rm tk}$ is power index of low frequency side (optically thick side)
and
$\alpha_{\rm tn}$ is power index of high frequency side (optically thin side),
respectively. The procedures are as follows:
\idl {\bf day='2000-4-8'} \\
\idl {\bf norp\_rd\_dat,day,mvd,tim,fi,fv,freq \crmk} \\
\idl {\bf norp\_rd\_avg,day,timavg,fiavg,fvavg \crmk} \\
\idl {\bf for m=0,6 do fi(m,*)=fi(m,*)-fiavg(m) \crmk} \\
\idl {\bf norp\_alpha,freq,fi,mvd,mvdfit,alpha\_tk,alpha\_tn,freqpk,fluxpk
\crmk} \\
After subtracting the pre-flare flux levels (here daily averages are used),
the flare fluxes are given to the IDL procedure {\tt norp\_alpha}.
{\tt mvdfit} is an array including the values of unity (1) for
valid data or zero (0) for non-valid data. 

\medskip
{\bf Note: } The fitting will usually fail in the simple manner shown here.
We need (1) to take longer intergation time for getting better S/N ratio and
(2) to remove the inadequate data for fitting (because, say, the emission
in that frequency is not due to gyrosynchrotron). See 
\ref{section:spectrum_method} for better procedures.

\subsubsection
{Optically-Thin  Non-Thermal Gyrosynchrotron Emission (Preliminary)}

{\bf Note: The procedures described in this subsection are under testing.
Comments are welcome for improvement.}

Based on approximation models, the relation between  
the physical variables of emitting region and the emission can be
derived. The electron distribution function is assumed to be
the power law.
$$
{{d NV(E)} \over {d E}} = K \left({{E}\over{E_{0}}}\right)^{-\delta}
$$
where $E$ is electron energy (keV), $NV(E)$ is number of electrons (particles)
that has larger energy than $E$. This distribution is described with parameters
$\delta$, $E_{0}$, and $K$. But it is usual to use
$NV(E_0)=K/(\delta -1)/E_0^{\delta-1}$ instead of $K$. And we fix
$E_{0} = 10\ {\rm keV}$ after Dulk (1985). \\

\noindent
(a) From Physical Variables to Emission

Inputs; power-law index $\delta$, magnetic field strength (G), angle between
magnetic field and line of sight (degree), and $NV$
--- total number (particles) of non-thermal electron (of $E> 10\ {\rm keV}$):
Outputs; flux density (SFU), circular polarization degree: \\
By Dulk's (1985) method:\\
\idl {\bf dulk\_gysy,delta,bb,theta,nv,freq,fi,rc \crmk} \\
If the size of emitting source (by solid angle in unit of sterad) is given
additionally, optical depth is also obtained \\
\idl {\bf dulk\_gysy,delta,bb,theta,nv,freq,fi,rc,omega,tau \crmk} \\
By Ramaty's (1969) method:\\
\idl {\bf ramaty\_gysy,delta,bb,theta,nv,freq,fi,rc \crmk} \\
\idl {\bf ramaty\_gysy,delta,bb,theta,nv,freq,fi,rc,omega,tau \crmk}


\noindent
(b) From Emission to Physical Variables

Based on Dulk's (1985) model we may derive the physical variables from emission.
After deriving $\alpha$ (see \ref{section:spectrum}),
power law index of non-thermal electron distribution function is \\
\idl {\bf norp\_alpha,freq,fi,mvd,mvdfit,alpha\_tk,alpha\_tn,freqpk,fluxpk
\crmk} \\
\idl {\bf norp\_alpha2delta,alpha\_tn,delta \crmk}

\subsubsection
{Optically-Thin  Thermal Free-Free Emission (Preliminary)}

{\bf Note: The procedures described in this subsection are under testing.
Comments are welcome for improvement.}

\noindent
(a) From Physical Variables to Emission

Based on Dulk's (1985) approximation models, the relation between  
the physical variables of emitting region and the emission can be
derived. 
Inputs; electron temperature (K), line-of-site component 
of magnetic field (G), and volume emission measure (cm$^{-3}$)
Outputs; flux density (SFU), circular polarization degree: \\
\idl {\bf dulk\_frfr,te,b\_loc,vem,freq,fi,rc \crmk} \\
If the size of emitting source (by solid angle in unit of sterad) is given
additionally, optical depth is also obtained \\
\idl {\bf dulk\_frfr,te,b\_loc,vem,freq,fi,rc,omega,tau \crmk}

\subsection{Example of Analysis Session}

\subsubsection{Choose an Event}

Many interesting events are introduced in NoRP web site.
It is recommended to access first to these pages. The URL is \\
\hspace*{1cm}{\tt http://solar.nro.nao.ac.jp/norp/}

\subsubsection{Light Curves}

After choosing an event for analysis, see the light curves.
Calibrated data is already prepared in XDR (IDL save) format
for important events. So restore it first, \\
\idl {\bf file=getenv('NORP\_XDR')+'/1999/08/norp19990828\_0056.xdr' \crmk}\\
\idl {\bf restore,file \crmk} \\
For plots, \\
\idl {\bf mfreq=0 \crmk} \\
\idl {\bf norp\_plot,mfreq,mvd,tim,fi \crmk} \\
Here {\tt mfreq} is the number of the data identifying the frequency.
For overplotting another frequency data, \\
\idl {\bf mfreq1=1 \crmk} \\
\idl {\bf norp\_plot,mfreq1,mvd,tim,fi,/over \crmk} 

\subsubsection{Spectrum Analysis}
\label{section:spectrum_method}

For deriving spectrum, it is better to integrate longer than default
for getting better S/N ratio. In case integrating 300 points (30 sec), \\
\idl {\bf mint=300 \crmk} \\
\idl {\bf norp\_mkint,mint,mvd,tim,fi,fv,mvdav,timav,fiav,fvav \crmk} \\
Next subtract pre-flare flux \\
\idl {\bf for m=0,6 do fiav(m,*)=fiav(m,*)-fiavg(m) \crmk} \\
Using this flux, fit the spectrum \\
\idl {\bf norp\_alpha,freq,fiav,mvdav,mvdfit,alpha\_tk,alpha\_tn,freqpk,fluxpk
\crmk} \\
Assuming gyrosynchrotron emission, the power-law index of non-thermal electrons
is obtained \\
\idl {\bf norp\_alpha2delta,alpha\_tn,delta \crmk}

Sometimes fitting will fail if the observation data include
some points extremely out of the fitting function. One reason 
is that the emission mechanism is different in the low frequency
range ( not gyrosynchrotron but plasma emission ). Another reason
is bad S/N ratio in high frequency observation, especially in 80 GHz.
In this case, remove such data points from fitting as follwos: \\
\idl {\bf mvfreq=[2,3,4,5,6] \crmk} \\
\idl {\bf norp\_alpha,freq(mvfreq),fiav(mvfreq,*),mvdav(mvfreq,*) \$ \crmk}\\
\idl {\bf ,mvdfit,alpha\_tk,alpha\_tn,freqpk,fluxpk \crmk} \\

\medskip
In order to confirm that the fitting is well-done, 
plot the fitting function over the observation data.
For example, for {\tt n}-th data \\
\idl {\bf norp\_funcp,alpha\_tk(n),alpha\_tn(n),freqpk(n)
,fluxpk(n),freqfit,fifit \crmk} \\
\idl {\bf plot,freq,fiav(*,n),/xlog,/ylog,psym=5 \crmk} \\
\idl {\bf oplot,freqfit,fifit \crmk}

\subsection{Others}

\subsubsection{Read Raw Data Directly}

In order to read raw data directly, for Nobeyama data \\
\idl {\bf norp\_rd\_rdt,file,rdata,date,version \crmk} \\
for Toyokawa data \\
\idl {\bf tykw\_rd\_rdt,file,rdata \crmk} \\
For obtaining observing time (JST) \\
\idl {\bf timej=norp\_rdt2timej(rdata) \crmk}

\appendix

\section{NoRP data archive: anonymous FTP}
\label{archive}

The Nobeyama Radio Observatory (NRO/NAOJ) has prepared
the anonymous FTP server for the NoRP data archive. 
The URL is 

\bigskip
{\tt ftp://solar.nro.nao.ac.jp/pub/norp}
\bigskip

If you need to transfer a large amount of data ,
please contact

\bigskip
{\tt service@solar.nro.nao.ac.jp}

We will make and mail a CD-ROM for you.
The network capability in Nobeyama is limited.


\section{Acknowledgement}

We thank the following people.
SolarSoftware is a software package for analysis of Solar
Data on IDL. That is supported under various
NASA contracts (SXT/EIT/MDI/TRACE/YPOP etc.) and is all in
the public domain.
IDL is a product by Research System Inc.

\section*{References}

\noindent
Dulk, G. A., 1985, ARAA, {\bf 23}, 169 \\
%
Nakajima et al. "The Radiometer and Polarimeters at 80, 35, and 17 GHz
for Solar Observations at Nobeyama", PASJ, 37, 163 (1985) \\
%
Ramaty, 1969, ApJ, {\bf 158}, 753 \\
%
Shibasaki et al. "Solar Radio Data Acquisition and Communication System
(SORDACS) of Toyokawa Observatory",
Proc. of the Res. Inst. of Atmospherics,
Nagoya Univ., 26, 117 (1979) \\
%
Torii et al. "Full-Automatic Radiopolarimeters for Solar Patrol at
Microwave Frequencies", Proc. of the Res. Inst. of Atmospherics,
Nagoya Univ., 26, 129 (1979) \\


\end{document}
