public void TestReadBuffered() { BufferedFile bf = new BufferedFile("E:\\CSharpFITSIO\\LAB-2.0kms.fits", 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); } }
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); } }