コード例 #1
0
ファイル: BaseFitsTest.java プロジェクト: LCOGT/nom-tam-fits
 /**
  * this test is only for manual usage with enough memory allocated.
  *
  * @throws Exception
  */
 @Test
 @Ignore
 public void testVeryBigDataFiles() throws Exception {
   Fits f = new Fits();
   ImageData data = new ImageData(new float[50000][50000]);
   Header manufactureHeader = ImageHDU.manufactureHeader(data);
   f.addHDU(FitsFactory.hduFactory(manufactureHeader, data));
   BufferedFile bf = new BufferedFile("target/big.fits", "rw");
   f.write(bf);
   System.out.println(Arrays.toString(ArrayFuncs.getDimensions(f.getHDU(0).getData().getData())));
   f = new Fits("target/big.fits");
   System.out.println(Arrays.toString(ArrayFuncs.getDimensions(f.getHDU(0).getData().getData())));
 }
コード例 #2
0
ファイル: BaseFitsTest.java プロジェクト: LCOGT/nom-tam-fits
  @Test
  public void testBigDataSegments() throws Exception {
    ImageData data = new ImageData(new float[4][4]);

    Header manufactureHeader = ImageHDU.manufactureHeader(data);
    manufactureHeader.card(Standard.END).comment("");
    manufactureHeader.findCard(Standard.NAXIS1).setValue(25000);
    manufactureHeader.findCard(Standard.NAXIS2).setValue(25000);

    long value = manufactureHeader.getDataSize();
    int intValue = (int) manufactureHeader.getDataSize();
    assertEquals(2500001280L, value);
    Assert.assertTrue(intValue != value);
  }