DAGA2_HF convenzioni tecniche

Considerazioni generali

Ci sono 3 fasi asincrone, regolate da controlli di livello di esecuzione, in modo tale che ciascuna esegue tutto il possibile fino a saturare il livello di esecuzione precedente, o un suo limite intrinseco. La prima fase, OUT_RINGS, e' controllata dal K_LASTMEAS_IN, data dall'ADC, e riempie 3 serie di anelli (una serie per ogni campo e un anello per ogni canale). Il suo limite intrinseco e' la lunghezza degli anelli. Ci sono due indici per ogni canale, J_SOFCH e K_SOFCH, il primo indica dove e' andato l'ultimo dato, il secondo indica quale e' l'ultimo dato utilizzato dalla terza fase. La seconda fase, ONLINE_STATISTICS, calcola le statistiche in t.r. sui canali inanellati, senza limite intrinseco. La terza fase, ARCHIVE, archivia i dati campionati, ed e' limitato intrinsecamente dal sincronismo dei canali da archiviare.

SUBROUTINE ONLINE_STATISTICS

Le storie vengono calcolate ogni n secondi, per G giorni. Per ogni canale e' definita da ANA_OPER la grandezza considerata importante (media, media del val.ass., media del modulo, deviaz.stand., varianza, minimo, massimo,..) che indica anche la grandezza che viene utilizzata nel calcolo degli eventi.


                TABELLA ANA_OPER

		1	MEDIA
		2	QUADRATO
		3	VALORE ASSOLUTO
		4	VARIANZA
		5	MASSIMO

All'inizio si vede dove e' arrivata l'ultima media calcolata dal run precedente (da TSTA_OUT) e si annullano tutti i valori fino all'istante di partenza del run e quindi si comincia a riempire l'anello (se l'interruzione e' piu' lunga di G, si annulla tutto e si parte da 1).


               UTILITY VARIABLES


	IN_SOFCH(I)	input ring index for I sofch

	 J_SOFCH(I)	last sofch rings index for I sofch
	JT_SOFCH(I)	last sofch measure for I sofch

	 J_CVET1(I)	last index in cvet1 for multifilter proc. I
	JT_CVET1(I)	how many measures in cvet1 since the beginning of the 
			run from multifilter I

	 K_SOFCH(I)	last used sofch rings index for I sofch
	KT_SOFCH(I)	last used sofch measure for I sofch

	L_IN_DAT=L_IN*N_CHAN_IN		lenght of INPUT ring in data

	JCH		bias for sofch

UTILITY SUBPROGRAMS

	FUNCTION K_FIELD(ICH,KK,KPLACE,NMEAS)

*     ICH     order number of the channel
*   K_FIELD   which field
*     KK      subsampling factor
*   KPLACE    the place in the field of the channel
*    NMEAS    number of measures in the field

*		FIELD LOGIC
*   If REC_CH is not 0, REC_CH rules. REC_CH = 100, 200 or 300 means in field
*   1, 2 or 3, in the place of the number of the channel, with natural rules,
*   but not in the archived records.
*   On the contrary, field 1 is default, unless the OUT channel number is > 25
*   and < 45, in which case field 2 is default, or the channel number is > 44
*   and < 61, in which case field 3 is default.
*   For SLOW channels, K_FIELD = 0 and KPLACE is the order number.

SUBROUTINE SOFCH(JFIELD,JCH,MEM_SOF)

 Field & Bias for SOFCH rings  [0 (header) -> 3]

 JFIELD(I)     field of channel I
 JCH(I)        bias for channel I in its ring
 MEM_SOF       length of the proper ring

	DIMENSION JFIELD(*),JCH(*),MEM_SOF(0:3)

FUNCTION R_SOFCH(JFIELD,JCH,I)

 General ring reading

INTEGER FUNCTION ICH_ORDNUM(ICH)


  ICH     name number of the channel (OUT_CH)

INTEGER FUNCTION N_BYTE(ICOD)


*   ICOD    R87 code [1->one byte fl.p., 2->two bytes integer, 3->two b. fl.p.)

REAL*8 FUNCTION G_IN(KIN)

   Timing for INPUT ring

 KIN    index of input ring


OPERATION: to date a sofch, use as KIN KT_SOFCH(I)*KK or JT_SOFCH(I)*KK

MASCHERA


	INPUT

	INP_CHAN     index  (1 <-> N_CHAN_IN)
	INP_NAM      A3, name input channel
	INP_STRIN    A20, description
	INP_OPER     in Analysis Mode, it is the input REC_CH

	SLOW analogue

	INP_SLOW     index  (N_CHAN_IN+1 <-> N_CHAN_IN+N_CHAN_SLOW)
	SLOW_NAM
	SLOW_STRIN
	SLOW_OPER

	OUTPUT

	OUT_CH       output channel number; typically
			1-16, 67-82  under sampled rough channels and slow
			17-25  field 1 type software channels
			 17,18,19  R^2,ZOP and WK  - mode
			 20,21,22  R^2,ZOP and WK  + mode
			 24  WK sum
			 25  WK minimum
			26-44  field 2 type software channels
			 26  AAP (volts)
			 27  AAP^2 (kelvin)
			 31,32,33  Matched Filter total and two modes (ChromoMF)
			 34,35,36  Hilbert Mat. Fil. total and two modes (ChrMF)
			 41  Post Matched Filter
			45-60  field 3 type software channels
			 45  Rephasing Matched Filter (Chromo)
			 50  is reserved for external excitation pulses (true
				or simulated)
			61-66  field 1 type software channels (special)
			67-82  field 1 type software (undersampled) channels
				(hardware channels 17-32 & slow)
			83-99  field 1 type software channels

 ***  Only the channels 1-80 are easily monitored

	OUT_CH_IN    input channel (or first of input channels); in some cases
	             it can be an OUT_CH already computed
	OUT_STRIN    A20, description
	OUT_OPER     type of operation (1 subsamp, 21 top second, >100 external,
		     10 AAP, 11 Mat.Filt., 12 Post M.F., 13 Chromo M.F., 14 RMF,
		     15 HMF, 16 Chr.HMF, 17 HRMF, 31 D.A.Temp.)

	       OUT_OPER(ICH) se e' 101: R^2
	       OUT_OPER(ICH) se e' 102: ZOP
	       OUT_OPER(ICH) se e' 121: wide band
	       OUT_OPER(ICH) se e' 103: wiener
	       OUT_OPER(ICH) se e' 110: minimo
	       OUT_OPER(ICH) se e' 111: Somma
 
	REC_CH       100*field + position inside the field
	OUT_COD      record writing code: 1 fl.point 8 bits, 2 I*2, 
		     3 fl.p. 16 bits
	OUT_DX       unit in case of OUT_COD = 3
	ANA_FLAG     flag for analysis (event search and hourly statistics;
		     0 -> no, odd -> sum square to energy, even -> sum to
                     energy, 3,4 -> shape,...; >=100 -> fixed threshold (non
		     statistical)
	ANA_OPER     story operator (1 mean, 2 square, 3 absolute value,
		     4 variance, 5 maximum)
	ANA_THR      event search statistical threshold
	ANA_TAU      event search tau (minutes)
	ANA_NORM     "normal" amplitude

	GSTAT_OUT	time duration of a story (in days)
	STRSTA_OUT	description of a story
	KRINGSTA_OUT	index of last entry in story ring
	DTSTA_OUT	sto

	TSTA_OUT	time of last entry of a story

	NHIST_OUT	number of histogrammed data of an histogram
	BIN_OUT		bin width of an histogram
	AMINHIST_OUT	minimum value of an histogram
	TZERHIST_OUT	time of zeroing of an histogram
	SUMHIST_OUT	sum of the histogrammed values
	QSUMHIST_OUT	sum of the squares of the histogrammed values

STANDARD FILTERS NAMES


There are some numbers that are used for standard filters, some of these are
compelling (*):

	17	R^2  nu -
	18	ZOP  nu -
	19	W-K  nu -

	20	R^2  nu +
	21	ZOP  nu +
	22	W-K  nu +

	25      W-K minimum or sum

	31	MF
	32	MF -
	33	MF +

	34	Hilbert MF
	35	Hilbert MF -
	36	Hilbert MF +

	41	Post MF

	45	Rephasing MF
	46	Hilbert Rephasing MF

HF_MODE

The philosophy of the HF_MODE is different with respect to the standard DAGA2. The idea is to have less input channels, but a higher frequency. The analysis of these channels may be more complex, so to describe a procedure many parameters may be needed.

There are some particular key words acting like commands (which are needed to tell the program which is reading the mask, how to read such text file - see the subroutine read_mask in daga2_c):

HF_MODE: interprets the mask (and channels) as operating HF. This is necessary because in this mode the way to read the mask may be different from the non-Hf mode (forse e` inutile).

MULTI_FILT:starts a multifilter procedure (calls the decoder).

MULTI_FILT_PAR n,chan: parameters of the procedure n which uses the data from the input channel chan; the procedure used is defined by specifying the following parameters and is labelled by the index n:

SUB_SAMP ks:subsampling factor; if it doesn't exist then ks=1, i.e. no subsampling.

L_FFT_IN l: length of the FFT which will be performed on the data.

FREQ k,fr,lfilt,mode:

the whole spectrum is divided in sub-bands, described by the following parameters:

FILT_FR kk,proc: it operates separately on each sub-band, thus on the one being considered. kk defines the kk-th stream produced in the sub-band and there exists a proc

FILT_TM kkk,proc,out_ch: it operates separately on each (afft) kk stream, with a procedure proc and produces a new stream kkk, which goes into the output channel out_ch.

proc filtering procedure:

  1. raw data subsampling
  2. lock-in at fr
  3. AAP
  4. matched filter
  5. rephasing matched filter
  6. Hilbert matched filter

END: ends the multifilter procedure.

				5000 Hz
				   |
				   |
			subsampling (SUB_SAMP)
				   |
				   |	
				fft (L_FFT_IN)
				   |
				   |
			sub-bands created (FREQ)	
		_________________________________________
	   k=1  |		k=2|		    k=3	|
		|		   |			|
		|		   |			|
		|		   |			|

			
	   _____|______       _____|______	    ____|_____
	    | |   |  | 		|  |  |		     | |  | |		
	    | |   |  |		|  |  |              | |  | |