New function for retrieving grid definition from existing datasets