Package cds.moc

Class MocIO


  • public final class MocIO
    extends java.lang.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 Summary

      Fields 
      Modifier and Type Field Description
      static int ASCII  
      static int FITS  
      static int JSON  
      static int JSON0  
      static java.lang.String OLDSIGNATURE  
      static java.lang.String SIGNATURE  
    • Constructor Summary

      Constructors 
      Constructor Description
      MocIO​(HealpixMoc m)  
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void createUniq​(int nval, int nbyte, byte[] t)  
      void read​(java.io.InputStream in)
      Read HEALPix MOC from a stream.
      void read​(java.io.InputStream in, int mode)
      Deprecated.
      see read(InputStream)
      void read​(java.lang.String filename)
      Read HEALPix MOC from a file.
      void read​(java.lang.String filename, int mode)
      Deprecated.
      see read(String)
      void readASCII​(java.io.InputStream in)
      Read MOC from an ASCII stream Support simultaneously various ASCII formats (OBSOLETE, ASCII & JSON) ASCII (with a first comment for providing the MOCORDER) #MOCORDER MAX ORDER1/nn1,nn2-nnX ORDER2/...
      void readFits​(java.io.InputStream in)
      Read HEALPix MOC from an Binary FITS stream
      void write​(java.io.OutputStream out)
      Write HEALPix MOC to an output stream
      void write​(java.io.OutputStream out, int mode)
      Write HEALPix MOC to an output stream At the end, the stream is not closed
      void write​(java.lang.String filename)
      Write HEALPix MOC to a file
      void write​(java.lang.String filename, int mode)
      Write HEALPix MOC to a file
      void writeASCII​(java.io.OutputStream out)
      Write HEALPix MOC to an output stream IN ASCII encoded format
      void writeFits​(java.io.OutputStream out)
      Write HEALPix MOC to an output stream in FITS encoded format
      void writeJSON​(java.io.OutputStream out)
      Write HEALPix MOC to an output stream IN JSON encoded format
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • read

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

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

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

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

        public void readASCII​(java.io.InputStream in)
                       throws java.lang.Exception
        Read MOC from an ASCII stream Support simultaneously various ASCII formats (OBSOLETE, ASCII & 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:
        java.lang.Exception
      • readFits

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

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

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

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

        public void write​(java.io.OutputStream out,
                          int mode)
                   throws java.lang.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:
        java.lang.Exception
      • writeASCII

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

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

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

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