public void TestReadBuffered()
        {
            string       filename = TestFileSetup.GetTargetFilename("test.fits");
            BufferedFile bf       =
                new BufferedFile(
                    filename,
                    FileAccess.Read,
                    FileShare.None);

            Header h = Header.ReadHeader(bf);

            long n        = h.DataSize;
            int  naxes    = h.GetIntValue("NAXIS");
            int  lastAxis = h.GetIntValue("NAXIS" + naxes);

            HeaderCard hnew = new HeaderCard("NAXIS", naxes - 1, "this is header card with naxes");

            h.AddCard(hnew);

            float[] line = new float[h.DataSize];

            for (int i = 0; i < lastAxis; i += 1)
            {
                Console.Out.WriteLine("read");
                bf.Read(line);
            }

            bf.Close();
            bf.Dispose();
        }
Пример #2
0
        public void TestReadBuffered()
        {
            String file = Path.GetTempFileName();

            File.Copy("testdocs\\ht1.fits", file, true);
            BufferedFile bf = new BufferedFile(file, FileAccess.Read, FileShare.None);

            Header     h        = Header.ReadHeader(bf);
            long       n        = h.DataSize;
            int        naxes    = h.GetIntValue("NAXIS");
            int        lastAxis = h.GetIntValue("NAXIS" + naxes);
            HeaderCard hnew     = new HeaderCard("NAXIS", naxes - 1, "this is header card with naxes");

            h.AddCard(hnew);
            float[] line = new float[h.DataSize];
            for (int i = 0; i < lastAxis; i += 1)
            {
                Console.Out.WriteLine("read");
                bf.Read(line);
            }
        }