Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1556 |
|
Package | utility | |
Module | table | |
Tool | tablecomparer |
Here are a couple of examples. Suppose you have a table with a column of type double called DCOL. If you run settolerance(double=1e-8) then the acceptable tolerance when checking the values in this column will be 1e-8.
The way to specify tolerances on a per column basis is to pass in a record with fields of the form TABLELABEL.COLUMNNAME, bearing in mind that the default value of label in the tablecomparer() constructor is TABLE and that subtables of the main table are labeled by their names. So in the previous example, if you used the default value of label when constructing a tablecomparer tool, you could run
tc := tablecomparer('test.table','fiducial.table') tol := [=]; tol.TABLE.DCOL := 1e-8; tc.setprecision(cols := tol);
If you wanted to set the tolerance of DCOL in the main table to 1e-8 and the tolerance of GCOL of subtable GTABLE to be 1e-5, you could run
tc := tablecomparer('test.table','fiducial.table') tol := [=]; tol.TABLE.DCOL := 1e-8; tol.GTABLE.GCOL := 1e-5; tc.setprecision(cols := tol);
float | Default tolerance for all columns of type float | ||
Allowed: | Float | ||
Default: | 0 | ||
double | Default tolerance for all columns of type double | ||
Allowed: | Double | ||
Default: | 0 | ||
complex | Default tolerance for all columns of type complex | ||
Allowed: | Float | ||
Default: | 0 | ||
dcomplex | Default tolerance for all columns of type complex | ||
Allowed: | Double | ||
Default: | 0 | ||
cols | Column specific tolerances (see above for examples | ||
Allowed: | Record containing real values | ||
Default: | [=] |
- tc := tablecomparer('test.table','fiducial.table',verbose=3) - # set the default tolerance of all columns of type double to 1e-8 - # all float columns to 1e-4, and set the tolerance of the GAIN - # column in the main table to 1e-5 and the CHA_WIDTH column in the - # CAL_DESC table to 1e-4 - tol := [=]; - tol.TABLE.GAIN := 1e-5; - tol.CAL_DESC.CHAN_WIDTH := 1e-4; - tc.settolerance(float=1e-5, double=1e-8, cols=tol); T # compare column data using these tolerances - tc.checkcoldata(); NORMAL: Checking column TIME NORMAL: Using tolerance 1e-08 on table TABLE column TIME NORMAL: Column data test passed on table TABLE column TIME NORMAL: Checking column TIME_EXTRA_PREC NORMAL: Using tolerance 1e-08 on table TABLE column TIME_EXTRA_PREC NORMAL: Column data test passed on table TABLE column TIME_EXTRA_PREC NORMAL: Checking column INTERVAL NORMAL: Using tolerance 1e-08 on table TABLE column INTERVAL NORMAL: Column data test passed on table TABLE column INTERVAL NORMAL: Checking column ANTENNA1 NORMAL: Column data test passed on table TABLE column ANTENNA1 NORMAL: Checking column FEED1 NORMAL: Column data test passed on table TABLE column FEED1 NORMAL: Checking column FIELD_ID NORMAL: Column data test passed on table TABLE column FIELD_ID NORMAL: Checking column ARRAY_ID NORMAL: Column data test passed on table TABLE column ARRAY_ID NORMAL: Checking column OBSERVATION_ID NORMAL: Column data test passed on table TABLE column OBSERVATION_ID NORMAL: Checking column SCAN_NUMBER NORMAL: Column data test passed on table TABLE column SCAN_NUMBER NORMAL: Checking column PROCESSOR_ID NORMAL: Column data test passed on table TABLE column PROCESSOR_ID NORMAL: Checking column STATE_ID NORMAL: Column data test passed on table TABLE column STATE_ID NORMAL: Checking column PHASE_ID NORMAL: Column data test passed on table TABLE column PHASE_ID NORMAL: Checking column PULSAR_BIN NORMAL: Column data test passed on table TABLE column PULSAR_BIN NORMAL: Checking column PULSAR_GATE_ID NORMAL: Column data test passed on table TABLE column PULSAR_GATE_ID NORMAL: Checking column FREQ_GROUP NORMAL: Column data test passed on table TABLE column FREQ_GROUP NORMAL: Checking column FREQ_GROUP_NAME NORMAL: Column data test passed on table TABLE column FREQ_GROUP_NAME NORMAL: Checking column FIELD_NAME NORMAL: Column data test passed on table TABLE column FIELD_NAME NORMAL: Checking column FIELD_CODE NORMAL: Column data test passed on table TABLE column FIELD_CODE NORMAL: Checking column SOURCE_NAME NORMAL: Column data test passed on table TABLE column SOURCE_NAME NORMAL: Checking column SOURCE_CODE NORMAL: Column data test passed on table TABLE column SOURCE_CODE NORMAL: Checking column CALIBRATION_GROUP NORMAL: Column data test passed on table TABLE column CALIBRATION_GROUP NORMAL: Checking column GAIN NORMAL: Using tolerance 1e-05 on table TABLE column GAIN NORMAL: Column data test passed on table TABLE column GAIN NORMAL: Checking column REF_ANT NORMAL: Column data test passed on table TABLE column REF_ANT NORMAL: Checking column REF_FEED NORMAL: Column data test passed on table TABLE column REF_FEED NORMAL: Checking column REF_RECEPTOR NORMAL: Column data test passed on table TABLE column REF_RECEPTOR NORMAL: Checking column REF_FREQUENCY NORMAL: Using tolerance 1e-08 on table TABLE column REF_FREQUENCY NORMAL: Column data test passed on table TABLE column REF_FREQUENCY NORMAL: Checking column MEAS_FREQ_REF NORMAL: Column data test passed on table TABLE column MEAS_FREQ_REF NORMAL: Checking column REF_DIRECTION NORMAL: Using tolerance 1e-08 on table TABLE column REF_DIRECTION NORMAL: Column data test passed on table TABLE column REF_DIRECTION NORMAL: Checking column MEAS_DIR_REF NORMAL: Column data test passed on table TABLE column MEAS_DIR_REF NORMAL: Checking column CAL_DESC_ID NORMAL: Column data test passed on table TABLE column CAL_DESC_ID NORMAL: Checking column CAL_HISTORY_ID NORMAL: Column data test passed on table TABLE column CAL_HISTORY_ID NORMAL: Checking column TOTAL_SOLUTION_OK NORMAL: Column data test passed on table TABLE column TOTAL_SOLUTION_OK NORMAL: Checking column TOTAL_FIT NORMAL: Using tolerance 1e-05 on table TABLE column TOTAL_FIT NORMAL: Column data test passed on table TABLE column TOTAL_FIT NORMAL: Checking column TOTAL_FIT_WEIGHT NORMAL: Using tolerance 1e-05 on table TABLE column TOTAL_FIT_WEIGHT NORMAL: Column data test passed on table TABLE column TOTAL_FIT_WEIGHT NORMAL: Checking column SOLUTION_OK NORMAL: Column data test passed on table TABLE column SOLUTION_OK NORMAL: Checking column FIT NORMAL: Using tolerance 1e-05 on table TABLE column FIT NORMAL: Column data test passed on table TABLE column FIT NORMAL: Checking column FIT_WEIGHT NORMAL: Using tolerance 1e-05 on table TABLE column FIT_WEIGHT NORMAL: Column data test passed on table TABLE column FIT_WEIGHT NORMAL: successful readonly open of default-locked table test.table/CAL_DESC: 12 columns, 1 rows NORMAL: successful readonly open of default-locked table fiducial.table/CAL_DESC: 12 columns, 1 rows NORMAL: Checking column NUM_SPW NORMAL: Column data test passed on table CAL_DESC column NUM_SPW NORMAL: Checking column NUM_CHAN NORMAL: Column data test passed on table CAL_DESC column NUM_CHAN NORMAL: Checking column NUM_RECEPTORS NORMAL: Column data test passed on table CAL_DESC column NUM_RECEPTORS NORMAL: Checking column N_JONES NORMAL: Column data test passed on table CAL_DESC column N_JONES NORMAL: Checking column SPECTRAL_WINDOW_ID NORMAL: Column data test passed on table CAL_DESC column SPECTRAL_WINDOW_ID NORMAL: Checking column CHAN_FREQ NORMAL: Using tolerance 1e-08 on table CAL_DESC column CHAN_FREQ NORMAL: Column data test passed on table CAL_DESC column CHAN_FREQ NORMAL: Checking column MEAS_FREQ_REF NORMAL: Column data test passed on table CAL_DESC column MEAS_FREQ_REF NORMAL: Checking column CHAN_WIDTH NORMAL: Using tolerance 0.0001 on table CAL_DESC column CHAN_WIDTH NORMAL: Column data test passed on table CAL_DESC column CHAN_WIDTH NORMAL: Checking column CHAN_RANGE NORMAL: Column data test passed on table CAL_DESC column CHAN_RANGE NORMAL: Checking column POLARIZATION_TYPE NORMAL: Column data test passed on table CAL_DESC column POLARIZATION_TYPE NORMAL: Checking column JONES_TYPE NORMAL: Column data test passed on table CAL_DESC column JONES_TYPE NORMAL: Checking column MS_NAME NORMAL: Column data test passed on table CAL_DESC column MS_NAME NORMAL: successful readonly open of default-locked table test.table/CAL_HISTORY: 4 columns, 0 rows NORMAL: successful readonly open of default-locked table fiducial.table/CAL_HISTORY: 4 columns, 0 rows NORMAL: Checking column CAL_PARMS NORMAL: Column data test passed on table CAL_HISTORY column CAL_PARMS NORMAL: Checking column CAL_TABLES NORMAL: Column data test passed on table CAL_HISTORY column CAL_TABLES NORMAL: Checking column CAL_SELECT NORMAL: Column data test passed on table CAL_HISTORY column CAL_SELECT NORMAL: Checking column CAL_NOTES NORMAL: Column data test passed on table CAL_HISTORY column CAL_NOTES T