



********************************************************************************
**                        1.  Introduction                                     *
********************************************************************************
**            I Work Here from Apil 20 to July 10 in 1993 on the Subject about *
**    the Vertical Current of Solor Disk.The Results is Quite Satisfatory!     *
**    During the Period, I Get A lot of Help from Many Worm-hearded Comrades   *
**    in Hairou Obs.Station . I Acknowledge them,especially Prof. Wang jinxiou,*
**    Prof. Zhang hongqi and etc. Prof wang Provided me some Subroutines about *
**    Judging Direction of Transverse Field . And Prof. Zhang Provided some    *
**    Important Messages about Calbration of Transverse Field.                 *
**                                                                             *
**                                   Wang Tong Jiang (From Nanjin University)  *
**                                           ---- July 5,1993 in HuaiRou ---   *
********************************************************************************


********************************************************************************
**                        2.  The Program Usage                               **
********************************************************************************
**    (1) The Main Programs Include :                                         **
**        i. <Direct.for>  The Routine Provides You enough Effective Methods  **
**      to Solving 180-Ambiguity of Transverse Field Direction. i.g.  the     **
**      Potential Method with FFT ,the Magnetic Change Method, the Krall      **
**      Method with Logintude Gradient, and the Adjusting Directly by Cursor  **
**      in Screen are all Very Utility. Besides,it can Draw Three Kinds of    **
**      Maps which are the Original Vector Magnetic Map with No Arrow, the    **
**      Real Vector Magnetic Map with Arrow , and the Potential Field Map     **
**      Calculated from the Bourdary Condition of Longitude Field .           **
**                                                                            **
**       the Routine consists of three external Subroutines READ_DATA.O,      **
**     READ_POINTER.O, RW_FIT.O written by C Language.                        **
**                                                                            **
**       Compile: fpg direct.for -o direct                                    **
**                                                                            **
**        ii. <Current.for> The Routine Provides You two Methods to Calculate **
**     the Current. They are the Difference Method and the FFT Method . The   **
**     Results Obtained by two methods are similar. Besides, You can get the  **
**     Current Intensity of  Certain Interestind Region by integrating the    **
**     Current Density with your specified Low limit.  In Addition, It has    **
**     the Powerful Graphics Function. It provides Coutour Map and Gray Map   **
**     for Current Density Distribution and can Lap Coutour-Map on Gray-Map   **
**     and Print them on Postscript. And it can make magnetic-map location    **
**     same as mono-image.                                                    **
**                                                                            **
**       the Routine consists of three external Subroutines READCC.O,RW_FIT.O **
**     READ_POINTER.O written by C Language.                                  **
**                                                                            **
**      Compile: fpg current.for -o current                                   **
**                                                                            **
**        iii. <Project.for>   The Routine Provides You the Projecting        **
**     Correction of Vector Magnetic Field in Solor Limb. You can Select the  **
**     interesting Region for Transformation till you Satisfy. You can Watch  **
**     the Results in Screen Immediately and Print it by Postscript.          **
**                                                                            **
**      the Routine consists of only One external Subroutine RW_FIT.O written **
**     by C Language.                                                         **
**                                                                            **
**       Compile: fpg project.for -o project                                  **
**                                                                            **
**     NOTE: If You have not < fpg > or Above <source.for> in your Directory, **
**     Please cd < /home/386-user/bin/source > to copy them. All the involved **
**     Routines is in this Directory. But You must Watch Carefully ,not be    **
**     Sure to Destroy  the Source Routines.                                  **
**                                                                            **
**                                                                            **
**    (2) The Subroutine Program Introduction:                                **
**        i. <Read_data.c> The Subroutine for Reading the Original Observed   **
**     Data from Files Named as L*.dat,U*.dat,Q*.dat,T*.dat,V*.dat with two-  **
**     Byte data,and S*.dat,D*.dat,H*.dat with one-Byte data. And it return   **
**     Real Type Data (512,512).                                              **
**        Compile: cc -c read_data.c   ( Create Object File--> read_data.o )  **
**                                                                            **
**        ii. <Read_pointer.c> The Subroutine for Reading the File-Header     **
**     about the Time,the Date,the three kind Coordinates of  Active Region,  **
**     Seeing, Frame etc. from the tail of file with Sizes of 79 Bytes.       **
**                                                                            **
**        iii. <Readcc.c> The Subroutine of Reading Data for Drawing  Gray-   **
**     Maps From the Observed Original Data-files. And it return Real Type    **
**     Data (512,512).                                                        **
**                                                                            **
**        iv. <Rw_fit.c> The Subroutine of Reading or Writing Data in Standard**
**     Fits Format with A Header of the 2880L Bytes. And it return Real Type  **
**     Data (170,128).                                                        **
**           < Watching Careful !> the Array  FF(170,128) in FORTRAN Program  **
**     Corresponding to the Array ff[128][170] in C Program. And Because Data **
**     in fit format define Short, the Value of Input-Data in Array FF must   **
**      be from -32868 to +32868. Otherwise ,the Error data will occur.       **
**                                                                            **
********************************************************************************


********************************************************************************
**                     3. The Program Examples                                **
********************************************************************************
**   I.   <Direct> Judge the Direction of Transverse Field:                   **
**      (1) Go to Main Menu:                                                  **
**          direct  /BEGIN PROGRAME/                                          **
**          input <l522258b.dat>,<q522258c.dat> and <u522258d.dat> /ORIGINATE/**
**          select <o> or <n>  /NEW OR OLD CALBRATION OF TRANSVERSE FIELD/    **
**          input <2000.>      /CALBRATION OF LONGITUDINAL FIELD /            **
**      (2) How to Use Menu:                                                  **
**          select item <1>  /WATCH PATTERN OF OBS. VECTOR MAGNETIC FIELD /   **
**          select item <0>  /GOTO NEXT MENU TO JIDGE DIRECTION/              **
**          select item <1> , <2> or <3> /JUDGE DIRECTION,USUALLY USE <1>,<2>/**
**          auto return Main Menu, select <9> /SAVE RESULT AFTER JUDGEMENT /  **
**          select item <2>  /WATCH VECTOR FIELD WITH ARROW /                 **
**          if you not satisfied, select <4> /ADJUST DIRECTION OF LOCAL REGION**
**      BY CURSOR. YOU MUST OBEY RULES FOLLOWING AS:                          **
**           FIRST,YOU NOTICO PROMPT IN PGPLOT WINDOW 'cursor input'. THEN YOU**
**      CAN BEGIN OPERATION. ( Cursor Commands A --add, D --delete, X --exit) **
**      <Watching Carefully!> ONLY PERMIT TO SELECT one highest point AND one **
**        lowest point. (SEE FIGURE  EXAMPLE) /                               **
**                                                                            **
**                                N    (top point)                            **
**    LEFT BOURDARY POINTS:      N   1(6)                                     **
**     (1,2,3,4)                N   *    *                                    **
**                                 *         *                                **
**    RIGHT BORDARY POINTS:       2               *                           **
**     (4,5,6)                      *                 5                       **
**                                    *              *     S                  **
**    STEPS:                            *           *                         **
**       (i) select region                3        *    S                     **
**       (ii)select N-pole points          *      *                           **
**       (iii)select S-pole points          *    *   S                        **
**       (vi)wait end                        *  *                             **
**                                            4*  S                           **
**                                              (bottom point)                **
**                                                                            **
**          select item <2> from Main Menu /CHECK IF RESULT IS  CORRECT/      **
**          repeat above item <4> till you satisfy,then select <9> /SAVE/     **
**      / ITEM <5> SIMILAR TO ITEM <4> CAN BE USE TO JUDGE DIRECTION OF SMALL **
**     REGION BY CURSOR./                                                     **
**          select <5>  /DISPLAY VECTOR FIELD WITH GRID NET                   **
**          select one N-pole point in a small box                            **
**          select one S-pole point in the same box                           **
**          exeute pgplot cursor commond:<x> /EXIT CURSOR INPUT/              **
**          repeat item <5> till you satisfy, then select item <9> to save    **
**                                                                            **
**     (3) Additional Usage:                                                  **
**          select item <8> /READ DATA *.BXO,*BYO,*BZO WITH DIRECTION, YOU    **
**       CAN ENTER <XXX><N><N><111> GO TO MAIN MENU IF YOU NOT PRINT MAPS ./  **
**                                                                            **
**                                                                            **
**   II.  <Current>  Calculate  Current and Image Lap Technique               **
**      (1) Calculate Current                                                 **
**          select item <2> or <3> / DIFFERENCE OR FFT METHOD    /            **
**          save the results  /NAME AS bi*.dat /                              **
**          do (10 x 10) smooth by  BOXCAR of IRAF /<cl> <rfit> <box> <wfit>/ **
**          select item <1> / READ DATA OF SMOOTHED CURRENT /                 **
**          select item <5> / CALCULATE CURRENT INTENSITY /                   **
**          input <C> or <G>   / USUALLY USE <C> /                            **
**          input <400>   / MIN LIMIT: 0.004 (A/m*m) /                        **
**          input <p> or <n> / <P>-->YELLOW(UP) <N>-->RED(DOWN) /             **
**          select region as FIGURE above  and <x> exit cursor input          **
**          repeat steps above till you input <n> end                         **
**      (2) Maps Display and Print                                            **
**          select item <4> / DISPLAY CURRENT WITH CONTOUR OR GRAY MAP /      **
**          select item <6> / LAP CONTOUR MAP ON GRAY MAP /                   **
**          input <m> + <l> / LAP VECTOR FIELD ON MONO-IMAGE /                **
**          input <m> + <c> / LAP CURRENT CONTOUR ON MONO-IMAGE /             **
**          input <c> + <l> / LAP VECTOR FIELD ON CURRENT GRAY MAP /          **
**          when you select + <l> or + <c>, ask you 'CHANGE POSITION?'. if    **
**          you select <7> and input <a> after moving, position will be       **
**          moved after you select <y>, otherwise not effective.              **
**      (3) Make Position Same                                                **
**          select item <7> / MAKE MAGNETIC-MAX POSITION SAME AS SUNSPOTS /   **
**          input <d422258i.dat>  <l522258b.bzo>                              **
**          select points on mono-image ( blue contour ) <x>-- exit           **
**          select points on magnetic map ( yellow or red contour ) <x>-exit  **
**          input </su> to check result after moving                          **
**                                                                            **
********************************************************************************







