%classpath add mvn commons-io commons-io 2.6 import org.apache.commons.io.FileUtils stilUrl = "http://www.star.bristol.ac.uk/~mbt/stil/stil.jar" stilFile = System.getProperty("java.io.tmpdir") + "/stilFiles/stil.jar" FileUtils.copyURLToFile(new URL(stilUrl), new File(stilFile)); %classpath add dynamic stilFile import uk.ac.starlink.table.StarTable import uk.ac.starlink.table.Tables import jupyter.Displayer import jupyter.Displayers Displayers.register(StarTable.class, new Displayer() { def getColumnNames(t){ names = [] nCol = t.getColumnCount(); for ( int icol = 0; icol < nCol; icol++ ) { names.add(t.getColumnInfo(icol).getName()) } names } @Override public Map display(StarTable table) { columnNames = getColumnNames(table) columnInfos = Tables.getColumnInfos(table) MAXCHAR = 64 new TableDisplay( (int)table.getRowCount(), (int)table.getColumnCount(), columnNames, new TableDisplay.Element() { @Override public String get(int columnIndex, int rowIndex) { Object cell = table.getCell(rowIndex, columnIndex); return columnInfos[columnIndex].formatValue(cell, MAXCHAR) } } ).display(); return OutputCell.DISPLAYER_HIDDEN; } }); import org.apache.commons.io.FileUtils messierUrl = "http://andromeda.star.bristol.ac.uk/data/messier.csv" messierFile = System.getProperty("java.io.tmpdir") + "/stilFiles/messier.csv" FileUtils.copyURLToFile(new URL(messierUrl), new File(messierFile)); "Done" import uk.ac.starlink.table.StarTable import uk.ac.starlink.table.StarTableFactory import uk.ac.starlink.table.Tables starTable = new StarTableFactory().makeStarTable( messierFile, "csv" ); starTable = Tables.randomTable(starTable)