Exemple #1
0
        /// <summary>
        /// writes the header to fits file
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="filename"></param>
        /// <param name="writeMode"></param>
        /// <param name="stringTruncationLength"></param>
        /// <param name="padStringsLeft"></param>
        /// <param name="stringPadChar"></param>
        public static void Write(IDataReader reader, String filename,
                                 StreamedBinaryTableHDU.StringWriteMode writeMode, int stringTruncationLength,
                                 bool padStringsLeft, char stringPadChar)
        {
            Header header = new Header();

            header.Simple = true;
            header.Bitpix = 8;
            header.Naxes  = 0;

            Cursor c = header.GetCursor();

            // move to the end of the header cards
            for (c.MoveNext(); c.MoveNext();)
            {
                ;
            }
            // we know EXTEND isn't there yet
            c.Add("EXTEND", new HeaderCard("EXTEND", true, null));

            ImageHDU hdu1 = new ImageHDU(header, null);

            StreamedBinaryTableHDU hdu2 =
                new StreamedBinaryTableHDU(new DataReaderAdapter(reader), 4096,
                                           writeMode, stringTruncationLength, padStringsLeft, stringPadChar);

            Fits fits = new Fits();

            fits.AddHDU(hdu1);
            fits.AddHDU(hdu2);

            Stream s = null;

            try
            {
                s = new FileStream(filename, FileMode.Create);
                fits.Write(s);
                s.Close();
            }
            catch (Exception e)
            {
                s.Close();
                throw (e);
            }
        }
 public PadWriter(StreamedBinaryTableHDU table)
 {
     _table = table;
 }
 public HeapWriterWithTempTable(StreamedBinaryTableHDU table)
 {
     _table = table;
 }
 public OnePassWriter(StreamedBinaryTableHDU table)
 {
     _table = table;
 }
Exemple #5
0
        /// <summary>
        /// writes the header to fits file
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="filename"></param>
        /// <param name="writeMode"></param>
        /// <param name="stringTruncationLength"></param>
        /// <param name="padStringsLeft"></param>
        /// <param name="stringPadChar"></param>
        public static void Write(IDataReader reader, String filename,
                                StreamedBinaryTableHDU.StringWriteMode writeMode, int stringTruncationLength,
                                bool padStringsLeft, char stringPadChar)
        {
            Header header = new Header();
              header.Simple = true;
              header.Bitpix = 8;
              header.Naxes = 0;

              Cursor c = header.GetCursor();
              // move to the end of the header cards
              for(c.MoveNext(); c.MoveNext(););
              // we know EXTEND isn't there yet
              c.Add("EXTEND", new HeaderCard("EXTEND", true, null));

              ImageHDU hdu1 = new ImageHDU(header, null);

              StreamedBinaryTableHDU hdu2 =
            new StreamedBinaryTableHDU(new DataReaderAdapter(reader), 4096,
            writeMode, stringTruncationLength, padStringsLeft, stringPadChar);

              Fits fits = new Fits();
              fits.AddHDU(hdu1);
              fits.AddHDU(hdu2);

              Stream s = null;
              try
              {
            s = new FileStream(filename, FileMode.Create);
            fits.Write(s);
            s.Close();
              }
              catch(Exception e)
              {
            s.Close();
            throw(e);
              }
        }
 public FixWriter(StreamedBinaryTableHDU table)
 {
     _table = table;
 }
 public OnePassWriter(StreamedBinaryTableHDU table)
 {
     _table = table;
 }
 public HeapWriterWithTempTable(StreamedBinaryTableHDU table)
 {
     _table = table;
 }