CALIBRATED EVENTLIST CONTROL STRUCTURE INITIALIZATION $SSW/hessi/idl/util/hsi_calib_eventlist_control.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       CALIBRATED EVENTLIST CONTROL STRUCTURE INITIALIZATION

 PURPOSE:
       This function creates a calibrated eventlist control structure
       and initializes it with its default values.
** Structure HSI_CALIB_EVENTLIST_CONTROL, 8 tags, length=40:
   XYOFFSET        FLOAT     Array[2]        - center of FOV in arcseconds from sun center
   USE_AUTO_TIME_BIN - if set, the automatic time binning is implemented
 based on the flare offset and the CBE_DIGITAL_QUALITY parameter.
 0.99 is the highest value for CBE_DIGITAL_QUALITY;   CBE_DIGITAL_QUALITY
                   FLOAT     =      0.900000
   CBE_POWERS_OF_TWO - if set, forces the multipliers on TIME_BIN_MIN to be in powers of two.

   USER_FLUX_VAR   POINTER   <PtrHeapVar3487>
 If you want to use your own smoothing profile, determine it on regular
 bins, and load it into USER_FLUX_VAR.  To subsequently disable that, and use
 the algorithm's value, set USER_FLUX_VAR to a scalar value, preferably either 1 or 0.

 If USE_FLUX_VAR is set, then that procedure attempts to construct a demodulated
 profile of the true flux variation in the energy band, unmarred by grid modulation.
   SMOOTHING_TIME  FLOAT          0.500000

 The SMOOTHING_TIME is in seconds, and is used with the IDL smooth function, as part
 of this algorithm.  The SMOOTHING_TIME should not be longer than the accumulation
 interval.

   SRT_FILENAME    STRING    '$SSWDB_HESSI/grid_resp/SRT_2*.dat'

Now to explain
   USE_AUTO_TIME_BIN - if set, the automatic time binning is implemented
 based on the flare offset and the CBE_DIGITAL_QUALITY parameter.
 0.99 is the highest value for CBE_DIGITAL_QUALITY
   CBE_POWERS_OF_TWO forces the multipliers on TIME_BIN_MIN to be in powers of two.

 The next three parameters, USER_FLUX_VAR, USE_FLUX_VAR, and SMOOTHING_TIME
 are used in hsi_calib_eventlist::DEMODULATE

 If USE_FLUX_VAR is set, then that procedure attempts to construct a demodulated
 profile of the true flux variation in the energy band, unmarred by grid modulation.
 The SMOOTHING_TIME is in seconds, and is used with the IDL smooth function, as part
 of this algorithm.  The SMOOTHING_TIME should not be longer than the accumulation
 interval.  If you want to use your own smoothing profile, determine it on regular
 bins, and load it into USER_FLUX_VAR.  To subsequently disable that, and use
 the algorithm's value, set USER_FLUX_VAR to a scalar value, preferably either 1 or 0.

 CATEGORY:
       Utilities

 CALLING SEQUENCE:
       result = hsi_calib_eventlist_control()

 OUTPUT:
       result: a variable of type {hsi_calib_eventlist_control} with
               default values assigned to each tag.

 KEYWORDS:

 PARENT STRUCTURE:

 CALLS: ***
	COPY_STRUCT [1], COPY_STRUCT [2], COPY_STRUCT [3], HSI_CALIB_EVENTLIST_CONTROL
	HSI_PHZ_STACKER_CONTROL, HSI_xyoffset_Control
 HISTORY:
     16-jul-02, ras, revised ::auto_time_bin to always use aspect solution
      USE_AUTO_TIME_BIN restored as the default.
 16-aug-2001 ras, added more explanation.
 15-may-2001 added srt_filename default
       Release 6, 11/2000
           aspect solution parameters moved to hsi_aspect_solution_control
       harmonic_max included. ACs.
       Rel. 3. development, August 1999
       Version 1, May 17, 1999,
           A Csillaghy, csillag@ssl.berkeley.edu
   25-feb-2004, ras, added cb_coef, these are coefficients that
     may be used in some processing, really tbd placeholder
   25-feb-2004, ras, added user_hook
   6-may-2004, ras, added imaging_power_law


check_plotlimits $SSW/hessi/idl/widgets/check_plotlimits.pro
[Previous] [Next]
 Name: check_plotlimits

 Purpose: Check plot limits.  If min is set, but max is 0, autoscale max and viceversa.
	Once x limits are set, if y is to be autoscaled, the use only those points whose
	x values are within x limits to autoscale y.
	If axis is log, then make sure limits are positive.

 CALLS: ***
	CHECKVAR [1], checkvar [2]
 CALLED BY:
	plotman
 History:
	Written: Kim, 2/2000


clean [2] $SSW/hessi/idl/image/visibility/ejs/clean.pro
[Previous] [Next]
 NAME:
       clean
 PURPOSE:
       get a CLEAN or DIRTY map
 CATEGORY:
   OVSA APC imaging
 CALLING SEQUENCE:
       clean,uv_ij,vis_ij,inp,map,cln,dirty=dirty
 INPUTS:
   uv_ij,vis_ij,inp
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
       Input parameters are read from inpfile rather than keywords
 ROUTINES CALLED:
   fft_uv2xy.pro
   clean_beam.pro (clean_bijm.pro)
   clean_only.pro
 OUTPUTS:
       map,cln
 COMMENTS:
  major differences from AIPS/CLEAN
  1. imsize can be chosen but then cellsize is determined accordingly.
  2. H\"ogbom algorithm rather than BCG's is used for cleaning
  3. A truncated gaussian is used for Convol-Grdding fcn.
  4. Multifrequencies at OVSA is handled using freqid array
     As a result, linear Frequency synthesis done when you specify multiple freqids,
  5. Use keyword 'dirty' to get the dirty map.
 CALLS: ***
	BOX_CURSOR, CONGRID [1], CONGRID [2], CONGRID [3], LOADCT, PLOT_3MAPS
	clean_only [1], clean_only [2], fft_uv2xy [1], fft_uv2xy [2], find_axes
 CALLED BY:
	imagr [1], imagr_batch
 SIDE EFFECTS: -
 RESTRICTIONS:
   Works only when there are valid visib. at all 7 bsl at least 1 time
   even if one or more frequencies are dropeed, still you get the middle frq?
 MODIFICATION HISTORY:
     Written 05-JAN-2001 by JL


clean [3] $SSW/hessi/offline/clean.pro
[Previous] [Next]
 NAME: clean.pro
 function clean,dirty_map,mod_pat,params,count_rate,TAPER=weights

 PURPOSE:
       To extract a "clean" map from a "dirty" map

 METHOD:
       Iteratively decomposes the image into single bright pixels,
       subtracting out the side lobes for each point.

       Clean does not know about collimators, pitches or angles.  It takes
       the modulation patterns as they are given.  It cannot tell which
       mod_pats are from which collimator, so weighting (aka tapering)
       must be done via a vector which "knows" which angles and
       collimators are which.

 INPUTS:
       Dirty_map = back-projection map created from binned or unbinned
                   photon list--must be 1-dimensional of size N^2
       mod_pat_str = structure containing
             mod_pat, the same array used to create dirty_map, 
              = N^2 x M matrix of modulation patterns, where
                 N is size of map
                 M is number of time bins or photons
             ncoll = vector giving the collimators used in mod_pat
             nbins = vector of sizes of each array within mod_pat
                For example, if mod_pat includes collimators in the
                order [3,8,5,2], that is vector ncoll, and if there
                are 1000 bins for collimators 3 and 2, and 100 for 5 and 8,
                nbins=[1000,100,100,1000]

       params = structure created by clean_params.pro containing:

                niter = number of iterations to perform
                frac = amount of PSF to subtract in each iteration
                chi_sq_crit = max allowed chi_sq

 OPTIONAL INPUTS:
       count_rate = the count-rate profile of size M used for making
         the dirty map.  The model count rate will be put in its place.
         If it is not defined,  then no model counts  will be computed.       
       TAPER=weights, where weights is a vector of size M giving the
         factors by which each mod_pat is weighted for cleaning and
         modeling. 

 OUTPUTS;
        A structure containing:
          clean_map
          clean_components
          clean_amplitudes
          clean_counts 
          params
          chi-squared (if count_rate is defined.)
 CALLS:
 CALLED BY
	imagr [1], imagr_batch


clean_beam $SSW/hessi/idl/image/visibility/ejs/clean_beam.pro
[Previous] [Next]
 NAME:
     clean_beam
 PURPOSE:
     determine clean beam out of a dirty beam
 CATEGORY:
     OVSA, APC Imaging
 CALLING SEQUENCE:
     cbm = clean_beam(dbeam)
 INPUTS:
     dbeam: dirty beam.
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
     none
 ROUTINES CALLED:

 OUTPUTS:
     cbm[0]= a, semi-minor axis in pixel units.
     cbm[1]= b, semi-major axis in pixel units.
     cbm[2]= p, orientation of b w.r.t y-axis in degree
             clockwise=-, c.c.wise=+

 COMMENTS:
     The central peak region is searched downward
     until 0. or increase is encounered.
     For the selected peak region, logarithmic least square gaussian fit,
     which minimizes total((B * (a[0] * x^2 + a[1] * xy + a[2] * y^2 + a[3] + lnB))^2),
     is calculated analytically.
     Then a is converted to cbm.
 SIDE EFFECTS:
 RESTRICTIONS:
     Dirty beam should be square and symmetric in respect to the center
     and the center should be a local maximum.
 MODIFICATION HISTORY:
     Written 27-JUN-2001 by Su-Chan Bong.


clean_only [1] $SSW/hessi/idl/image/visibility/ejs/clean_only.pro
[Previous] [Next]
 NAME:
       clean_only
 PURPOSE:
       clean sidelobes in a dirty map
 CATEGORY:
   OVSA APC imaging
 CALLING SEQUENCE:
       clean_only, dmap, dbeam, clparm, cmap, cbeam, pmap, maxitr
 INPUTS:
       dmap, dbeam, clparm
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
       all included in clparm
 ROUTINES CALLED:
       cvd_ellipse
 OUTPUTS:
       cmap, cbeam, niter_max, pmap (= deconvolved point sources)
 COMMENTS:
   - intended to do only cleaning and so this code needs not know
         the actual pixel size. Everything works in pixel units.
   - clean beam is created in an array form here (again in pixel units)
     but only a (significant) part of it is returned.
     the size of cbeam array varies depending on the beam size.
   - dbeam is (2m by 2m) while dmap is (m by m).
     Here for a cleaning purpose, we use only inner m by m area
 CALLS: ***
	CVD_ELLIPSE, PLOT_SET_XYSCAN, PLOT_XYSCAN
 CALLED BY:
	clean [2], clean [3], clean [4], slfcal [1], slfcal [2]
 SIDE EFFECTS:
 RESTRICTIONS:
    arrary size of cbeam will be far smaller than m & automatically adjusted.
 MODIFICATION HISTORY:
     Written 05-JAN-2001 by JL


cluster_fit $SSW/hessi/idl/util/cluster_fit.pro
[Previous] [Next]
 PROJECT:
	HESSI

 NAME:
	cluster_fit

 PURPOSE:
 Calculates the average value of an isolated cluster, chosen from the input vector of X-values.
 		xtol is the desired accuracy of the result.
 	Method is to iteratively find the median value of a subset chosen from a narrowing range
		of x values from the previous median.

 CATEGORY:
	Utility

 CALLING SEQUENCE:
	avg_val = cluster_fit(x, xtol, /AVG)

 CALLS: ***
	AVERAGE
 INPUTS:
	x = vector of input values
	xtol = half-range over which values are considered to be in a single cluster
				(Value is not critical - should be less than separation of different clusters)

 OPTIONAL INPUTS:
	none

 OUTPUTS:
	Median or average value of one cluster.  Note that this is not necessarily the largest
		cluster.  Repeated calls to cluster_fit, excluding values within previously identified
		clusters, can be used to identify all clusters in the original vector.

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	AVG = when set, returns the average of values in the identified cluster.
				Otherwise the median is returned.

 COMMON BLOCKS:
	none
 SIDE EFFECTS:
	none

 RESTRICTIONS:

 MODIFICATION HISTORY:

 16-Feb-02 	First version. (ghurford@ssl.berkeley.edu)
  4-Mar-02	gh	Provided for case where range of x was initially smaller than xtol
 11-Apr-02 gh	Added AVG switch
				Changed gain from 0.5 to 0.8
  8-May-02 gh	Corrected minor bug in AVG switch
				Added ssw wrapper
 11-Jul-02 gh	To improve reproducibility, last value of dx = xtol, instead of being in range [xtol, xtol/Gain)


cnvl $SSW/hessi/idl/image/memvis/cnvl.pro
[Previous] [Next]
  PURPOSE:
   IDL routine to convolve array A with a point spread function P

  CALLING SEQUENCE:   C=CONVL(A,P)

  INPUTS:
    A = map vector or array (REAL OR COMPLEX)
    P = PSF vector or array, same size as A

  OUTPUT:
    Convolved matrix or vector, shifted to make the origin the same
    as A.  If P is 1 at array center, C=A

  RESTRICTIONS:
    A and P must be vectors or matrices of the same size, dimension LE 2
 
  NOTES:
    The astron program "convolve" does not allow input arrays of
    equal size, so this program is complementary to it.
    With this function, 
        total(C)=total(A)*total(P)
        convl(A,P)=convl(P,A)
        convl(A,P1+P2)=convl(A,P1)+convl(A,P2)

  VERSION HISTORY:
    VERS. 2.0 OCTOBER 25, 1999, EJS


COMPARE_SHUTTERS $SSW/hessi/idl/spectra/compare_shutters.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	COMPARE_SHUTTERS

 PURPOSE:
	This main program compares new versions of the shutter attenuation with the
	version accepted at PDR in July 1998.

 CATEGORY:
	SPECTRA

 CALLING SEQUENCE:
	.r compare_shutters

 CALLS:
	CHECKVAR [1], FLARE_XRAY_MODEL, F_DIV, HESSI_FILTERS, HESSI_SHUTTERS, LOC_FILE [1]
	LOC_FILE [2], LOC_FILE [3], checkvar [2]
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	This routine should be run by its author.  Others beware.

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	6-july-1999.


Compound widget for packet control parameter selection $SSW/hessi/idl/sub_task/hsi_cw_packet.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       Compound widget for packet control parameter selection

 PURPOSE:
       Widget interface to change values of the structure 
       {hsi_packet_control}

 CATEGORY:
       Sub-task /hessi/idl/sub_task

 CALLING SEQUENCE:
       base_id = hsi_cw_packet( parent )

 INPUT:
       parent: the widget ID of the parent

 OUTPUT:
       base_id: the widget ID of the new base

 KEYWORDS:
       UVALUE: the "user value to be assigned to the widget

 PROCEDURE:

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	APPEND_ARR, CW_FSLIDER, HSI_CW_PACKET, HSI_CW_PACKET_EVENT
	HSI_CW_PACKET_GET_VALUE, HSI_CW_PACKET_SET_VALUE
 SEE ALSO:
 HISTORY:
       Dev. for release 3, July 6, 1999,
           A Csillaghy, csillag@ssl.berkeley.edu


Create a FITS primary Header and Data Unit $SSW/hessi/offline/hsi_fitsprimaryhducreate.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
       Create a FITS primary Header and Data Unit

 PURPOSE:
       Creates a HESSI generic HDU FITS file. The primary header
       contains general information about the data recorded in the
       binary tables following the HDU. The keywords follow the
       NOST standard (http://xxx )and OGIP standard (http://xxx).

       The draft describing the HESSI FITS is available at:
       http://xxx

 CATEGORY:
       Utilities (hessi/util)

 CALLING SEQUENCE:
       HSI_FITSPrimaryHDUCreate, fileName

 CALLS: ***
	CHECKVAR [1], FXADDPAR [1], FXADDPAR [2], FXHMAKE [1], FXHMAKE [2], FXWRITE [1]
	FXWRITE [2], HSI_FITSPRIMARYHDUCREATE, checkvar [2]
 INPUTS:
       none 
       
 OPTIONAL INPUTS:
	filename: if not given, a temporary fits file is created.

 OUTPUTS:
       unit: the unit number 

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
       INSTRUME: can have the following values:
                   'Spectrometer': contains spectrometer data. (DEFAULT)
                   'RAS': contains Roll Angle System data.
                   'SAS': contains Solar Aspect System data.
                   'Particle detector': contains particle detector
                                        data.
       OBJECT: can be either 'Sun' (DEFAULT) or 'Crab nebula'
       ORIGIN: the place where the file has been created.
               Default: the HOST environment variable. If not 

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	HDUs created with this procedure contain some fixed keywords:
       TELESCOP is always 'HESSI'

 PROCEDURE:
	

 MODIFICATION HISTORY:
	Release 0, A.Csillaghy, csillag@ssl.berkeley.edu, Oct. 1998


Create FITS $SSW/hessi/offline/hsi_fitscreate.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
       Create FITS

 PURPOSE:
       Creates a HESSI generic FITS file. 

 CATEGORY:
       Utilities (hessi/util)

 CALLING SEQUENCE:
       HSI_CreateFITS, fileName [, image]

 CALLS: ***
	FXADDPAR [1], FXADDPAR [2], FXHMAKE [1], FXHMAKE [2], FXWRITE [1], FXWRITE [2]
	HSI_FITSCREATE
 INPUTS:
       none 
       
 OPTIONAL INPUTS:
	filename: if not given, a temporary fits file is created.
 OUTPUTS:
       unit: the unit number 

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
       

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, A.Csillaghy, csillag@ssl.berkeley.edu, Oct. 1998


curved_gaussian_source_str__define $SSW/hessi/idl/sims/curved_gaussian_source_str__define.pro
[Previous] [Next]
NAME:
 curved_gaussian_source_str__define
PROJECT:
 HESSI
CATEGORY:
 Simulation
PURPOSE:
 Simulates a curved gaussian source structure
CALLING SEQUENCE:
 curved_gaussian_source_str__define
INPUT:
 None
OUTPUT:
 None
KEYWORDS:
 None
HISTORY:
 6-mar-2001, From recipe of M. Aschwanden, jmm, jimm@ssl.berkeley.edu