Package cds.moc
Class MocIO
- java.lang.Object
-
- cds.moc.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);
-
-
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 streamvoid
write(java.io.OutputStream out)
Write HEALPix MOC to an output streamvoid
write(java.io.OutputStream out, int mode)
Write HEALPix MOC to an output stream At the end, the stream is not closedvoid
write(java.lang.String filename)
Write HEALPix MOC to a filevoid
write(java.lang.String filename, int mode)
Write HEALPix MOC to a filevoid
writeASCII(java.io.OutputStream out)
Write HEALPix MOC to an output stream IN ASCII encoded formatvoid
writeFits(java.io.OutputStream out)
Write HEALPix MOC to an output stream in FITS encoded formatvoid
writeJSON(java.io.OutputStream out)
Write HEALPix MOC to an output stream IN JSON encoded format
-
-
-
Field Detail
-
FITS
public static final int FITS
- See Also:
- Constant Field Values
-
JSON
public static final int JSON
- See Also:
- Constant Field Values
-
ASCII
public static final int ASCII
- See Also:
- Constant Field Values
-
JSON0
public static final int JSON0
- See Also:
- Constant Field Values
-
OLDSIGNATURE
public static final java.lang.String OLDSIGNATURE
- See Also:
- Constant Field Values
-
SIGNATURE
public static final java.lang.String SIGNATURE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MocIO
public MocIO(HealpixMoc m)
-
-
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 namemode
- 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 streammode
- 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 filemode
- 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 streammode
- 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
-
-