1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
#
# Demonstrate column selection by id/name/ucd <FIELD> attribute.
# Set the test description string.
votest.descr = "Demonstrate column selection by id/name/ucd <FIELD> attribute"
# Convert the data$logical to a local path.
s1 = data_url // "/usno-b.xml"
s2 = "file://" // data_path // "/usno-b.xml"
s3 = "file:///localhost" // data_path // "/usno-b.xml"
print ("------------------------------------------------------------------")
print ("Req 1.2.1: Users shall be able to identify a column in a VOTable")
print (" by the 'id', 'name' or 'ucd' attribute of a <FIELD> or")
print (" by column number.")
print ("------------------------------------------------------------------")
fcache init
int ra_col, dec_col
# Execute the test commands.
unlearn ("colbyid") ; colbyid.print = yes
unlearn ("colbyname") ; colbyname.print = yes
unlearn ("colbyucd") ; colbyucd.print = yes
########################################################################
print ("\n------ Identify RA,DEC col by 'id' string ------\n")
print ("\nLogical Path: data$usno-b.xml") # logical path
colbyid ("data$usno-b.xml", "RA") | scan (ra_col)
colbyid ("data$usno-b.xml", "DEC") | scan (dec_col)
printf ("RA,DEC are cols: %d and %d\n", ra_col, dec_col)
print ("\nHTTP URI: " // s1) # remote http URI
colbyid (s1, "RA") | scan (ra_col)
colbyid (s1, "DEC") | scan (dec_col)
printf ("RA,DEC are cols: %d and %d\n", ra_col, dec_col)
print ("\nFile URI: " // s2) # file URI
colbyid (s2, "RA") | scan (ra_col)
colbyid (s2, "DEC") | scan (dec_col)
printf ("RA,DEC are cols: %d and %d\n", ra_col, dec_col)
print ("\nFile URI: " // s3) # file URI
colbyid (s3, "RA") | scan (ra_col)
colbyid (s3, "DEC") | scan (dec_col)
printf ("RA,DEC are cols: %d and %d\n", ra_col, dec_col)
unlearn ("colbyid")
########################################################################
print ("\n------ Identify RA,DEC col by 'name' string ------\n")
print ("\nLogical Path: data$usno-b.xml") # logical path
colbyname ("data$usno-b.xml", "RA") | scan (ra_col)
colbyname ("data$usno-b.xml", "DEC") | scan (dec_col)
printf ("RA,DEC are cols: %d and %d\n", ra_col, dec_col)
print ("\nHTTP URI: " // s1) # remote http URI
colbyname (s1, "RA") | scan (ra_col)
colbyname (s1, "DEC") | scan (dec_col)
printf ("RA,DEC are cols: %d and %d\n", ra_col, dec_col)
print ("\nFile URI: " // s2) # file URI
colbyname (s2, "RA") | scan (ra_col)
colbyname (s2, "DEC") | scan (dec_col)
printf ("RA,DEC are cols: %d and %d\n", ra_col, dec_col)
print ("\nFile URI: " // s3) # file URI
colbyname (s3, "RA") | scan (ra_col)
colbyname (s3, "DEC") | scan (dec_col)
printf ("RA,DEC are cols: %d and %d\n", ra_col, dec_col)
unlearn ("colbyname")
########################################################################
print ("\n------ Identify RA,DEC col by 'ucd' string ------\n")
print ("\nLogical Path: data$usno-b.xml") # logical path
colbyucd ("data$usno-b.xml", "POS_EQ_RA_MAIN") | scan (ra_col)
colbyucd ("data$usno-b.xml", "POS_EQ_DEC_MAIN") | scan (dec_col)
printf ("RA,DEC are cols: %d and %d\n", ra_col, dec_col)
print ("\nHTTP URI: " // s1) # remote http URI
colbyucd (s1, "POS_EQ_RA_MAIN") | scan (ra_col)
colbyucd (s1, "POS_EQ_DEC_MAIN") | scan (dec_col)
printf ("RA,DEC are cols: %d and %d\n", ra_col, dec_col)
print ("\nFile URI: " // s2) # file URI
colbyucd (s2, "POS_EQ_RA_MAIN") | scan (ra_col)
colbyucd (s2, "POS_EQ_DEC_MAIN") | scan (dec_col)
printf ("RA,DEC are cols: %d and %d\n", ra_col, dec_col)
print ("\nFile URI: " // s3) # file URI
colbyucd (s3, "POS_EQ_RA_MAIN") | scan (ra_col)
colbyucd (s3, "POS_EQ_DEC_MAIN") | scan (dec_col)
printf ("RA,DEC are cols: %d and %d\n", ra_col, dec_col)
unlearn ("colbyucd")
|