Codota Logo
NetcdfDataset.acquireDataset
Code IndexAdd Codota to your IDE (free)

How to use
acquireDataset
method
in
ucar.nc2.dataset.NetcdfDataset

Best Java code snippets using ucar.nc2.dataset.NetcdfDataset.acquireDataset (Showing top 20 results out of 315)

  • Common ways to obtain NetcdfDataset
private void myMethod () {
NetcdfDataset n =
  • Codota IconString location;NetcdfDataset.openDataset(location)
  • Codota IconNetcdfFile ncfile;new NetcdfDataset(ncfile)
  • Codota Iconnew NetcdfDataset()
  • Smart code suggestions by Codota
}
origin: geotools/geotools

public static NetcdfDataset acquireDataset(URI uri) throws IOException {
  if (getFormat(uri) == FileFormat.FC) {
    return acquireFeatureCollection(uri.toString());
  } else {
    return NetcdfDataset.acquireDataset(uri.toString(), null);
  }
}
origin: edu.ucar/netcdf

public FmrcImpl(String filename) throws IOException {
 this( ucar.nc2.dataset.NetcdfDataset.acquireDataset(filename, null));
}
origin: edu.ucar/netcdf

static public NetcdfDataset acquireDataset(String location, boolean enhance, ucar.nc2.util.CancelTask cancelTask) throws IOException {
 return acquireDataset(null, location, enhance ? defaultEnhanceMode : null, -1, cancelTask, null);
}
origin: edu.ucar/cdm

static public NetcdfDataset acquireDataset(String location, boolean enhance, ucar.nc2.util.CancelTask cancelTask) throws IOException {
 return acquireDataset(null, location, enhance ? defaultEnhanceMode : null, -1, cancelTask, null);
}
origin: edu.ucar/netcdf

/**
 * Same as openDataset, but file is acquired through the File Cache, with defaultEnhanceMode.
 * You still close with NetcdfDataset.close(), the release is handled automatically.
 * You must first call initNetcdfFileCache() for caching to actually take place.
 *
 * @param location   location of file, passed to FileFactory
 * @param cancelTask allow task to be cancelled; may be null.
 * @return NetcdfDataset object
 * @throws java.io.IOException on read error
 */
static public NetcdfDataset acquireDataset(String location, ucar.nc2.util.CancelTask cancelTask) throws IOException {
 return acquireDataset(null, location, defaultEnhanceMode, -1, cancelTask, null);
}
origin: edu.ucar/cdm

/**
 * Same as openDataset, but file is acquired through the File Cache, with defaultEnhanceMode.
 * You still close with NetcdfDataset.close(), the release is handled automatically.
 * You must first call initNetcdfFileCache() for caching to actually take place.
 *
 * @param location   location of file, passed to FileFactory
 * @param cancelTask allow task to be cancelled; may be null.
 * @return NetcdfDataset object
 * @throws java.io.IOException on read error
 */
static public NetcdfDataset acquireDataset(String location, ucar.nc2.util.CancelTask cancelTask) throws IOException {
 return acquireDataset(null, location, defaultEnhanceMode, -1, cancelTask, null);
}
origin: Unidata/thredds

/**
 * Same as openDataset, but file is acquired through the File Cache, with defaultEnhanceMode,
 * without the need of setting the enhanceMode via the signature.
 * You still close with NetcdfDataset.close(), the release is handled automatically.
 * You must first call initNetcdfFileCache() for caching to actually take place.
 *
 * @param location   location of file, passed to FileFactory
 * @param cancelTask allow task to be cancelled; may be null.
 * @return NetcdfDataset object
 * @throws java.io.IOException on read error
 */
static public NetcdfDataset acquireDataset(DatasetUrl location, ucar.nc2.util.CancelTask cancelTask) throws IOException {
 return acquireDataset(null, location, defaultEnhanceMode, -1, cancelTask, null);
}
origin: Unidata/thredds

/**
 * Same as openDataset, but file is acquired through the File Cache, with defaultEnhanceMode.
 * You still close with NetcdfDataset.close(), the release is handled automatically.
 * You must first call initNetcdfFileCache() for caching to actually take place.
 *
 * @param location   location of file, passed to FileFactory
 * @param enhanceMode how to enhance. if null, then no enhancement
 * @param cancelTask allow task to be cancelled; may be null.
 * @return NetcdfDataset object
 * @throws java.io.IOException on read error
 */
static public NetcdfDataset acquireDataset(DatasetUrl location, boolean enhanceMode, ucar.nc2.util.CancelTask cancelTask) throws IOException {
 return acquireDataset(null, location, enhanceMode ? defaultEnhanceMode : null, -1, cancelTask, null);
}
origin: Unidata/thredds

/**
 * Same as openDataset, but file is acquired through the File Cache, with specified enhancements.
 * You still close with NetcdfDataset.close(), the release is handled automatically.
 * You must first call initNetcdfFileCache() for caching to actually take place.
 *
 * @param location   location of file, passed to FileFactory
 * @param enhanceMode how to enhance. if null, then no enhancement
 * @param cancelTask allow task to be cancelled; may be null.
 * @return NetcdfDataset object
 * @throws java.io.IOException on read error
 */
static public NetcdfDataset acquireDataset(DatasetUrl location, Set<Enhance> enhanceMode, ucar.nc2.util.CancelTask cancelTask) throws IOException {
 return acquireDataset(null, location, enhanceMode, -1, cancelTask, null);
}
origin: edu.ucar/netcdf

/**
 * Open a netcdf dataset, using NetcdfDataset.defaultEnhanceMode plus CoordSystems
 * and turn into a GridDataset.
 *
 * @param location netcdf dataset to open, using NetcdfDataset.acquireDataset().
 * @param enhanceMode open netcdf dataset with this enhanceMode
 * @return GridDataset
 * @throws java.io.IOException on read error
 * @see ucar.nc2.dataset.NetcdfDataset#acquireDataset
 */
static public GridDataset open(String location, Set<NetcdfDataset.Enhance> enhanceMode) throws java.io.IOException {
 NetcdfDataset ds = ucar.nc2.dataset.NetcdfDataset.acquireDataset(null, location, enhanceMode, -1, null, null);
 return new GridDataset(ds, null);
}
origin: edu.ucar/cdm

/**
 * Open a netcdf dataset, using NetcdfDataset.defaultEnhanceMode plus CoordSystems
 * and turn into a GridDataset.
 *
 * @param location netcdf dataset to open, using NetcdfDataset.acquireDataset().
 * @param enhanceMode open netcdf dataset with this enhanceMode
 * @return GridDataset
 * @throws java.io.IOException on read error
 * @see ucar.nc2.dataset.NetcdfDataset#acquireDataset
 */
static public GridDataset open(String location, Set<NetcdfDataset.Enhance> enhanceMode) throws java.io.IOException {
 NetcdfDataset ds = ucar.nc2.dataset.NetcdfDataset.acquireDataset(null, location, enhanceMode, -1, null, null);
 return new GridDataset(ds, null);
}
origin: Unidata/thredds

/**
 * Open a netcdf dataset, using NetcdfDataset.defaultEnhanceMode plus CoordSystems
 * and turn into a DtCoverageDataset.
 *
 * @param durl    netcdf dataset to open, using NetcdfDataset.acquireDataset().
 * @param enhanceMode open netcdf dataset with this enhanceMode
 * @return GridDataset
 * @throws java.io.IOException on read error
 * @see ucar.nc2.dataset.NetcdfDataset#acquireDataset
 */
static public DtCoverageDataset open(DatasetUrl durl, Set<NetcdfDataset.Enhance> enhanceMode) throws java.io.IOException {
 NetcdfDataset ds = ucar.nc2.dataset.NetcdfDataset.acquireDataset(null, durl, enhanceMode, -1, null, null);
 return new DtCoverageDataset(ds, null);
}
origin: org.geotools/gt-netcdf

public static NetcdfDataset acquireDataset(URI uri) throws IOException {
  if (getFormat(uri) == FileFormat.FC) {
    return acquireFeatureCollection(uri.toString());
  } else {
    return NetcdfDataset.acquireDataset(uri.toString(), null);
  }
}
origin: Unidata/thredds

/**
 * Open a netcdf dataset, using NetcdfDataset.defaultEnhanceMode plus CoordSystems
 * and turn into a GridDataset.
 *
 * @param location netcdf dataset to open, using NetcdfDataset.acquireDataset().
 * @param enhanceMode open netcdf dataset with this enhanceMode
 * @return GridDataset
 * @throws java.io.IOException on read error
 * @see ucar.nc2.dataset.NetcdfDataset#acquireDataset
 */
static public GridDataset open(String location, Set<NetcdfDataset.Enhance> enhanceMode) throws java.io.IOException {
 NetcdfDataset ds = ucar.nc2.dataset.NetcdfDataset.acquireDataset(null, DatasetUrl.findDatasetUrl(location), enhanceMode, -1, null, null);
 return new GridDataset(ds, null);
}
origin: Unidata/thredds

/**
 * Open a dataset as a TypedDataset.
 *
 * @param datatype open this kind of Typed Dataset; may be null, which means search all factories.
 *   If datatype is not null, only return correct TypedDataset (eg PointObsDataset for DataType.POINT).
 * @param location URL or file location of the dataset
 * @param task user may cancel
 * @param errlog place errors here, may not be null
 * @return a subclass of TypedDataset
 * @throws java.io.IOException on io error
 */
static public TypedDataset open( FeatureType datatype, String location, ucar.nc2.util.CancelTask task, StringBuilder errlog) throws IOException {
 DatasetUrl durl = DatasetUrl.findDatasetUrl(location);
 NetcdfDataset ncd = NetcdfDataset.acquireDataset(durl, true, task);
 return open( datatype, ncd, task, errlog);
}
origin: Unidata/thredds

 @Test
 public void doOne() throws Exception {
  try (NetcdfFile ncfile = NetcdfDataset.acquireFile(durl, null);
     NetcdfDataset ncWrap = new NetcdfDataset(ncfile, true)) {

   NetcdfDataset ncd = NetcdfDataset.acquireDataset(durl, true, null);
   System.out.println(" dataset wraps= " + durl.trueurl);

   ucar.unidata.util.test.CompareNetcdf.compareFiles(ncd, ncWrap);
  }
 }
}
origin: Unidata/thredds

private void doOne(String filename) throws Exception {
 try (NetcdfFile ncfile = NetcdfDataset.acquireFile(new DatasetUrl(null, filename), null);
    NetcdfDataset ncWrap = new NetcdfDataset(ncfile, true)) {
  NetcdfDataset ncd = NetcdfDataset.acquireDataset(new DatasetUrl(null, filename), true , null);
  System.out.println(" dataset wraps= " + filename);
  ucar.unidata.util.test.CompareNetcdf.compareFiles(ncd, ncWrap);
  ncd.close();
  ncWrap.close();
 }
}
origin: Unidata/thredds

@Test
public void TestNotCached() throws IOException {
 String filename = TestDir.cdmUnitTestDir + "ncml/nestedAgg/test.ncml";
 try (NetcdfDataset ncd = NetcdfDataset.acquireDataset(DatasetUrl.findDatasetUrl(filename), true ,null)) {
  Variable time = ncd.findVariable("time");
  assert time != null;
  assert time.getSize() == 19723 : time.getSize();
  // System.out.printf(" time array = %s%n", NCdumpW.toString(time.read()));
 }
}
origin: Unidata/thredds

 static public TrajectoryObsDataset open(String netcdfFileURI, ucar.nc2.util.CancelTask cancelTask)
     throws IOException {
  DatasetUrl durl = DatasetUrl.findDatasetUrl(netcdfFileURI);
  NetcdfDataset ds = NetcdfDataset.acquireDataset(durl, true, cancelTask);
  if (RafTrajectoryObsDataset.isValidFile(ds))
   return new RafTrajectoryObsDataset(ds);
  else if (SimpleTrajectoryObsDataset.isValidFile(ds))
   return new SimpleTrajectoryObsDataset(ds);
  else if (Float10TrajectoryObsDataset.isValidFile(ds))
   return new Float10TrajectoryObsDataset(ds);
  else if (ZebraClassTrajectoryObsDataset.isValidFile(ds))
   return new ZebraClassTrajectoryObsDataset(ds);
  else if (ARMTrajectoryObsDataset.isValidFile(ds))
   return new ARMTrajectoryObsDataset(ds);
  else
   return null;

 }
}
origin: Unidata/thredds

@Test
public void testUpdateCache() throws IOException, InvalidRangeException, InterruptedException {
  // make sure that the extra file is not in the agg
 move(extraFile);
 DatasetUrl durl = DatasetUrl.findDatasetUrl(location);
 // open the agg
 NetcdfFile ncfile = NetcdfDataset.acquireDataset(new NcmlStringFileFactory(), durl, null, -1, null, null);
 check(ncfile, 12);
 // now make sure that the extra file is in the agg
 moveBack(extraFile);
 // reread
 ncfile.syncExtend();
 check(ncfile, 18);
 ncfile.close();
}
ucar.nc2.datasetNetcdfDatasetacquireDataset

Javadoc

Same as openDataset, but file is acquired through the File Cache, with defaultEnhanceMode. You still close with NetcdfDataset.close(), the release is handled automatically. You must first call initNetcdfFileCache() for caching to actually take place.

Popular methods of NetcdfDataset

  • findVariable
  • openDataset
    Factory method for opening a dataset through the netCDF API, and identifying its coordinate variable
  • <init>
    Transform a NetcdfFile into a NetcdfDataset, optionally enhance it. You must not use the original Ne
  • getLocation
  • openFile
    Factory method for opening a NetcdfFile through the netCDF API.
  • close
    Close all resources (files, sockets, etc) associated with this dataset. If the underlying file was a
  • getVariables
  • findGlobalAttribute
  • findAttValueIgnoreCase
  • findCoordinateAxis
    Retrieve the CoordinateAxis with the specified Axis Type.
  • findDimension
  • getCoordinateAxes
    Get the list of all CoordinateAxis objects used by this dataset.
  • findDimension,
  • getCoordinateAxes,
  • getGlobalAttributes,
  • getCoordinateSystems,
  • finish,
  • getDefaultEnhanceMode,
  • getEnhanceAll,
  • getEnhanceMode,
  • getRootGroup

Popular in Java

  • Reading from database using SQL prepared statement
  • addToBackStack (FragmentTransaction)
  • getExternalFilesDir (Context)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Locale (java.util)
    A Locale object represents a specific geographical, political, or cultural region. An operation that
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registery of org.quartz
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now