class AscDataWriter extends DataWriter {

    @Override
    public void write() {
        List<VortexGrid> grids = data.stream()
                .filter(vortexData -> vortexData instanceof VortexGrid)
                .map(vortexData -> (VortexGrid) vortexData)
                .collect(Collectors.toList());

        grids.forEach(grid -> {
            VortexGrid gridOut;
            if (grid.dy() < 0){
                gridOut = grid;
            } else {
                float[] flipped = MatrixUtils.flipArray(grid.data(), grid.nx(), grid.ny());
                gridOut = VortexGrid.builder()
                        .dx(grid.dx()).dy(grid.dy())
                        .nx(grid.nx()).ny(grid.ny())
                        .originX(grid.originX())
                        .originY(grid.originY() + grid.dy() * grid.ny())
                        .wkt(grid.wkt())
                        .data(flipped)
                        .units(grid.units())
                        .fileName(grid.fileName())
                        .shortName(grid.shortName())
                        .fullName(grid.fullName())
                        .description(grid.description())
                        .startTime(grid.startTime())
                        .endTime(grid.endTime())
                        .interval(grid.interval())
                        .build();
            }

            Dataset dataset = RasterUtils.getDatasetFromVortexGrid(gridOut);
            ArrayList<String> gdalOptions = new ArrayList<>();
            gdalOptions.add("-of");
            gdalOptions.add("AAIGrid");
            gdalOptions.add("-co");
            gdalOptions.add("FORCE_CELLSIZE=TRUE");
            TranslateOptions translateOptions = new TranslateOptions(new Vector<>(gdalOptions));
            Dataset out = gdal.Translate(destination.toString(), dataset, translateOptions);
            out.FlushCache();
            out.delete();
        });
    }

      AscDataWriter(DataWriterBuilder builder);

}