From ba3a7e4306147d089b17379f8dab957552bdcaa9 Mon Sep 17 00:00:00 2001
From: Robert Butora <robert.butora@gmail.com>
Date: Sat, 23 Mar 2024 12:45:44 -0400
Subject: [PATCH] votable: adds count of subsurveys with datacube(s) found

---
 .../main/java/vlkb/output/XmlSerializer.java  | 29 +++++++++++--------
 1 file changed, 17 insertions(+), 12 deletions(-)

diff --git a/data-discovery/src/main/java/vlkb/output/XmlSerializer.java b/data-discovery/src/main/java/vlkb/output/XmlSerializer.java
index 66d33d8..496dc1a 100644
--- a/data-discovery/src/main/java/vlkb/output/XmlSerializer.java
+++ b/data-discovery/src/main/java/vlkb/output/XmlSerializer.java
@@ -18,13 +18,17 @@ public final class XmlSerializer
 
    private XmlSerializer() {} // disables instatiation
 
+
+   // VOTable
+
    public static void serializeToVoTable(PrintWriter writer, String charEncoding, SearchOutputData searchOutputData,
          boolean showDuration, long startTime_msec) throws IOException
    {
-      // writer.println("<DatacubeCount> " + searchOutputData.datacubeCount + " </DatacubeCount>");
-
       StarTable dstable = makeSearchResultsTable( searchOutputData.subsurveyArr );
-      dstable.setParameter(new DescribedValue(new DefaultValueInfo( "datacubeCount", Integer.class, "Count of datacubes from VLKB-search" ), searchOutputData.datacubeCount ) );
+
+      dstable.setParameter(new DescribedValue(new DefaultValueInfo( "subsurveyCount", Integer.class, "Count of subsurveys with found datacube(s)" ), searchOutputData.subsurveyArr.length ) );
+      dstable.setParameter(new DescribedValue(new DefaultValueInfo( "datacubeCount",  Integer.class, "Count of all datacubes from VLKB-search" ), searchOutputData.datacubeCount ) );
+
       StarTable[] tables = {dstable};
 
       BufferedWriter out = new BufferedWriter( writer );
@@ -70,15 +74,16 @@ public final class XmlSerializer
             astro.addRow( new Object[] 
                   {
                      new Integer( dataset.overlapCode ),
-                         new Integer( dataset.overlapCodeSky ),
-                         new Integer( dataset.overlapCodeVel ),
-                         dataset.dataType, 
-                         dataset.publisherDid,
-
-                         new Double(dataset.vertices_deg.lon[0]), new Double(dataset.vertices_deg.lat[0]),
-                         new Double(dataset.vertices_deg.lon[1]), new Double(dataset.vertices_deg.lat[1]),
-                         new Double(dataset.vertices_deg.lon[2]), new Double(dataset.vertices_deg.lat[2]),
-                         new Double(dataset.vertices_deg.lon[3]), new Double(dataset.vertices_deg.lat[3]),
+                     new Integer( dataset.overlapCodeSky ),
+                     new Integer( dataset.overlapCodeVel ),
+
+                     dataset.dataType, 
+                     dataset.publisherDid,
+
+                     new Double(dataset.vertices_deg.lon[0]), new Double(dataset.vertices_deg.lat[0]),
+                     new Double(dataset.vertices_deg.lon[1]), new Double(dataset.vertices_deg.lat[1]),
+                     new Double(dataset.vertices_deg.lon[2]), new Double(dataset.vertices_deg.lat[2]),
+                     new Double(dataset.vertices_deg.lon[3]), new Double(dataset.vertices_deg.lat[3]),
                   });
          }
       }
-- 
GitLab