Package net.ivoa.fits

Examples of net.ivoa.fits.HeaderCard


public class HeaderCardTester {

  public static void main(String[] args) {

    HeaderCard p;

    try {
      if (args.length == 3) {

        p = new HeaderCard(args[0], args[1], args[2]);

      } else {
        p = new HeaderCard(args[0]);
      }
    } catch (Exception e) {
      System.out.println("Got exception: " + e);
      return;
    }

    System.out.println("Key is:     " + p.getKey());
    System.out.println("Value is:   " + p.getValue());
    System.out.println("Comment is: " + p.getComment());
    System.out.println("Is this a key/value pair:" + p.isKeyValuePair());
    System.out.println("Is this a string:" + p.isStringValue());
    System.out
        .println("The card is:\n"
            + "0         1         2         3         4         5         6         7        X\n"
            + p.toString());
  }
View Full Code Here


      myHeader.deleteKey("GCOUNT");
    }

    if (isPrimary) {
      try {
        HeaderCard card = myHeader.findCard("EXTEND");
      } catch (FitsExceptionNoKey ex) {
        getAxes(); // Leaves the iterator pointing to the last NAXISn
        // card.
        myHeader.nextCard();
        myHeader.addValue("EXTEND", true, "Allow extensions");
View Full Code Here

    h.addValue("PCOUNT", heap.size(), null);
    h.addValue("GCOUNT", 1, null);
    Cursor iter = h.iterator();
    iter.setKey("GCOUNT");
    iter.next();
    iter.add("TFIELDS", new HeaderCard("TFIELDS", modelRow.length, null));
    iter.add("THEAP", new HeaderCard("THEAP", 0, null));
    for (int i = 0; i < modelRow.length; i += 1) {
      if (i > 0) {
        h.positionAfterIndex("TFORM", i);
      }
      fillForColumn(h, i, iter);
View Full Code Here

    } else {
      throw new FitsException("Invalid column data class:" + bases[col]);
    }

    String key = "TFORM" + (col + 1);
    iter.add(key, new HeaderCard(key, tform, null));

    if (dimens[col].length > 0 && ((flags[col] & COL_VARYING) == 0)) {
      StringBuffer tdim = new StringBuffer();
      char comma = '(';
      for (int i = dimens[col].length - 1; i >= 0; i -= 1) {
        tdim.append(comma);
        tdim.append(dimens[col][i]);
        comma = ',';
      }
      tdim.append(')');
      key = "TDIM" + (col + 1);
      iter.add(key, new HeaderCard(key, new String(tdim), null));
    }

    key = "TTYPE" + (col + 1);
    iter.add(key, new HeaderCard(key, "UNKNOW" + (col + 1), "Field type"));
  }
View Full Code Here

      hdr.setNaxis(1, rowLen);
      hdr.setNaxis(2, nRows);
      Cursor iter = hdr.iterator();
      iter.setKey("NAXIS2");
      iter.next();
      iter.add("PCOUNT", new HeaderCard("PCOUNT", 0, "No group data"));
      iter.add("GCOUNT", new HeaderCard("GCOUNT", 1, "One group"));
      iter.add("TFIELDS", new HeaderCard("TFIELDS", nFields,
          "Number of fields in table"));

      for (int i = 0; i < nFields; i += 1) {
        addColInfo(i, iter);
      }
View Full Code Here

    } else if (types[col] == double.class) {
      tform = "D" + lengths[col] + ".0";
    }
    String key;
    key = "TFORM" + (col + 1);
    iter.add(key, new HeaderCard(key, tform, null));
    key = "TBCOL" + (col + 1);
    iter.add(key, new HeaderCard(key, offsets[col] + 1, null));
    key = "TTYPE" + (col + 1);
    iter.add(key, new HeaderCard(key, "UNKNOW" + (col + 1), "Field type"));
    return lengths[col];
  }
View Full Code Here

TOP

Related Classes of net.ivoa.fits.HeaderCard

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.