Examples of GridCoordSystem

• ucar.nc2.dt.GridCoordSystem
A Coordinate System for gridded data. Assume:
• X and Y are 1 or 2 dimensional
• T is 1 or 2 dimensional. The 2D case is that it depends on runtime.
• We can create Dates out of the T and RT coordinate values.
• Z, E, RT are 1-dimensional
• An optional VerticalTransform can provide a height or pressure coordinate that may be 1-4 dimensional.

@author caron

Examples of ucar.nc2.dt.GridCoordSystem

 `114115116117118119120121122123124125126127128129` ```    assert g.getShape()[0] == ntimes;     assert g.getShape()[1] == 1008;     assert g.getShape()[2] == 1536;     assert g.getDataType() == DataType.SHORT;     GridCoordSystem gsys = g.getCoordinateSystem();     assert gsys.getXHorizAxis() != null;     assert gsys.getYHorizAxis() != null;     assert gsys.getTimeAxis() != null;     assert gsys.getVerticalAxis() == null;     assert gsys.getProjection() != null;     Array data = g.readVolumeData(0);     assert data.getRank() == 2;     assert data.getShape()[0] == 1008;     assert data.getShape()[1] == 1536; ```
View Full Code Here

Examples of ucar.nc2.dt.GridCoordSystem

 `335336337338339340341342343344345346347348349350351352353354355356357358359360` ```          continue;         }         // annotate Variable for CF         StringBuilder sbuff = new StringBuilder();         GridCoordSystem gcs = grid.getCoordinateSystem();         for (CoordinateAxis axis : gcs.getCoordinateAxes()) {           if ((axis.getAxisType() != AxisType.Time) && (axis.getAxisType() != AxisType.RunTime)) // these are added later             sbuff.append(axis.getFullName()).append(" ");         }         newV.addAttribute(new Attribute("coordinates", sbuff.toString())); // LOOK what about adding lat/lon variable         // looking for coordinate transform variables         for (CoordinateTransform ct : gcs.getCoordinateTransforms()) {           Variable ctv = result.findVariable(ct.getName());           if ((ctv != null) && (ct.getTransformType() == TransformType.Projection))             newV.addAttribute(new Attribute("grid_mapping", ctv.getFullName()));         }         // LOOK is this needed ?         for (CoordinateAxis axis : gcs.getCoordinateAxes()) {           Variable coordV = result.findVariable(axis.getFullNameEscaped());           if ((axis.getAxisType() == AxisType.Height) || (axis.getAxisType() == AxisType.Pressure) || (axis.getAxisType() == AxisType.GeoZ)) {             if (null != axis.getPositive())               coordV.addAttribute(new Attribute("positive", axis.getPositive()));           } ```
View Full Code Here

Examples of ucar.nc2.dt.GridCoordSystem

 `123124125126127128129130131132133134135136137138139140141142143144145146147148` ```      throw new IllegalArgumentException("no grids");     // collect the grids into Gridsets, based on what time axis they use     HashMap timeAxisHash = new HashMap(); // key = timeAxis, value = Gridset     for (GridDatatype grid : grids) {       GridCoordSystem gcs = grid.getCoordinateSystem();       CoordinateAxis timeAxis = gcs.getTimeAxis();       if (timeAxis != null) {         Gridset gset = timeAxisHash.get(timeAxis); // group by timeAxis         if (gset == null) {           gset = new Gridset(timeAxis, gcs);           timeAxisHash.put(timeAxis, gset);           coordSet.add(timeAxis.getFullName());         }         gset.gridList.add(grid);         gridHash.put(grid.getFullName(), gset);       }       // assume runtimes are always the same       if ((runtimes == null) && (gcs.getRunTimeAxis() != null)) {         CoordinateAxis1DTime runtimeCoord = gcs.getRunTimeAxis();         Date[] runDates = runtimeCoord.getTimeDates();         baseDate = runDates[0];         runtimes = Arrays.asList(runDates);         runtimeDimName = runtimeCoord.getDimension(0).getName();         coordSet.add(runtimeCoord.getFullName()); ```
View Full Code Here

Examples of ucar.nc2.dt.GridCoordSystem

 `6566676869707172737475` ```     this.availableCoverages = new HashMap();     for ( GridDataset.Gridset curGridset : this.dataset.getGridsets() )     {       GridCoordSystem gcs = curGridset.getGeoCoordSystem();       if ( ! gcs.isRegularSpatial() )         continue;       this.availableCoverages.put( gcs.getName(), new WcsCoverage( curGridset, this) );     }   } ```
View Full Code Here

Examples of ucar.nc2.dt.GridCoordSystem

 `166167168169170171172173174175176177178179180181182183184` ```  private DateRange dateRangeMax = null;   private void makeRanges() {     for (ucar.nc2.dt.GridDataset.Gridset gset : getGridsets()) {       GridCoordSystem gcs = gset.getGeoCoordSystem();       LatLonRect llbb = gcs.getLatLonBoundingBox();       if (llbbMax == null)         llbbMax = llbb;       else         llbbMax.extend(llbb);       DateRange dateRange = gcs.getDateRange();       if (dateRange != null) {         if (dateRangeMax == null)           dateRangeMax = dateRange;         else           dateRangeMax.extend(dateRange); ```
View Full Code Here

Examples of ucar.nc2.dt.GridCoordSystem

 `346347348349350351352353354355356357358359360` ```   */   private void getInfo(Formatter buf) {     int countGridset = 0;     for (Gridset gs : gridsetHash.values()) {       GridCoordSystem gcs = gs.getGeoCoordSystem();       buf.format("%nGridset %d  coordSys=%s", countGridset,  gcs);       buf.format(" LLbb=%s ", gcs.getLatLonBoundingBox());       if ((gcs.getProjection() != null)  && !gcs.getProjection().isLatLon())         buf.format(" bb= %s", gcs.getBoundingBox());       buf.format("%n");       buf.format("Name__________________________Unit__________________________hasMissing_Description%n");       for (GridDatatype grid : gs.getGrids()) {         buf.format("%s%n", grid.getInfo());       } ```
View Full Code Here

Examples of ucar.nc2.dt.GridCoordSystem

 `6263646566676869707172` ```  private int ntimes = 1;   public BufferedImage openDataset( GridDatatype grid) throws java.io.IOException {     this.grid = grid;     this.time = 0;     GridCoordSystem gcsys = grid.getCoordinateSystem();     if (gcsys.getTimeAxis() != null)       ntimes = (int) gcsys.getTimeAxis().getSize();     Array data = grid.readDataSlice( this.time, 0, -1, -1);     return ImageArrayAdapter.makeGrayscaleImage( data);   } ```
View Full Code Here

Examples of ucar.nc2.dt.GridCoordSystem

 `410411412413414415416417418419420421422423` ```   public static void test1() throws IOException {     String filename = "D:/work/asaScience/EGM200_3.ncml";     GridDataset gds = GridDataset.open(filename);     GeoGrid grid = gds.findGridByName("u_wind");     GridCoordSystem gcs = grid.getCoordinateSystem();     CoordinateAxis lonAxis = gcs.getXHorizAxis();     assert lonAxis instanceof CoordinateAxis2D;     CoordinateAxis latAxis = gcs.getYHorizAxis();     assert latAxis instanceof CoordinateAxis2D;     GridCoordinate2D g2d = new GridCoordinate2D((CoordinateAxis2D) latAxis, (CoordinateAxis2D) lonAxis);     doOne(g2d, 35.0, -6.0);     doOne(g2d, 34.667302, -5.008376); // FAIL ```
View Full Code Here

Examples of ucar.nc2.dt.GridCoordSystem

 `430431432433434435436437438439440441442443` ```   public static void test2() throws IOException {     String filename = "C:/data/fmrc/apex_fmrc/Run_20091025_0000.nc";     GridDataset gds = GridDataset.open(filename);     GeoGrid grid = gds.findGridByName("temp");     GridCoordSystem gcs = grid.getCoordinateSystem();     CoordinateAxis lonAxis = gcs.getXHorizAxis();     assert lonAxis instanceof CoordinateAxis2D;     CoordinateAxis latAxis = gcs.getYHorizAxis();     assert latAxis instanceof CoordinateAxis2D;     GridCoordinate2D g2d = new GridCoordinate2D((CoordinateAxis2D) latAxis, (CoordinateAxis2D) lonAxis);     doOne(g2d, 40.166959,-73.954234); ```
View Full Code Here

Examples of ucar.nc2.dt.GridCoordSystem

 `446447448449450451452453454455456457458459` ```   public static void test3() throws IOException {     String filename = "/data/testdata/cdmUnitTest/fmrc/rtofs/ofs.20091122/ofs_atl.t00z.F024.grb.grib2";     GridDataset gds = GridDataset.open(filename);     GeoGrid grid = gds.findGridByName("Sea_Surface_Height_Relative_to_Geoid");     GridCoordSystem gcs = grid.getCoordinateSystem();     CoordinateAxis lonAxis = gcs.getXHorizAxis();     assert lonAxis instanceof CoordinateAxis2D;     CoordinateAxis latAxis = gcs.getYHorizAxis();     assert latAxis instanceof CoordinateAxis2D;     GridCoordinate2D g2d = new GridCoordinate2D((CoordinateAxis2D) latAxis, (CoordinateAxis2D) lonAxis);     doOne(g2d, -15.554099426977835, -0.7742870290336263); ```
View Full Code Here