Examples of FitsException


Examples of net.ivoa.fits.FitsException

  public void setElement(int i, int j, Object o) throws FitsException {

    try {
             table.setElement(i, j, ArrayFuncs.flatten(o));
    } catch (TableException e) {
      throw new FitsException("Error modifying table:" + e);
    }
  }
View Full Code Here

Examples of net.ivoa.fits.FitsException

    if (i instanceof RandomAccess) {
      try {
        i.skipBytes(getTrueSize());
        i.skipBytes(FitsUtil.padding(getTrueSize()));
      } catch (IOException e) {
        throw new FitsException("Unable to skip binary table HDU:" + e);
      }
    } else {

      /**
       * Read the data associated with the HDU including the hash area if
View Full Code Here

Examples of net.ivoa.fits.FitsException

      i.skipBytes(heapOffset);
      heap.read(i);
      i.skipBytes(FitsUtil.padding(getTrueSize()));

    } catch (IOException e) {
      throw new FitsException("Error reading binary table data:" + e);
    }
  }
View Full Code Here

Examples of net.ivoa.fits.FitsException

      }

      os.write(new byte[FitsUtil.padding(getTrueSize())]);

    } catch (IOException e) {
      throw new FitsException("Unable to write table:" + e);
    }

  }
View Full Code Here

Examples of net.ivoa.fits.FitsException

  public Object getData() throws FitsException {

    if (table == null) {

      if (currInput == null) {
        throw new FitsException("Cannot find input for deferred read");
      }

      table = createTable();

      long currentOffset = FitsUtil.findOffset(currInput);
View Full Code Here

Examples of net.ivoa.fits.FitsException

    for (int i = 0; i < nFields; i += 1) {
      offsets[i] = hdr.getIntValue("TBCOL" + (i + 1)) - 1;
      String s = hdr.getStringValue("TFORM" + (i + 1));
      if (offsets[i] < 0) {
        throw new FitsException("Invalid Specification for column:"
            + (i + 1));
      }
      s = s.trim();
      char c = s.charAt(0);
      s = s.substring(1);
View Full Code Here

Examples of net.ivoa.fits.FitsException

    if (str instanceof RandomAccess) {

      try {
        str.skipBytes(nRows * rowLen);
      } catch (IOException e) {
        throw new FitsException("Error skipping data: " + e);
      }

    } else {
      try {
        getBuffer(rowLen * nRows, 0);
      } catch (IOException e) {
        throw new FitsException("Error reading ASCII table:" + e);
      }
    }

    try {
      str.skipBytes(FitsUtil.padding(nRows * rowLen));
    } catch (IOException e) {
      throw new FitsException("Error skipping padding:" + e);
    }
  }
View Full Code Here

Examples of net.ivoa.fits.FitsException

        long newOffset = FitsUtil.findOffset(currInput);
        try {
          getBuffer(nRows * rowLen, fileOffset);

        } catch (IOException e) {
          throw new FitsException(
              "Error in deferred read -- file closed prematurely?:"
                  + e);
        }
        FitsUtil.reposition(currInput, newOffset);
      }
View Full Code Here

Examples of net.ivoa.fits.FitsException

      } else if (array[col] instanceof double[]) {
        ((double[]) array[col])[row] = bp.getDouble(length);
      } else if (array[col] instanceof long[]) {
        ((long[]) array[col])[row] = bp.getLong(length);
      } else {
        throw new FitsException(
            "Invalid type for ASCII table conversion:" + array[col]);
      }
    } catch (FormatException e) {
      throw new FitsException("Error parsing data at row,col:" + row
          + "," + col + "  " + e);
    }
    return true;
  }
View Full Code Here

Examples of net.ivoa.fits.FitsException

    Object[] res = new Object[nFields];

    try {
      getBuffer(rowLen, fileOffset + row * rowLen);
    } catch (IOException e) {
      throw new FitsException("Unable to read row");
    }

    for (int i = 0; i < nFields; i += 1) {
      res[i] = ArrayFuncs.newInstance(types[i], 1);
      if (!extractElement(offsets[i], lengths[i], res, i, 0, nulls[i])) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.