voruby 1.1.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (257) hide show
  1. data/Rakefile.rb +107 -224
  2. data/lib/misc.rb +1 -0
  3. data/lib/misc/misc.rb +60 -0
  4. data/lib/misc/propertyfile.rb +31 -0
  5. data/lib/symphony.rb +1 -0
  6. data/lib/symphony/symphony.rb +247 -0
  7. data/lib/voruby.rb +186 -0
  8. data/lib/voruby/active_votable/active_votable.rb +468 -347
  9. data/lib/voruby/adql/1.0/adql.rb +2418 -0
  10. data/lib/voruby/adql/support.rb +2 -0
  11. data/lib/voruby/misc.rb +351 -0
  12. data/lib/voruby/misc/connection_monitor.rb +97 -0
  13. data/lib/voruby/misc/libxml_ext.rb +121 -0
  14. data/lib/voruby/misc/rexml_ext.rb +223 -0
  15. data/lib/voruby/resolver/resolver.rb +12 -0
  16. data/lib/voruby/resolver/sesame.rb +299 -0
  17. data/lib/voruby/sky_query/sky_query.rb +192 -0
  18. data/lib/voruby/stc/1.10/coords.rb +2272 -0
  19. data/lib/voruby/stc/1.10/region.rb +892 -0
  20. data/lib/voruby/stc/1.10/stc.rb +3271 -0
  21. data/lib/voruby/stc/1.30/stc.rb +8666 -0
  22. data/lib/voruby/stc/support.rb +2 -0
  23. data/lib/voruby/ucd/ucd.rb +173 -0
  24. data/lib/voruby/voevent/1.1/voevent.rb +1124 -0
  25. data/lib/voruby/voevent/support.rb +5 -0
  26. data/lib/voruby/votable/1.0/votable.rb +1807 -0
  27. data/lib/voruby/votable/1.1/votable.rb +2100 -0
  28. data/lib/voruby/votable/votable.rb +305 -0
  29. data/lib/voruby/wesix/wesix.rb +491 -0
  30. data/lib/voruby/xlink/1.2/xlink.rb +21 -0
  31. data/test/voruby/active_votable/complex.vot +60 -0
  32. data/test/voruby/active_votable/error.vot +6 -0
  33. data/test/voruby/active_votable/large.vot +130040 -0
  34. data/test/voruby/active_votable/simple1.vot +38 -0
  35. data/test/voruby/active_votable/simple2.vot +38 -0
  36. data/test/voruby/active_votable/test.rb +193 -0
  37. data/test/voruby/adql/1.0/adql-alias.sql +1 -0
  38. data/test/voruby/adql/1.0/adql-alias.xml +26 -0
  39. data/test/voruby/adql/1.0/adql-avg.sql +1 -0
  40. data/test/voruby/adql/1.0/adql-avg.xml +31 -0
  41. data/test/voruby/adql/1.0/adql-circle.sql +1 -0
  42. data/test/voruby/adql/1.0/adql-circle.xml +46 -0
  43. data/test/voruby/adql/1.0/adql-expr.sql +1 -0
  44. data/test/voruby/adql/1.0/adql-expr.xml +34 -0
  45. data/test/voruby/adql/1.0/adql-function.sql +1 -0
  46. data/test/voruby/adql/1.0/adql-function.xml +41 -0
  47. data/test/voruby/adql/1.0/adql-group.sql +1 -0
  48. data/test/voruby/adql/1.0/adql-group.xml +51 -0
  49. data/test/voruby/adql/1.0/adql-having.sql +1 -0
  50. data/test/voruby/adql/1.0/adql-having.xml +25 -0
  51. data/test/voruby/adql/1.0/adql-like.sql +1 -0
  52. data/test/voruby/adql/1.0/adql-like.xml +17 -0
  53. data/test/voruby/adql/1.0/adql-order.sql +1 -0
  54. data/test/voruby/adql/1.0/adql-order.xml +37 -0
  55. data/test/voruby/adql/1.0/adql-simple.sql +1 -0
  56. data/test/voruby/adql/1.0/adql-simple.xml +12 -0
  57. data/test/voruby/adql/1.0/adql-top.sql +1 -0
  58. data/test/voruby/adql/1.0/adql-top.xml +33 -0
  59. data/test/voruby/adql/1.0/test.rb +2220 -0
  60. data/test/voruby/misc/test.rb +32 -0
  61. data/test/voruby/resolver/sesame/test.rb +56 -0
  62. data/test/voruby/sky_query/test.rb +107 -0
  63. data/test/voruby/stc/1.10/coords_test.rb +3704 -0
  64. data/test/voruby/stc/1.10/region_test.rb +993 -0
  65. data/test/voruby/stc/1.10/stc-catalog-entry-location.xml +112 -0
  66. data/test/voruby/stc/1.10/stc-obs-data-location.xml +126 -0
  67. data/test/voruby/stc/1.10/stc-region-circle.xml +5 -0
  68. data/test/voruby/stc/1.10/stc-region-convex.xml +11 -0
  69. data/test/voruby/stc/1.10/stc-region-convexhull.xml +5 -0
  70. data/test/voruby/stc/1.10/stc-region-ellipse.xml +7 -0
  71. data/test/voruby/stc/1.10/stc-region-intersection.xml +25 -0
  72. data/test/voruby/stc/1.10/stc-region-negation.xml +7 -0
  73. data/test/voruby/stc/1.10/stc-region-polygon.xml +13 -0
  74. data/test/voruby/stc/1.10/stc-region-sector.xml +6 -0
  75. data/test/voruby/stc/1.10/stc-region-union.xml +25 -0
  76. data/test/voruby/stc/1.10/stc-resource-profile.xml +60 -0
  77. data/test/voruby/stc/1.10/stc-search-location.xml +54 -0
  78. data/test/voruby/stc/1.10/stc_test.rb +4626 -0
  79. data/test/voruby/stc/1.30/stc-catalog-entry-location.xml +210 -0
  80. data/test/voruby/stc/1.30/stc-obs-data-location-arecibo.xml +353 -0
  81. data/test/voruby/stc/1.30/stc-obs-data-location-fits.xml +250 -0
  82. data/test/voruby/stc/1.30/stc-obs-data-location-xlink.xml +63 -0
  83. data/test/voruby/stc/1.30/stc-obs-data-location.xml +216 -0
  84. data/test/voruby/stc/1.30/stc-resource-profile-unusual-ref-pos.xml +39 -0
  85. data/test/voruby/stc/1.30/stc-resource-profile.xml +129 -0
  86. data/test/voruby/stc/1.30/stc-search-location-arecibo.xml +86 -0
  87. data/test/voruby/stc/1.30/stc-search-location.xml +101 -0
  88. data/test/voruby/stc/1.30/test.rb +6274 -0
  89. data/test/voruby/ucd/test.rb +48 -0
  90. data/test/voruby/voevent/1.1/test.rb +812 -0
  91. data/test/{voevent/voevent_v1_1.xml → voruby/voevent/1.1/voevent.xml} +2 -2
  92. data/test/voruby/voregistry/0.3/test.rb +137 -0
  93. data/test/voruby/votable/1.0/test.rb +714 -0
  94. data/test/voruby/votable/1.0/votable.basic.xml +660 -0
  95. data/test/voruby/votable/1.0/votable.html +86 -0
  96. data/test/voruby/votable/1.0/votable.ns.xml +56 -0
  97. data/test/voruby/votable/1.1/test.rb +785 -0
  98. data/test/voruby/votable/1.1/votable.basic.xml +38 -0
  99. data/test/voruby/votable/1.1/votable.html +86 -0
  100. data/test/voruby/votable/1.1/votable.ns.xml +56 -0
  101. data/test/voruby/votable/test.rb +15 -0
  102. data/test/voruby/wesix/test.rb +268 -0
  103. data/test/voruby/wesix/testr.fits +28 -0
  104. metadata +234 -247
  105. data/REQUIREMENTS +0 -6
  106. data/lib/voruby/active_votable/loader.rb +0 -5
  107. data/lib/voruby/adql/adql.rb +0 -2787
  108. data/lib/voruby/adql/ext.rb +0 -14
  109. data/lib/voruby/adql/loader.rb +0 -6
  110. data/lib/voruby/adql/operations.rb +0 -54
  111. data/lib/voruby/adql/parser.rb +0 -160
  112. data/lib/voruby/adql/transforms.rb +0 -573
  113. data/lib/voruby/ext.rb +0 -17
  114. data/lib/voruby/loader.rb +0 -4
  115. data/lib/voruby/misc/propertyfile.rb +0 -36
  116. data/lib/voruby/plastic/applications.rb +0 -174
  117. data/lib/voruby/plastic/constants.rb +0 -30
  118. data/lib/voruby/plastic/loader.rb +0 -10
  119. data/lib/voruby/plastic/plastic.rb +0 -1
  120. data/lib/voruby/resources/conesearch/conesearch.rb +0 -9
  121. data/lib/voruby/resources/conesearch/conesearch_v0_2.rb +0 -55
  122. data/lib/voruby/resources/conesearch/conesearch_v0_3.rb +0 -50
  123. data/lib/voruby/resources/conesearch/conesearch_v1_0.rb +0 -72
  124. data/lib/voruby/resources/conesearch/loader.rb +0 -4
  125. data/lib/voruby/resources/loader.rb +0 -50
  126. data/lib/voruby/resources/nodes.rb +0 -190
  127. data/lib/voruby/resources/openskynode/loader.rb +0 -4
  128. data/lib/voruby/resources/openskynode/openskynode.rb +0 -9
  129. data/lib/voruby/resources/openskynode/openskynode_v0_1.rb +0 -54
  130. data/lib/voruby/resources/sia/loader.rb +0 -5
  131. data/lib/voruby/resources/sia/sia.rb +0 -9
  132. data/lib/voruby/resources/sia/sia_v0_6.rb +0 -90
  133. data/lib/voruby/resources/sia/sia_v0_7.rb +0 -89
  134. data/lib/voruby/resources/sia/sia_v1_0.rb +0 -122
  135. data/lib/voruby/resources/stsci.rb +0 -59
  136. data/lib/voruby/resources/vodataservice/coverage_v0_2.rb +0 -195
  137. data/lib/voruby/resources/vodataservice/coverage_v0_3.rb +0 -158
  138. data/lib/voruby/resources/vodataservice/loader.rb +0 -5
  139. data/lib/voruby/resources/vodataservice/vodataservice.rb +0 -9
  140. data/lib/voruby/resources/vodataservice/vodataservice_v0_4.rb +0 -189
  141. data/lib/voruby/resources/vodataservice/vodataservice_v0_5.rb +0 -163
  142. data/lib/voruby/resources/vodataservice/vodataservice_v1_0.rb +0 -221
  143. data/lib/voruby/resources/voregistry/loader.rb +0 -4
  144. data/lib/voruby/resources/voregistry/voregistry.rb +0 -9
  145. data/lib/voruby/resources/voregistry/voregistry_v0_2.rb +0 -40
  146. data/lib/voruby/resources/voregistry/voregistry_v0_3.rb +0 -30
  147. data/lib/voruby/resources/voregistry/voregistry_v1_0.rb +0 -86
  148. data/lib/voruby/resources/voresource/loader.rb +0 -17
  149. data/lib/voruby/resources/voresource/voresource.rb +0 -9
  150. data/lib/voruby/resources/voresource/voresource_v0_10.rb +0 -327
  151. data/lib/voruby/resources/voresource/voresource_v0_9.rb +0 -405
  152. data/lib/voruby/resources/voresource/voresource_v1_0.rb +0 -230
  153. data/lib/voruby/services/ext.rb +0 -11
  154. data/lib/voruby/services/gestalt/footprint.rb +0 -95
  155. data/lib/voruby/services/gestalt/wcs_fixer.rb +0 -105
  156. data/lib/voruby/services/gestalt/wesix.rb +0 -155
  157. data/lib/voruby/services/loader.rb +0 -7
  158. data/lib/voruby/services/registry/registry.rb +0 -53
  159. data/lib/voruby/services/resolver/resolver.rb +0 -35
  160. data/lib/voruby/services/schema/schema.rb +0 -644
  161. data/lib/voruby/sesame/loader.rb +0 -6
  162. data/lib/voruby/sesame/sesame_v1_0.rb +0 -64
  163. data/lib/voruby/simple/loader.rb +0 -6
  164. data/lib/voruby/simple/parameters.rb +0 -196
  165. data/lib/voruby/simple/sap.rb +0 -446
  166. data/lib/voruby/spacetime/loader.rb +0 -3
  167. data/lib/voruby/spacetime/spacetime.rb +0 -607
  168. data/lib/voruby/stc/coords_v1_20.rb +0 -900
  169. data/lib/voruby/stc/loader.rb +0 -55
  170. data/lib/voruby/stc/region_v1_20.rb +0 -274
  171. data/lib/voruby/stc/stc_v1_20.rb +0 -1196
  172. data/lib/voruby/util.rb +0 -27
  173. data/lib/voruby/voevent/loader.rb +0 -7
  174. data/lib/voruby/voevent/voevent_v1_0.rb +0 -213
  175. data/lib/voruby/voevent/voevent_v1_1.rb +0 -196
  176. data/lib/voruby/votables/chandra.rb +0 -373
  177. data/lib/voruby/votables/data.rb +0 -179
  178. data/lib/voruby/votables/galex.rb +0 -377
  179. data/lib/voruby/votables/int.rb +0 -354
  180. data/lib/voruby/votables/libxml_parser.rb +0 -411
  181. data/lib/voruby/votables/libxml_votable.rb +0 -67
  182. data/lib/voruby/votables/loader.rb +0 -10
  183. data/lib/voruby/votables/meta.rb +0 -763
  184. data/lib/voruby/votables/misc.rb +0 -51
  185. data/lib/voruby/votables/nsa.rb +0 -410
  186. data/lib/voruby/votables/rexml_parser.rb +0 -408
  187. data/lib/voruby/votables/rexml_votable.rb +0 -67
  188. data/lib/voruby/votables/sdss.rb +0 -356
  189. data/lib/voruby/votables/transforms.rb +0 -388
  190. data/lib/voruby/votables/tree.rb +0 -45
  191. data/lib/voruby/votables/types.rb +0 -391
  192. data/lib/voruby/votables/votable.rb +0 -687
  193. data/test/active_votable/database.yml +0 -6
  194. data/test/active_votable/test.vot +0 -168492
  195. data/test/active_votable/unittest.rb +0 -41
  196. data/test/adql/test1.adql +0 -49
  197. data/test/adql/test2.adql +0 -51
  198. data/test/adql/test3.adql +0 -81
  199. data/test/adql/test4.adql +0 -53
  200. data/test/adql/test5.adql +0 -55
  201. data/test/adql/test6.adql +0 -18
  202. data/test/adql/test7.adql +0 -48
  203. data/test/adql/unittest.rb +0 -1672
  204. data/test/plastic/test.rb +0 -44
  205. data/test/plastic/test.vot +0 -5385
  206. data/test/plastic/unittest.rb +0 -66
  207. data/test/resources/conesearch/conesearch_v0_3.xml +0 -31
  208. data/test/resources/conesearch/conesearch_v1_0.xml +0 -86
  209. data/test/resources/conesearch/unittest_v0_3.rb +0 -22
  210. data/test/resources/conesearch/unittest_v1_0.rb +0 -24
  211. data/test/resources/openskynode/open_sky_node_v0_1.xml +0 -32
  212. data/test/resources/openskynode/unittest_v0_1.rb +0 -31
  213. data/test/resources/sia/simple_image_access_v0_7.xml +0 -36
  214. data/test/resources/sia/simple_image_access_v1_0.xml +0 -122
  215. data/test/resources/sia/unittest_v0_7.rb +0 -24
  216. data/test/resources/sia/unittest_v1_0.rb +0 -29
  217. data/test/resources/stsci.xml +0 -336
  218. data/test/resources/unittest_stsci.rb +0 -25
  219. data/test/resources/vodataservice/catalog_service_resource_v1_0.xml +0 -128
  220. data/test/resources/vodataservice/data_collection_resource_v0_5.xml +0 -54
  221. data/test/resources/vodataservice/data_collection_resource_v1_0.xml +0 -117
  222. data/test/resources/vodataservice/data_service_resource_v1_0.xml +0 -115
  223. data/test/resources/vodataservice/sky_service_resource_v0_10.xml +0 -45
  224. data/test/resources/vodataservice/table_service_resource_v1_0.xml +0 -122
  225. data/test/resources/vodataservice/tabular_sky_service_resource_v0_10.xml +0 -60
  226. data/test/resources/vodataservice/unittest_v0_5.rb +0 -126
  227. data/test/resources/vodataservice/unittest_v1_0.rb +0 -151
  228. data/test/resources/voregistry/authority_resource_v0_3.xml +0 -20
  229. data/test/resources/voregistry/authority_resource_v1_0.xml +0 -82
  230. data/test/resources/voregistry/registry_service_v0_3.xml +0 -20
  231. data/test/resources/voregistry/registry_service_v1_0.xml +0 -107
  232. data/test/resources/voregistry/unittest_v0_3.rb +0 -31
  233. data/test/resources/voregistry/unittest_v1_0.rb +0 -34
  234. data/test/resources/voresource/organisation_resource_v1_0.xml +0 -90
  235. data/test/resources/voresource/resource_organisation_v0_10.xml +0 -22
  236. data/test/resources/voresource/resource_service_v0_10.xml +0 -19
  237. data/test/resources/voresource/resource_v0_10.xml +0 -19
  238. data/test/resources/voresource/resource_v1_0.xml +0 -79
  239. data/test/resources/voresource/service_resource_v1_0.xml +0 -91
  240. data/test/resources/voresource/unittest_v0_10.rb +0 -61
  241. data/test/resources/voresource/unittest_v0_9.rb +0 -4
  242. data/test/resources/voresource/unittest_v1_0.rb +0 -190
  243. data/test/services/gestalt/unittest.rb +0 -74
  244. data/test/services/registry/unittest.rb +0 -34
  245. data/test/services/resolver/unittest.rb +0 -38
  246. data/test/simple/unittest.rb +0 -46
  247. data/test/spacetime/unittest.rb +0 -39
  248. data/test/stc/catalog_entry_location_v1_20.xml +0 -112
  249. data/test/stc/obs_data_location_v1_20.xml +0 -108
  250. data/test/stc/search_location_v1_20.xml +0 -54
  251. data/test/stc/stc_resource_profile_v1_20.xml +0 -60
  252. data/test/stc/unittest_v1_20.rb +0 -620
  253. data/test/voevent/unittest_v1_0.rb +0 -79
  254. data/test/voevent/unittest_v1_1.rb +0 -70
  255. data/test/voevent/voevent_v1_0.xml +0 -96
  256. data/test/votables/test.vot +0 -366
  257. data/test/votables/unittest.rb +0 -54
@@ -0,0 +1,38 @@
1
+ <VOTABLE version="1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2
+ xsi:noNamespaceSchemaLocation="http://www.ivoa.net/xml/VOTable/VOTable/v1.1">
3
+ <COOSYS ID="J2000" equinox="J2000." epoch="J2000." system="eq_FK5"/>
4
+ <RESOURCE name="myFavouriteGalaxies">
5
+ <TABLE name="results">
6
+ <DESCRIPTION>Velocities and Distance estimations</DESCRIPTION>
7
+ <PARAM name="Telescope" datatype="float" ucd="phys.size;instr.tel"
8
+ unit="m" value="3.6"/>
9
+ <FIELD name="RA" ID="col1" ucd="pos.eq.ra;meta.main" ref="J2000"
10
+ datatype="float" width="6" precision="2" unit="deg"/>
11
+ <FIELD name="Dec" ID="col2" ucd="pos.eq.dec;meta.main" ref="J2000"
12
+ datatype="float" width="6" precision="2" unit="deg"/>
13
+ <FIELD name="Name" ID="col3" ucd="meta.id;meta.main"
14
+ datatype="char" arraysize="8*"/>
15
+ <FIELD name="RVel" ID="col4" ucd="src.veloc.hc" datatype="int"
16
+ width="5" unit="km/s"/>
17
+ <FIELD name="e_RVel" ID="col5" ucd="stat.error;src.veloc.hc"
18
+ datatype="int" width="3" unit="km/s"/>
19
+ <FIELD name="R" ID="col6" ucd="phys.distance" datatype="float"
20
+ width="4" precision="1" unit="Mpc">
21
+ <DESCRIPTION>Distance of Galaxy, assuming H=75km/s/Mpc</DESCRIPTION>
22
+ </FIELD>
23
+ <DATA>
24
+ <TABLEDATA>
25
+ <TR>
26
+ <TD>010.68</TD><TD>+41.27</TD><TD>N 224</TD><TD>-297</TD><TD>5</TD><TD>0.7</TD>
27
+ </TR>
28
+ <TR>
29
+ <TD>287.43</TD><TD>-63.85</TD><TD>N 6744</TD><TD>839</TD><TD>6</TD><TD>10.4</TD>
30
+ </TR>
31
+ <TR>
32
+ <TD>023.48</TD><TD>+30.66</TD><TD>N 598</TD><TD>-182</TD><TD>3</TD><TD>0.7</TD>
33
+ </TR>
34
+ </TABLEDATA>
35
+ </DATA>
36
+ </TABLE>
37
+ </RESOURCE>
38
+ </VOTABLE>
@@ -0,0 +1,86 @@
1
+ <div class="votable">
2
+ <div class="resource">
3
+ <h3>myFavouriteGalaxies</h3>
4
+ <table>
5
+ <caption>Velocities and Distance estimations</caption>
6
+ <thead>
7
+ <tr>
8
+ <th>
9
+ <div class="field" id="col1">
10
+ <div class="name">RA</div>
11
+ <div class="ucd">pos.eq.ra;meta.main</div>
12
+ <div class="unit">deg</div>
13
+ <span class="datatype">float</span>
14
+ </div>
15
+ </th>
16
+ <th>
17
+ <div class="field" id="col2">
18
+ <div class="name">Dec</div>
19
+ <div class="ucd">pos.eq.dec;meta.main</div>
20
+ <div class="unit">deg</div>
21
+ <span class="datatype">float</span>
22
+ </div>
23
+ </th>
24
+ <th>
25
+ <div class="field" id="col3">
26
+ <div class="name">Name</div>
27
+ <div class="ucd">meta.id;meta.main</div>
28
+ <span class="datatype">char</span>
29
+ <span class="arraysize">8*</span>
30
+ </div>
31
+ </th>
32
+ <th>
33
+ <div class="field" id="col4">
34
+ <div class="name">RVel</div>
35
+ <div class="ucd">src.veloc.hc</div>
36
+ <div class="unit">km/s</div>
37
+ <span class="datatype">int</span>
38
+ </div>
39
+ </th>
40
+ <th>
41
+ <div class="field" id="col5">
42
+ <div class="name">e_RVel</div>
43
+ <div class="ucd">stat.error;src.veloc.hc</div>
44
+ <div class="unit">km/s</div>
45
+ <span class="datatype">int</span>
46
+ </div>
47
+ </th>
48
+ <th>
49
+ <div class="field" id="col6">
50
+ <div class="name">R</div>
51
+ <div class="ucd">phys.distance</div>
52
+ <div class="unit">Mpc</div>
53
+ <span class="datatype">float</span>
54
+ </div>
55
+ </th>
56
+ </tr>
57
+ </thead>
58
+ <tbody>
59
+ <tr>
60
+ <td>010.68</td>
61
+ <td>+41.27</td>
62
+ <td>N 224</td>
63
+ <td>-297</td>
64
+ <td>5</td>
65
+ <td>0.7</td>
66
+ </tr>
67
+ <tr>
68
+ <td>287.43</td>
69
+ <td>-63.85</td>
70
+ <td>N 6744</td>
71
+ <td>839</td>
72
+ <td>6</td>
73
+ <td>10.4</td>
74
+ </tr>
75
+ <tr>
76
+ <td>023.48</td>
77
+ <td>+30.66</td>
78
+ <td>N 598</td>
79
+ <td>-182</td>
80
+ <td>3</td>
81
+ <td>0.7</td>
82
+ </tr>
83
+ </tbody>
84
+ </table>
85
+ </div>
86
+ </div>
@@ -0,0 +1,56 @@
1
+ <ns1:VOTABLE xmlns:ns1="SkyPortal.ivoa.net">
2
+ <ns2:RESOURCE xmlns:ns2="http://vizier.u-strasbg.fr/xml/VOTable-1.1.xsd">
3
+ <ns2:TABLE name="Table 1">
4
+ <ns2:FIELD datatype="double" name="NUMBER" width="10"/>
5
+ <ns2:FIELD datatype="double" name="MAG_ISO" width="10"/>
6
+ <ns2:FIELD datatype="double" name="MAGERR_ISO" width="10"/>
7
+ <ns2:FIELD datatype="double" name="MAG_ISOCOR" width="10"/>
8
+ <ns2:FIELD datatype="double" name="MAGERR_ISOCOR" width="10"/>
9
+ <ns2:FIELD datatype="double" name="MAG_APER" width="10"/>
10
+ <ns2:FIELD datatype="double" name="MAGERR_APER" width="10"/>
11
+ <ns2:FIELD datatype="double" name="MAG_AUTO" width="10"/>
12
+ <ns2:FIELD datatype="double" name="MAGERR_AUTO" width="10"/>
13
+ <ns2:FIELD datatype="double" name="MAG_BEST" width="10"/>
14
+ <ns2:FIELD datatype="double" name="MAGERR_BEST" width="10"/>
15
+ <ns2:FIELD datatype="double" name="ra" width="10"/>
16
+ <ns2:FIELD datatype="double" name="dec" width="10"/>
17
+ <ns2:FIELD datatype="double" name="FLAGS" width="10"/>
18
+ <ns2:DATA>
19
+ <ns2:TABLEDATA>
20
+ <ns2:TR>
21
+ <ns2:TD>1</ns2:TD>
22
+ <ns2:TD>-14.0836</ns2:TD>
23
+ <ns2:TD>0.0008</ns2:TD>
24
+ <ns2:TD>-14.0986</ns2:TD>
25
+ <ns2:TD>0.0008</ns2:TD>
26
+ <ns2:TD>-12.6699</ns2:TD>
27
+ <ns2:TD>0.0002</ns2:TD>
28
+ <ns2:TD>-14.1114</ns2:TD>
29
+ <ns2:TD>0.0007</ns2:TD>
30
+ <ns2:TD>-14.1114</ns2:TD>
31
+ <ns2:TD>0.0007</ns2:TD>
32
+ <ns2:TD>2.9325730</ns2:TD>
33
+ <ns2:TD>+1.0539001</ns2:TD>
34
+ <ns2:TD>2</ns2:TD>
35
+ </ns2:TR>
36
+ <ns2:TR>
37
+ <ns2:TD>2</ns2:TD>
38
+ <ns2:TD>-6.0965</ns2:TD>
39
+ <ns2:TD>0.1047</ns2:TD>
40
+ <ns2:TD>-6.8029</ns2:TD>
41
+ <ns2:TD>0.1221</ns2:TD>
42
+ <ns2:TD>-5.5913</ns2:TD>
43
+ <ns2:TD>0.1576</ns2:TD>
44
+ <ns2:TD>-7.6463</ns2:TD>
45
+ <ns2:TD>0.0858</ns2:TD>
46
+ <ns2:TD>-7.6463</ns2:TD>
47
+ <ns2:TD>0.0858</ns2:TD>
48
+ <ns2:TD>2.9335704</ns2:TD>
49
+ <ns2:TD>+1.0456679</ns2:TD>
50
+ <ns2:TD>0</ns2:TD>
51
+ </ns2:TR>
52
+ </ns2:TABLEDATA>
53
+ </ns2:DATA>
54
+ </ns2:TABLE>
55
+ </ns2:RESOURCE>
56
+ </ns1:VOTABLE>
@@ -0,0 +1,15 @@
1
+ require 'test/unit'
2
+ require 'voruby/votable/votable'
3
+
4
+ module VORuby
5
+ module VOTable
6
+
7
+ class VOTableTest < ::Test::Unit::TestCase
8
+ def test_version_detection
9
+ assert_kind_of VOTable::V1_1::VOTable, VOTable.from_xml(File.new('test/voruby/votable/1.1/votable.basic.xml'))
10
+ assert_kind_of VOTable::V1_0::VOTable, VOTable.from_xml(File.new('test/voruby/votable/1.0/votable.basic.xml'))
11
+ end
12
+ end
13
+
14
+ end
15
+ end
@@ -0,0 +1,268 @@
1
+ require 'test/unit'
2
+
3
+ require 'voruby/wesix/wesix'
4
+ include VORuby::Wesix
5
+
6
+ class WesixTest < Test::Unit::TestCase
7
+ def test_params
8
+ params = Params.new
9
+ Params.soap_registration[:schema_element].collect{ |defn| defn.first }.each do |method_name|
10
+ assert_respond_to params, method_name
11
+ assert_respond_to params, "#{method_name}="
12
+ end
13
+ end
14
+
15
+ def test_output_params
16
+ params = OutputParams.new
17
+ OutputParams.soap_registration[:schema_element].collect{ |defn| defn.first }.each do |method_name|
18
+ assert_respond_to params, method_name
19
+ assert_respond_to params, "#{method_name}="
20
+ end
21
+ end
22
+
23
+ def test_extraction
24
+ @wesix = Service.new
25
+ @fits = 'http://nvogre.phyast.pitt.edu:8080/wesix/testr.fits'
26
+ @fits_file = File.new('test/voruby/wesix/testr.fits', 'r')
27
+
28
+ # FITS file is at a URL...
29
+ votable = @wesix.extract(
30
+ URI.parse(@fits),
31
+ false,
32
+ Params.new(:detect_thresh => 2.0, :analysis_thresh => 2.0),
33
+ OutputParams.new(:flux_best => true, :fluxerr_best => true)
34
+ )
35
+ assert_equal 1, votable.resources.size
36
+ assert_equal 1, votable.resources.first.tables.size
37
+ table = votable.resources.first.tables.first
38
+ assert_equal 'Table 1', table.name
39
+ assert_equal 16, table.fields.size # we've requested two new columns...
40
+ assert table.data.format.trs.size > 0
41
+
42
+ # FITS file is on disk...
43
+ votable = @wesix.extract(@fits_file)
44
+ assert_equal 1, votable.resources.size
45
+ assert_equal 1, votable.resources.first.tables.size
46
+ table = votable.resources.first.tables.first
47
+ assert_equal 'Table 1', table.name
48
+ assert_equal 14, table.fields.size # we've requested two new columns...
49
+ assert table.data.format.trs.size > 0
50
+
51
+ @fits_file.close
52
+ end
53
+
54
+ def test_xmatch
55
+ @wesix = Service.new
56
+ @fits = 'http://nvogre.phyast.pitt.edu:8080/wesix/testr.fits'
57
+ @fits_file = File.new('test/voruby/wesix/testr.fits', 'r')
58
+
59
+ # FITS file is at a URL...
60
+ votable = @wesix.extract_and_xmatch(
61
+ URI.parse(@fits),
62
+ false,
63
+ Params.new(:detect_thresh => 2.0, :analysis_thresh => 2.0),
64
+ OutputParams.new(:flux_best => true, :fluxerr_best => true)
65
+ )
66
+ assert_equal 1, votable.resources.size
67
+ assert_equal 1, votable.resources.first.tables.size
68
+ table3 = votable.resources.first.tables.first
69
+ assert_equal 26, table3.fields.size # we've requested two new columns...
70
+ assert table3.data.format.trs.size > 0
71
+
72
+ # FITS file is on disk...
73
+ votable = @wesix.extract_and_xmatch(
74
+ @fits_file,
75
+ false,
76
+ Params.new(:detect_thresh => 2.0, :analysis_thresh => 2.0)
77
+ )
78
+ assert_equal 1, votable.resources.size
79
+ assert_equal 1, votable.resources.first.tables.size
80
+ table = votable.resources.first.tables.first
81
+ assert_equal 24, table.fields.size # we've requested two new columns...
82
+ assert table.data.format.trs.size > 0
83
+
84
+ @fits_file.close
85
+ end
86
+
87
+ def test_url_xmatch
88
+ @wesix = Service.new
89
+ @fits = 'http://nvogre.phyast.pitt.edu:8080/wesix/testr.fits'
90
+
91
+ # basic extraction and crossmatch
92
+ votable = @wesix.extract_and_xmatch_from_url(@fits)
93
+ assert_equal 1, votable.resources.size
94
+ assert_equal 1, votable.resources.first.tables.size
95
+ table1 = votable.resources.first.tables.first
96
+ assert_equal 24, table1.fields.size
97
+ assert table1.data.format.trs.size > 0
98
+
99
+ # extraction with modified input parameters
100
+ votable = @wesix.extract_and_xmatch_from_url(
101
+ @fits,
102
+ false,
103
+ Params.new(:detect_thresh => 2.0, :analysis_thresh => 2.0)
104
+ )
105
+ assert_equal 1, votable.resources.size
106
+ assert_equal 1, votable.resources.first.tables.size
107
+ table2 = votable.resources.first.tables.first
108
+ assert_equal 24, table2.fields.size
109
+ assert table2.data.format.trs.size > 0
110
+
111
+ # The second query is more restrictive.
112
+ assert table1.data.format.trs.size > table2.data.format.trs.size
113
+
114
+ # extraction with modified input and output parameters
115
+ votable = @wesix.extract_and_xmatch_from_url(
116
+ @fits,
117
+ false,
118
+ Params.new(:detect_thresh => 2.0, :analysis_thresh => 2.0),
119
+ OutputParams.new(:flux_best => true, :fluxerr_best => true)
120
+ )
121
+ assert_equal 1, votable.resources.size
122
+ assert_equal 1, votable.resources.first.tables.size
123
+ table3 = votable.resources.first.tables.first
124
+ assert_equal 26, table3.fields.size # we've requested two new columns...
125
+ assert table3.data.format.trs.size > 0
126
+ end
127
+
128
+ def test_file_xmatch
129
+ @wesix = Service.new
130
+ @fits_file = File.new('test/voruby/wesix/testr.fits', 'r')
131
+
132
+ # basic extraction and crossmatch
133
+ votable = @wesix.extract_and_xmatch_from_file(@fits_file)
134
+ assert_equal 1, votable.resources.size
135
+ assert_equal 1, votable.resources.first.tables.size
136
+ table1 = votable.resources.first.tables.first
137
+ assert_equal 24, table1.fields.size
138
+ assert table1.data.format.trs.size > 0
139
+
140
+ @fits_file.rewind
141
+
142
+ # extraction with modified input parameters
143
+ votable = @wesix.extract_and_xmatch_from_file(
144
+ @fits_file,
145
+ false,
146
+ Params.new(:detect_thresh => 2.0, :analysis_thresh => 2.0)
147
+ )
148
+ assert_equal 1, votable.resources.size
149
+ assert_equal 1, votable.resources.first.tables.size
150
+ table2 = votable.resources.first.tables.first
151
+ assert_equal 24, table2.fields.size
152
+ assert table2.data.format.trs.size > 0
153
+
154
+ # The second query is more restrictive.
155
+ assert table1.data.format.trs.size > table2.data.format.trs.size
156
+
157
+ @fits_file.rewind
158
+
159
+ # extraction with modified input and output parameters
160
+ votable = @wesix.extract_and_xmatch_from_file(
161
+ @fits_file,
162
+ false,
163
+ Params.new(:detect_thresh => 2.0, :analysis_thresh => 2.0),
164
+ OutputParams.new(:flux_best => true, :fluxerr_best => true)
165
+ )
166
+ assert_equal 1, votable.resources.size
167
+ assert_equal 1, votable.resources.first.tables.size
168
+ table3 = votable.resources.first.tables.first
169
+ assert_equal 26, table3.fields.size # we've requested two new columns...
170
+ assert table3.data.format.trs.size > 0
171
+
172
+ @fits_file.close
173
+ end
174
+
175
+ def test_file_extraction
176
+ @wesix = Service.new
177
+ @fits_file = File.new('test/voruby/wesix/testr.fits', 'r')
178
+
179
+ # basic extraction and crossmatch
180
+ votable = @wesix.extract_from_file(@fits_file)
181
+ assert_equal 1, votable.resources.size
182
+ assert_equal 1, votable.resources.first.tables.size
183
+ table1 = votable.resources.first.tables.first
184
+ assert_equal 'Table 1', table1.name
185
+ assert_equal 14, table1.fields.size
186
+ assert table1.data.format.trs.size > 0
187
+
188
+ @fits_file.rewind
189
+
190
+ # extraction with modified input parameters
191
+ votable = @wesix.extract_from_file(
192
+ @fits_file,
193
+ false,
194
+ Params.new(:detect_thresh => 3.0, :analysis_thresh => 3.0)
195
+ )
196
+ assert_equal 1, votable.resources.size
197
+ assert_equal 1, votable.resources.first.tables.size
198
+ table2 = votable.resources.first.tables.first
199
+ assert_equal 'Table 1', table2.name
200
+ assert_equal 14, table2.fields.size
201
+ assert table2.data.format.trs.size > 0
202
+
203
+ # The second query is more restrictive.
204
+ assert table1.data.format.trs.size > table2.data.format.trs.size
205
+
206
+ @fits_file.rewind
207
+
208
+ # extraction with modified input and output parameters
209
+ votable = @wesix.extract_from_file(
210
+ @fits_file,
211
+ false,
212
+ Params.new(:detect_thresh => 2.0, :analysis_thresh => 2.0),
213
+ OutputParams.new(:flux_best => true, :fluxerr_best => true)
214
+ )
215
+ assert_equal 1, votable.resources.size
216
+ assert_equal 1, votable.resources.first.tables.size
217
+ table3 = votable.resources.first.tables.first
218
+ assert_equal 'Table 1', table3.name
219
+ assert_equal 16, table3.fields.size # we've requested two new columns...
220
+ assert table3.data.format.trs.size > 0
221
+
222
+ @fits_file.close
223
+ end
224
+
225
+ def test_url_extraction
226
+ @wesix = Service.new
227
+ @fits = 'http://nvogre.phyast.pitt.edu:8080/wesix/testr.fits'
228
+
229
+ # basic extraction
230
+ votable = @wesix.extract_from_url(@fits)
231
+ assert_equal 1, votable.resources.size
232
+ assert_equal 1, votable.resources.first.tables.size
233
+ table1 = votable.resources.first.tables.first
234
+ assert_equal 'Table 1', table1.name
235
+ assert_equal 14, table1.fields.size
236
+ assert table1.data.format.trs.size > 0
237
+
238
+ # extraction with modified input parameters
239
+ votable = @wesix.extract_from_url(
240
+ @fits,
241
+ false,
242
+ Params.new(:detect_thresh => 3.0, :analysis_thresh => 3.0)
243
+ )
244
+ assert_equal 1, votable.resources.size
245
+ assert_equal 1, votable.resources.first.tables.size
246
+ table2 = votable.resources.first.tables.first
247
+ assert_equal 'Table 1', table2.name
248
+ assert_equal 14, table2.fields.size
249
+ assert table2.data.format.trs.size > 0
250
+
251
+ # The second query is more restrictive.
252
+ assert table1.data.format.trs.size > table2.data.format.trs.size
253
+
254
+ # extraction with modified input and output parameters
255
+ votable = @wesix.extract_from_url(
256
+ @fits,
257
+ false,
258
+ Params.new(:detect_thresh => 2.0, :analysis_thresh => 2.0),
259
+ OutputParams.new(:flux_best => true, :fluxerr_best => true)
260
+ )
261
+ assert_equal 1, votable.resources.size
262
+ assert_equal 1, votable.resources.first.tables.size
263
+ table3 = votable.resources.first.tables.first
264
+ assert_equal 'Table 1', table3.name
265
+ assert_equal 16, table3.fields.size # we've requested two new columns...
266
+ assert table3.data.format.trs.size > 0
267
+ end
268
+ end