Package org.aavso.tools.vstar.exception

Examples of org.aavso.tools.vstar.exception.ObservationReadError


      try {
        Fits fits = new Fits(getInputStreams().get(0));
        BasicHDU[] hdus = fits.read();
        retrieveKeplerObservations(hdus);
      } catch (FitsException e) {
        throw new ObservationReadError(e.getLocalizedMessage());
      }
    }
View Full Code Here


        Fits fits = new Fits(getInputStreams().get(0));
        BasicHDU[] hdus = fits.read();
        double jdRef = retrieveJDReference(hdus);
        retrieveObservations(hdus, jdRef);
      } catch (FitsException e) {
        throw new ObservationReadError(e.getLocalizedMessage());
      }
    }
View Full Code Here

            ob.setObsCode(fields[3]);
            ob.addDetail("SOURCE", "VSOLJ", "Source");

            collectObservation(ob);
          } else {
            throw new ObservationReadError("Invalid magnitude");
          }
        } catch (ObservationValidationError e) {
          throw new ObservationReadError(e.getLocalizedMessage());
        }
      } else {
        throw new ObservationReadError("Invalid observation time");
      }
    }
View Full Code Here

        if ("#TYPE".equals(pair[0])) {
          fileType = pair[1];
          if (!"EXTENDED".equals(fileType)
              && !"VISUAL".equals(fileType)) {
            throw new ObservationReadError("Invalid file type: "
                + fileType);
          }
        } else if ("#OBSCODE".equals(pair[0])) {
          obscode = pair[1].toUpperCase();
        } else if ("#SOFTWARE".equals(pair[0])) {
          software = pair[1];
        } else if ("#DELIM".equals(pair[0])) {
          delimiter = translateDelimiter(pair[1]);
          if (isEmpty(delimiter)) {
            throw new ObservationReadError(
                "No delimiter specified.");
          }
        } else if ("#DATE".equals(pair[0])) {
          dateType = pair[1];
          setHeliocentric("HJD".equals(dateType));
        } else if ("#OBSTYPE".equals(pair[0])) {
          obsType = pair[1];
          if ("EXTENDED".equals(fileType)) {
            if (!"CCD".equals(obsType) && !"PEP".equals(obsType)) {
              throw new ObservationReadError(
                  "Unknown observation type: " + obsType);
            }
          } else if ("VISUAL".equals(fileType)) {
            if (!"VISUAL".equals(obsType) && !"PTG".equals(obsType)) {
              throw new ObservationReadError(
                  "Unknown observation type: " + obsType);
            }
          }
        }
      }
View Full Code Here

        delim = " ";
      } else if (delim != null) {
        try {
          int ordVal = Integer.parseInt(delim);
          if (ordVal < 32 || ordVal > 126) {
            throw new ObservationReadError(
                String
                    .format("Ordinal delimiter value '%d' out of range 32..126"));
          }
          // Escape it in case it's a regex meta-character.
          delim = "\\" + String.valueOf((char) ordVal);
View Full Code Here

          ob.setBand(SeriesType.Visual);

          collectObservation(ob);
        }
      } catch (MalformedURLException e) {
        throw new ObservationReadError(
            "Could not read data for object " + getSourceName());
      } catch (ParserConfigurationException e) {
        throw new ObservationReadError(
            "Error configring parser to read data for object "
                + getSourceName());
      } catch (SAXException e) {
        throw new ObservationReadError(
            "Error while inspecting data for object "
                + getSourceName());
      } catch (IOException e) {
        throw new ObservationReadError(
            "Error while reading data for object "
                + getSourceName());
      }
    }
View Full Code Here

          if (!gleanedFormat) {
            gleanedFormat = determinedFormat(line, COMMA_DELIM);
            if (!gleanedFormat) {
              gleanedFormat = determinedFormat(line, SPACE_DELIM);
              if (!gleanedFormat) {
                throw new ObservationReadError("'"
                    + obsSourceIdentifier
                    + "' is in an unknown format.");
              }
            }
          }
View Full Code Here

        mediator.getProgressNotifier().notifyListeners(
            ProgressInfo.INCREMENT_PROGRESS);
      }
    } catch (Throwable t) {
      throw new ObservationReadError(
          "Error when attempting to read observation source.");
    }
  }
View Full Code Here

TOP

Related Classes of org.aavso.tools.vstar.exception.ObservationReadError

Copyright © 2018 www.massapicom. 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.