Examples of FitsException


Examples of edu.harvard.hul.ois.fits.exceptions.FitsException

      File inputFile = new File(input);
     
      if(inputFile.isDirectory()) {
        String outputDir = cmd.getOptionValue("o");
        if(outputDir == null || !(new File(outputDir).isDirectory())) {
          throw new FitsException("When FITS is run in directory processing mode the output location must be a diretory");
        }
        fits.doDirectory(inputFile,new File(outputDir),cmd.hasOption("x"),cmd.hasOption("xc"));
      }
      else {
        FitsOutput result = fits.doSingleFile(inputFile);
View Full Code Here

Examples of edu.harvard.hul.ois.fits.exceptions.FitsException

      }
      else if(!dirMode) {   
        out = System.out;
      }
      else {
        throw new FitsException("The output location must be provided when running FITS in directory mode");
      }
     
      //if -x is set, then convert to standard metadata schema and output to -o
      if(standardSchema) {
        outputStandardSchemaXml(result,out);
View Full Code Here

Examples of edu.harvard.hul.ois.fits.exceptions.FitsException

          stdElement.addContent(stdXmlDoc.getRootElement().detach());
          techmd.addContent(stdElement);
         
        }
        catch(JDOMException e) {
          throw new FitsException("error converting standard XML", e);
        }
      }
    }
    }
View Full Code Here

Examples of net.ivoa.fits.FitsException

   *                if an invalid index was requested.
   */
  public String getColumnFormat(int index) throws FitsException {
    int flds = myHeader.getIntValue("TFIELDS", 0);
    if (index < 0 || index >= flds) {
      throw new FitsException("Bad column index " + index + " (only "
          + flds + " columns)");
    }

    return myHeader.getStringValue("TFORM" + (index + 1)).trim();
  }
View Full Code Here

Examples of net.ivoa.fits.FitsException

   *            The random groups data the header should describe.
   */
  public static Header manufactureHeader(Data d) throws FitsException {

    if (d == null) {
      throw new FitsException("Attempt to create null Random Groups data");
    }
    Header h = new Header();
    d.fillHeader(h);
    return h;

View Full Code Here

Examples of net.ivoa.fits.FitsException

    int pcount = hdr.getIntValue("PCOUNT", -1);

    if (!hdr.getBooleanValue("GROUPS")
        || hdr.getIntValue("NAXIS1", -1) != 0 || gcount < 0
        || pcount < 0 || hdr.getIntValue("NAXIS") < 2) {
      throw new FitsException("Invalid Random Groups Parameters");
    }

    // Allocate the object.
    Object[][] dataArray;
View Full Code Here

Examples of net.ivoa.fits.FitsException

      break;
    case -64:
      baseClass = Double.TYPE;
      break;
    default:
      throw new FitsException("Invalid BITPIX:" + bitpix);
    }

    // Note that we have to invert the order of the axes
    // for the FITS file to get the order in the array we
    // are generating. Also recall that NAXIS1=0, so that
    // we have an 'extra' dimension.

    for (int i = 0; i < ndim; i += 1) {
      long cdim = h.getIntValue("NAXIS" + (i + 2), 0);
      if (cdim < 0) {
        throw new FitsException("Invalid array dimension:" + cdim);
      }
      dims[ndim - i - 1] = (int) cdim;
    }

    Object[] sample = new Object[2];
View Full Code Here

Examples of net.ivoa.fits.FitsException

  public static Data encapsulate(Object o) throws FitsException {
    if (o instanceof Object[][]) {
      return new RandomGroupsData((Object[][]) o);
    } else {
      throw new FitsException(
          "Attempt to encapsulate invalid data in Random Group");
    }
  }
View Full Code Here

Examples of net.ivoa.fits.FitsException

          retHeader.addValue(CRPIX + (i + 1), crpix - offset[i],
              "WCS reference point coordinate");
        }
      }
    } catch (IOException ioex) {
      throw new FitsException(ioex.toString());
    }
    return ret;
  }
View Full Code Here

Examples of net.ivoa.fits.FitsException

    } else if (o instanceof Object[][]) {
      return new BinaryTable((Object[][]) o);
    } else if (o instanceof Object[]) {
      return new BinaryTable((Object[]) o);
    } else {
      throw new FitsException("Unable to encapsulate object of type:"
          + o.getClass().getName() + " as BinaryTable");
    }
  }
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.