\section{{\bf Accessing the Optical Solar Data of NAOJ}}

\index{NAOJ software}\index{software, NAOJ}

\begin{verbatim}

1. Introduction

This document describes how to make access to various optical data of
the sun obtained at the National Astronomical Observatory of Japan (NAOJ).
>From workstations which support the X-window and are connected to NAOJ via
network, you may log-in to our workstation

     'spot' (spot.mtk.nao.ac.jp, IP-address=133.40.2.120),

under the username 'guest'. The password can be obtained by sending
an e-mail request to either one of the following.

     sakurai@spot.mtk.nao.ac.jp (T.Sakurai)
     ichimoto@spot.mtk.nao.ac.jp (K.Ichimoto)

For remote users it would be more convenient to transfer the data and
the software to your own workstation and run the software locally. 
The IDL package should be installed on your workstation. Files can
be transferred by anonymous ftp on 'spot'. After you are connected to
'spot' via ftp, enter 'anonymous' as the username. For password prompt,
you are requested to enter your name, which will be recorded.

These data can be utilized freely in your data analysis. If you write
a paper or give a talk by using these data, you are requested to consult
with us in terms of co-authorship. 

For technical details, please contact:
	Norikura heliograms/filtergrams          : K.Ichimoto, K.Kumagai
	Flare Telescope magnetograms/Dopplergrams: K.Ichimoto, T.Sakurai
	Okayama magnetograms                     : T.Sakurai
	H-alpha full-disk images                 : Y.Suematsu, N.Tanaka
These people can be accessed by e-mail at <name>@spot.mtk.nao.ac.jp.

In any case, only representative data (a few images per day)
are provided on-line. Once you figure out that the data you are 
interested in are in archive tapes, you are encouraged to visit
NAOJ, recover the data from tapes, and make use of them.


2. Observing Instruments

This section briefly describes the sources of data, namely the optical
observing facilities currently being operated at NAOJ.

2.1  Mitaka Campus

(a) H-alpha flare patrol
    optics: 4cm refractor + Halle H-alpha filter
    field of view: full disk
    pixel size: 4"
    form of data: digital images of H-alpha line center
    image cadence: one minute
    recording media: digital audio tape

(b) The Solar Flare Telescope     
    This is made of four telescopes T1-T4.
    field of view: 340" x 320"
    pixel size: 0.66"
(T1) vector magnetograph
    optics: 20cm refractor + birefringent filter (band width=1/8A)
    form of data: digital I,Q,U,V intensities of Fe I 6303A line
    image cadence: 3 minutes
    recording media: digital audio tape
(T2) continuum telescope
    optics: 15cm refractor + broad-band filters
    form of data: analog images taken mostly at the wavelength of g-band
    image cadence: video rate
    recording media: SVHS video tape
    (tapes are recycled unless no notable events are found)
(T3) H-alpha telescope
    optics: 15cm refractor + Zeiss H-alpha filter
    form of data: analog images of H-alpha line center
    image cadence: 10 seconds
    recording media: laser video disk
(T4) Dopplergraph
    optics: 20cm refractor + birefringent filter (band width=1/5A)
    form of data: digital I,V,Doppler shifts of Fe I 6337A line
    image cadence: 3 minutes
    recording media: digital audio tape

(c) STEP Full-Disk Magnetograph (STEP=Solar Terrestrial Energy Program)
    20cm heliostat + 6cm refractor + birefringent filter
    field of view: full disk
    pixel size: 5"
    form of data: digital I,V,Doppler shifts of Fe I 5324A line
    image cadence: (the instrument is now under testing)
    recording media: digital audio tape

2.2  Norikura Coronagraph Station

(a) Automated Digital Coronagraph
    optics: 10cm coronagraph + interference filters
    field of view: 2600" x 2400"
    pixel size: 5"
    form of data: digital images of the corona in the following wave bands
         wavelength               band width
         5303A                    3A
         He D3                    4A
         H-alpha                  3A
         continuum at 6630A       21A
    image cadence: 3 minutes
    recording media: digital audio tape

(b) Spectroheliographic Observations
    optics: 25cm coronagraph + Littrow spectrograph
    raster area: four swaths of 500" wide (2.5" step)
                 synthesis of full disk maps is made after the observation
    spectral coverage: 2A (0.2A x 10 wavelength points)
    form of data: digital spectroheliogram of He I 10830A
    image cadence: one map per day (one raster scan takes 30 minutes)
    recording media: optical disk

2.3 Okayama Observatory
    optics: 65cm reflector + Littrow spectrograph + photoelectric magnetograph
    raster area: 500" x 450" (10" step) or 420" x 390" (6" step)
    spectral coverage: 27-80mA from the center of 5250A line
               (detectors are photomultipliers; no wavelength resolution)
    form of data: digital I,Q,U,V,Doppler shifts of Fe I 5250A
    image cadence: a few maps per day (one raster scan takes one hour)
    recording media: magnetic tape and magneto-optical disk

The data available on-line are:
	part of Mitaka H-alpha full-disk images (2.1a), 
	part of Flare Telescope vector magnetograms (2.1b-T1),
	all of Norikura He 10830 fill-disk heliograms (2.2b), and
	all of Okayama vector magnetograms (2.3).
Other data are archived in tapes in digital form, or recorded on analog media.


3. Browsing the Data by 'show'

After you log-in at 'spot' under the username 'guest', follow the instruction
shown on the banner message.  You simply type

	spot% show

and then enter your machine's IP-address after the prompt. An interactive,
menu-driven session on the X-window will start.
By using the mouse you first select from
      magnetic data of flare telescope
      Ha full disk image of Mitaka
      Norikura data (He10830, corona)
      Okayama magnetic data 
      exit
On all the menus, <return> means that you go back to the main menu, and
the 'show' program stops by selecting <exit>.

3.1 Flare Telescope Vector Magnetograms

The data have names 'fbyymmdd.hhmm', where yymmdd and hhmm designate,
respectively, the date and time in UT. By using the mouse, select the file
you want to see. When the menu is too big and is split into several pages, 
you may select 'next page' and the next page of the file list will
be shown. The other options control plotting styles and printer output.
	<contour>	: magnetogram in contour
	<spot+contour>	: magnetogram in contour, sunspots in gray scale
	<red-blue>	: magnetogram in red-blue, sunspots in contour
	<PostScript>	: make postscript output file
	<printout>	: print postscript file at a local printer at Mitaka
<PostScript> is only selectable after you have selected data to be displayed.
In order to transfer the postscipt file, use anonymous ftp. The contour plot 
is saved in 'tmp/magcont.ps' under the anonymous ftp directory.

After you exit, the data are stored in arrays: intensity map in 'img',
longitudinal magnetid field in 'Bl', and transverse magnetic fields in
'Bx,By'. The header h contains observing parameters. The magnetic data
are 2 byte integer in unit of 0.1 Gauss and each image has 256*240 pixels,
where a pixel corresponds to about 1.35 arcseconds.  The instrument tends to
saturate for magnetic fields stronger than about 1700 Gauss. The field
strength in large sunspots should be used with some caution.

The direction of the transverse magnetic field (i.e. the resolution of
the 180 degree ambiguity) is determined by referring to the potential field
calculated from the longitudinal magnetic field distribution. The direction
may not be correct in regions with high magnetic shear.

In order to obtain the observation status, type
	IDL> fstplot
and then choose yymmdd.

3.2 Mitaka Full-Disk H-alpha Images

The data have names 'hayymmdd.hhmm', where yymmdd and hhmm designate,
respectively, the date and time in UT. By using the mouse, select the file
you want to see. After you exit, the image data are stored in an array
'img', and the header h includes the observing parameters.

3.3 Norikura Spectroheliograms

In the 'Norikura' menu ( He10830, corona ) you should select He10830.
The other entry is not yet implemented.  The data have names 'heyymmdd.hhmm',
where yymmdd and hhmm designate, respectively, the date and time in UT.
The data names followed by '.v' are Doppler images. By using the mouse, select
the file you want to see. After you exit, the image data are stored in an array
'img', and the header h includes the observing parameters.

3.4 Okayama Vector Magnetograms

First you select the year (1982 - ), and the file list appears.
The data have names 'ymddn.D', where y is a letter indicating the year
(B=1982, C=1983, ,,, M=1993), m indicates the month (1=Jan, ,, 9=Sept,
A=Oct, B=Nov, C=Dec), dd is the date, and n=A,B,C,,, are sequence
numbers of observation on the day. Then you are asked to enter
several numbers from the keyboard as follows.

	obs.area    : 0=skip, 1=show: _
	     (location of the observed area on the sun)
	halftone map: 0=skip, 1=    I, 2=   BL, 3=   VL: _
	contour map : 0=skip, 1=    I, 2=   BL, 3=   VL: _
	vector map  : 0=skip, 1=(   BX,   BY): _

Here I is the intensity map, BL is the longitudinal magnetogram, VL
is the Doppler map, and (BX,BY) are the transverse field vectors. If 0 is
entered, the corresponding map is not shown. If the potential field lines
had been computed and stored in a file 'ymddn.L', you will be asked:
	field lines : 0=skip, 1=show : _

At the next prompt
	1=plot again, 2=hardcopy, 9=exit > : _
you can plot the map in a different style by selecting 1. The postscript
output file will be created if you select 2. The postscript file can
be later transferred by anonymous ftp.

After you exit, the data are stored in a floating array 'rdata', 
and the structure 'mparam' contains observing parameters. 
The 'mparam.status' includes fields such as
	i, q,u,v, bx,by,bl,,,,.
If for example the data By are stored in rdata(*,*,2), mparam.status.by
takes the value 2. In order to know which part of rdata contain valid
data, type
	IDL> help,/st,mparam.status
The data whose status value is -1 are not stored in rdata array.

The electric current distribution can be seen by typing
	IDL> .run jn
	IDL> magplot, mparam, rdata, /nomenu
Then you will see the following prompt.

	obs.area    : 0=skip, 1=show: _
	halftone map: 0=skip, 1=    I, 2=  BLP, 3=   BL, 4=   VL, 5=   JN: _
	contour map : 0=skip, 1=    I, 2=  BLP, 3=   BL, 4=   VL, 5=   JN: _
	vector map  : 0=skip, 1=(  BXP,  BYP), 2=(   BX,   BY): _
	1=plot again, 2=hardcopy, 9=exit > : _

Here JN is the normal component of the electric currents, and the field 
components followed by P are those of the potential magnetic field.


4. Anonymous ftp Access to spot

When you are connected to 'spot' via anonymous ftp, under the home directory
you have directories

	flare                           : Flare Telescope magnetograms
	         - log                  : Flare Telescope magnetograms
	monochro                        : H-alpha full-disk images
	norikura - he10830              : He10830 spectroheliograms
                 - corona
	okayama  - 1982                 : Okayama magnetograms
                 - ...
	doc                             : documents
	idlsoft                         : IDL routines

All the IDL routines used here are stored under 'idlsoft'. 
Compressed tar files of IDL software is provided as naojidl.tar.Z 
in the home directory. The 'doc' directory contains text files explaining
the software and the data analysis. 
The observation log files of the Flare Telescope are in /solar/flare/log.
The files 'yymmdd.log' give you the time and the observing region
for all data on the day. The files 'lv##.log' contain list of H-alpha
video disk recordings of the Flare Telescope T3.
     

5. Description of the Software

The 'show' program assumes the directory structure of NAOJ workstations.
Therefore, when you want to display and analyse the data obtained via ftp,
you have to invoke lower-level IDL routines. 

5.1 Flare Telescope Vector Magnetograms

To read a file named 'fbyymmdd.hhmm' and store the data into img,Bx,By,Bl:
	IDL> f1data, 'fbyymmdd.hhmm', h, img, Bx, By, Bl

Or an interactive program can be invoked by
	IDL> .run fdisp 

The map can be displayed by
	IDL> magtv1, h=h, img, Bx, By, Bl
or
	IDL> magtv2, h=h, img, Bx, By, Bl
or
	IDL> magcont, h=h, img, Bx, By, Bl

To calculate and display electric current distribution:
	IDL> .run jnft1
(The data should exist in h,img,Bx,By,Bl.)

5.2 Mitaka H-alpha Images and Norikura He10830 Heliograms

To read a file and store the image into 'img':
	IDL> nkrget, <filename>, h, img   

To display:
	IDL> tvscl, img

5.3 Okayama Vector Magnetograms

To read a magnetogram file:
	IDL> readm, mparam, rdata, filename=<filename>

To display magnetograms and potential field lines:
	IDL> magplot, mparam, rdata, /nomenu

To calculate and display electric current distribution:
(The data should exist in mparam and rdata.)
	IDL> .run jn

\end{verbatim}
