Package cds.moc

Class MocIO

java.lang.Object
cds.moc.MocIO

public final class MocIO extends Object
HEALPix Multi Order Coverage Map (MOC) IO routines Compliante with IVOA MOC Rec 1.0 June 2014 Example : HealpixMoc moc = new HealpixMoc(); (new IO(moc).read(String filename);
  • Field Details

  • Constructor Details

  • Method Details

    • read

      public void read(String filename) throws Exception
      Read HEALPix MOC from a file. Support standard FITS format and ASCII non standard alternatives (JSON, ASCII)
      Parameters:
      filename - file name
      Throws:
      Exception
    • read

      public void read(String filename, int mode) throws Exception
      Deprecated.
      see read(String)
      Read HEALPix MOC from a file.
      Parameters:
      filename - file name
      mode - MOC format: FITS, JSON, ASCII
      Throws:
      Exception
    • read

      public void read(InputStream in) throws Exception
      Read HEALPix MOC from a stream. Support standard FITS format and ASCII non standard alternatives (JSON, ASCII)
      Parameters:
      in - input stream
      Throws:
      Exception
    • read

      public void read(InputStream in, int mode) throws Exception
      Deprecated.
      see read(InputStream)
      Read HEALPix MOC from a stream.
      Parameters:
      in - input stream
      mode - MOC format: FITS, JSON, ASCII
      Throws:
      Exception
    • readASCII

      public void readASCII(InputStream in) throws Exception
      Read MOC from an ASCII stream Support simultaneously various ASCII formats (OBSOLETE, ASCII invalid input: '&' JSON) ASCII (with a first comment for providing the MOCORDER) #MOCORDER MAX ORDER1/nn1,nn2-nnX ORDER2/... ASCII (with an explicit MAXORDER possibly empty list) ORDER1/nn1,nn2-nnX ORDER2/... MAXORDER/ JSON (with an explicit MAXORDER possibly empty list) {"ORDER1":[nn1,nn2,...], "ORDER2":[nn...] ... "MAXORDER":[] } OBSOLETE JSON (with a first comment for providing the MOCORDER => Not well formed JSON) #MOCORDER MAX {"ORDER1":[nn1,nn2,...], "ORDER2":[nn ... } OBSOLETE ASCII #MOCORDER MAX ORDER|NSIDE=xxx1 nn1 nn2-nn3 nn4 ... NSIDE|ORDER=xxx2 ...
      Parameters:
      in - input stream
      Throws:
      Exception
    • readFits

      public void readFits(InputStream in) throws Exception
      Read HEALPix MOC from an Binary FITS stream
      Throws:
      Exception
    • write

      public void write(String filename) throws Exception
      Write HEALPix MOC to a file
      Parameters:
      filename - name of file
      Throws:
      Exception
    • write

      public void write(String filename, int mode) throws Exception
      Write HEALPix MOC to a file
      Parameters:
      filename - name of file
      mode - encoded format (FITS or JSON)
      Throws:
      Exception
    • write

      public void write(OutputStream out) throws Exception
      Write HEALPix MOC to an output stream
      Parameters:
      out - output stream
      Throws:
      Exception
    • write

      public void write(OutputStream out, int mode) throws Exception
      Write HEALPix MOC to an output stream At the end, the stream is not closed
      Parameters:
      out - output stream
      mode - encoded format (FITS or JSON or ASCII)
      Throws:
      Exception
    • writeASCII

      public void writeASCII(OutputStream out) throws Exception
      Write HEALPix MOC to an output stream IN ASCII encoded format
      Parameters:
      out - output stream
      Throws:
      Exception
    • writeJSON

      public void writeJSON(OutputStream out) throws Exception
      Write HEALPix MOC to an output stream IN JSON encoded format
      Parameters:
      out - output stream
      Throws:
      Exception
    • writeFits

      public void writeFits(OutputStream out) throws Exception
      Write HEALPix MOC to an output stream in FITS encoded format
      Parameters:
      out - output stream
      Throws:
      Exception
    • createUniq

      public void createUniq(int nval, int nbyte, byte[] t) throws Exception
      Throws:
      Exception