Beispiel #1
0
  @Test
  public void testFitsSkipHdu() throws Exception {
    Fits fits1 = makeAsciiTable();

    BasicHDU<?> image = fits1.readHDU();
    AsciiTableHDU hdu2 = (AsciiTableHDU) fits1.readHDU();
    fits1.skipHDU(2);
    AsciiTableHDU hdu3 = (AsciiTableHDU) fits1.readHDU();

    hdu2.info(System.out);
    hdu3.info(System.out);
    Assert.assertArrayEquals(new int[] {11}, (int[]) hdu2.getData().getElement(1, 1));
    Assert.assertArrayEquals(new int[] {41}, (int[]) hdu3.getData().getElement(1, 1));
    hdu3.getData();
  }
Beispiel #2
0
  @Test
  public void convertAsciiToBinaryTable() throws Exception {
    FitsFactory.setUseAsciiTables(false);

    Fits fits1 = makeAsciiTable();

    fits1.readHDU();
    BinaryTableHDU hdu2 = (BinaryTableHDU) fits1.readHDU();
    fits1.skipHDU(2);
    BinaryTableHDU hdu3 = (BinaryTableHDU) fits1.readHDU();

    hdu2.info(System.out);
    hdu3.info(System.out);
    Assert.assertArrayEquals(new int[] {11}, (int[]) hdu2.getData().getElement(1, 1));
    Assert.assertArrayEquals(new int[] {41}, (int[]) hdu3.getData().getElement(1, 1));
    hdu3.getData();
  }