datachk

DESCRIPTION

"datachk" checks K5/VSSP or K5/VSSP32 data and output results to log files.

SYNOPSIS

datachk file_name [mode [logfile [errlog [keepmode]]]] [options]

where

file_name K5 data file name to check
mode set statistics display mode
0 no display (default)
display first and last frame information and errored frames only
1 display percentage of '+' sign data in analogue data.
2 same as mode=0, but display all frames
3 display occurrence distribution of AD data by 1 second
4 display occurrence distribution of AD data for all data
logfile log file name for summary output in case of mode=0. file name starting with '-' means append mode open (default is no output)
errlog log file name to contain errors detected in data file for mode=0. This file will not be created in case of no error (default is no output) file name starting with '-' means append mode open
keepmode set the mode of keeping data file when error occurred in case of mode=0.
0 nothing to do (default)
1 rename to original_name+".NNNN.err"
2 copy to original_name+".NNNN.err"
where NNNN is 0001 to 9999. (this number is kept in "counter_file_datachk.tmp" under the current directory.
OPTIONS
-s2 set # of channels to 2 compulsory in case of K5/VSSP64 data.

EXAMPLES

Ex.1 execute with default mode

	$ datachk G220205919a.dat
	************ datachk  Ver. 2016-09-02 ************
	     [Note: # of bits does not include Header]
	FILE : G220205919a.dat  (480051200 bytes)

	 This is K5/VSSP32 format data.

	  1st Extended Header Info is as follows.
	    Year = 2010    Total Day = 220
	    Version  Major = 1  Minor = 0    # of AUX Bytes = 20
	    AUX Field Data :  20471001 41474F4B 2049454E 6137356B 20202020
	        Format # = 1
	        Filter (MHz)  : 16
	        Station info  : ID2(G ) name(KOGANEI )
	        PC host name  :  k57a


	 FMT A/D CH  f(MHz)  TIME   seconds   # of bits
	VS32  1   4     32 20:59:19  75559     128000000
	    checking.....
	VS32  1   4     32 20:59:49  75589        401664
	Warning! (Frame data not completed) (401664/128000000) <== this is due to the incompletion of the last frame

	480051200 bytes read
	    0 frames out of   31 frames (  0.00%) are bad (bit slip) frames.
	    0 frames out of   31 frames (  0.00%) are time discon frames.
	    0 frames out of   31 frames (  0.00%) are time discon and bit slip frames.
	    0 frames out of   31 frames (  0.00%) are EFLG set frames.
	Time elapsed for processing is 0.000916 sec

Ex.2 check 2-bit AD data with mode=4

	$ datachk ads_2012300165730.k5a 4
	************ datachk  Ver. 2016-09-02 ************
	     [Note: # of bits does not include Header]
	FILE : ads_2012300165730.k5a  (267840430 bytes)

	 This is K5/VSSP32 format data.

	  1st Extended Header Info is as follows.
	    Year = 2012    Total Day = 300
	    Version  Major = 0  Minor = 0    # of AUX Bytes = 20
	    AUX Field Data :  55550002 55555555 55555555 32534441 2020354B
	        Format # = 2
	        Filter (MHz)  : 0
	        PC host name  :  ADS2K5


	                                                    % of plus sign data
	 FMT A/D CH  f(MHz)  TIME   seconds    # of bits    Ch1    Ch2    Ch3    Ch4
	VS32  2   4     64 16:57:30  61050     512000000   50.0   50.0   50.0   50.0
	VS32  2   4     64 16:57:31  61051     512000000   50.0   50.0   50.0   50.0
	VS32  2   4     64 16:57:32  61052     512000000   50.0   50.0   50.0   50.0
	VS32  2   4     64 16:57:33  61053     512000000   50.0   50.0   50.0   50.0
	VS32  2   4     64 16:57:34  61054      94722144   50.0   50.0   50.0   50.0
	Warning! (Frame data not completed) (94722144/512000000) <== this is due to the incompletion of the last frame
	VS32  2   4     64 16:57:34  61054NG

	                        Level Histogram (ALL Data Period)
	LEVEL         CH1               CH2               CH3               CH4
	  0   49151401(18.4%)   46554649(17.4%)   49150728(18.4%)   46654050(17.4%)
	  1   84781824(31.7%)   87370733(32.6%)   84761837(31.6%)   87265832(32.6%)
	  2   84760753(31.6%)   87361932(32.6%)   84778617(31.7%)   87268066(32.6%)
	  3   49146290(18.3%)   46552954(17.4%)   49149086(18.4%)   46652320(17.4%)
	SUM  267840268         267840268         267840268         267840268

	267840428 bytes read
	0 frames out of 5 frames (0.000000%) are bad frames.
	Time elapsed for processing is 5.099330 sec
Example of summary file

	# File Name:
	D:\IPVLBI\data\test02.dat
	# FMT  A/D CH  f(kHz)  LPF(MHz):
	  VS32  1   1   32000       16
	# Start and Last Time:
	  2006/318 23:20:28  84028  
	  2006/318 23:25:27  84327  
	# Duration:
	300
	# Byte offset of 1st header:
	0
	# STATISTICS total bad discon discon_with_bitslip aux_sep EFLG:
	300 1 0 0 147 0
	# BIT SLIP:
	1 26432
Example of error log file

in case of keepmode=0

	# Errored Data File Name:
	test02.dat
	# FMT  A/D CH  f(kHz)  LPF(MHz):
	  VS32  1   1   32000       16

in case of keepmode=1 (rename mode)

	# Errored Data File Name:
	test02.dat
	# FMT  A/D CH  f(kHz)  LPF(MHz):
	  VS32  1   1   32000       16
	# Renamed to:
	test02.dat.0006.err

in case of keepmode=2 (copy mode)

	# Errored Data File Name:
	test02.dat
	# FMT  A/D CH  f(kHz)  LPF(MHz):
	  VS32  1   1   32000       16
	# Copied to:
	test02.dat.0007.err


Updated on February 28, 2017