class NetcdfDataReader extends DataReader {

    @Override
    public VortexData getDto(int idx) {
        try (NetcdfDataset ncd = NetcdfDatasets.openDataset(path);  Formatter errlog = new Formatter()) {
            FeatureDataset dataset = FeatureDatasetFactoryManager.wrap(FeatureType.GRID, ncd, null, errlog);
            if (dataset != null) {
                FeatureType ftype = dataset.getFeatureType();
                if (ftype == FeatureType.GRID) {
                    assert (dataset instanceof GridDataset);
                    GridDataset gridDataset = (GridDataset) dataset;
                    return getData(gridDataset, variableName, idx);
                }
            } else {
                List<Variable> variables = ncd.getVariables();
                for (Variable variable : variables){
                    if (variable.getShortName().equals(variableName) && variable instanceof VariableDS) {
                        VariableDS variableDS = (VariableDS) variable;
                        List<CoordinateSystem> coordinateSystems = variableDS.getCoordinateSystems();
                        if (!coordinateSystems.isEmpty()) {
                            VariableDsReader reader = VariableDsReader.builder()
                                    .setNetcdfFile(ncd)
                                    .setVariableName(variableName)
                                    .build();

                            return reader.read(idx);
                        }
                    }
                }
            }
        } catch (IOException e) {
            logger.log(Level.SEVERE, e, e::getMessage);
        }

        return null;
    }

      NetcdfDataReader(DataReaderBuilder builder);

}