예제 #1
0
 /**
  * Read timeRanges form VOTABLE and set the startTime and endTime properties
  *
  * @param voTable
  */
 protected void setTimeRangesFromVoTable(VOTABLE voTable) {
   // iterate over VOTABLE to get timeRanges
   if (voTable != null) {
     List<RESOURCE> resources = voTable.getRESOURCE();
     for (RESOURCE r : resources) {
       List<TABLE> tables = r.getTABLE();
       for (TABLE t : tables) {
         DATA data = t.getDATA();
         List<TR> trs = data.getTABLEDATA().getTR();
         for (TR tr : trs) {
           List<TD> td = tr.getTD();
           if (td.size() >= 3) {
             startTime.add(td.get(1).getValue()); // td = column startTime
             endTime.add(td.get(3).getValue()); // td = column endTime
           }
         }
       }
     }
   }
 }
예제 #2
0
  /**
   * Read instruments form VOTABLE
   *
   * @param voTable
   * @return list with instrument field value of column "obsinst_key"
   */
  protected List<String> getIcsInstruments(VOTABLE voTable) {
    List<String> instruments = new ArrayList<String>();

    // iterate over VOTABLE to get timeRanges
    if (voTable != null) {
      List<RESOURCE> resources = voTable.getRESOURCE();
      if (resources.size() > 0) {
        for (RESOURCE r : resources) {
          List<TABLE> tables = r.getTABLE();
          for (TABLE t : tables) {
            DATA data = t.getDATA();
            List<TR> trs = data.getTABLEDATA().getTR();
            for (TR tr : trs) {
              List<TD> td = tr.getTD();
              instruments.add(td.get(2).getValue()); // obsinst_key
            }
          }
        }
      }
    }

    return instruments;
  }