Giter VIP home page Giter VIP logo

Comments (2)

JohnLCaron avatar JohnLCaron commented on August 21, 2024

Hi Antonio:

Do you have a dataset we could set up a unit test for this?

thanks, John

from thredds.

cofinoa avatar cofinoa commented on August 21, 2024

This NCML produce the same effect:

<?xml version='1.0' encoding='UTF-8'?>
<netcdf xmlns='http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2'>
  <dimension name='lon'    length='20' />
  <dimension name='lat'    length='11' />
  <dimension name='time'   length='10' />
  <dimension name='member' length='4'  />
  <dimension name='run'    length='2'  />
  <variable name='mean2t24' type='float' shape='run member time lat lon' >
    <attribute name='long_name' value='Test Variable' />
    <attribute name='units' value='K' />
    <attribute name='standard_name' value='air_temperature' />
    <values start='273.15' increment='0.2' />
  </variable>
  <variable name='run' type='int' shape='run' >
    <attribute name='long_name' value='Run time for ForecastModelRun' />
    <attribute name='standard_name' value='forecast_reference_time' />
    <attribute name='units' value='hours since 1981-01-01T00:00:00' />
    <attribute name='_CoordinateAxisType' value='RunTime' />
    <values>0 24</values>
  </variable>
  <variable name='member' type='String' shape='member' >
    <attribute name='standard_name' value='realization' />
    <attribute name='_CoordinateAxisType' value='Ensemble' />
    <values>p1m1 p1m2 p2m1 p2m2</values>
  </variable>
  <variable name='lat' type='float' shape='lat' >
    <attribute name='long_name' value='latitude' />
    <attribute name='units' value='degrees_north' />
    <values start='30.0' increment='2.5' />
  </variable>
  <variable name='lon' type='float' shape='lon' >
    <attribute name='long_name' value='longitude' />
    <attribute name='units' value='degrees_east' />
    <values start='-20' increment='2.5' />
  </variable>
  <variable name='time24' type='int' shape='run time' >
    <attribute name='long_name' value='Forecast time for ForecastModelRun' />
    <attribute name='standard_name' value='time' />
    <attribute name='units' value='hours since 1981-01-01T00:00:00' />
    <attribute name='_CoordinateAxisType' value='Time' />
    <values>0 6 12 18 24 30 36 42 48 54 24 30 36 42 48 54 60 66 72 78</values>
  </variable>
</netcdf>

And this a small code reproducing the problem:

import ucar.ma2.Range;
import ucar.nc2.dt.GridDatatype;
import ucar.nc2.dt.grid.GeoGrid;
import ucar.nc2.dt.grid.GridDataset;

public class MakeSubsettest {

    public static void main(String args[]){
        // Modify the url accordly
        String url="GeoGridMakeSubsetTest.ncml";
        try {
            GridDataset gd = GridDataset.open(url);
            System.out.println(gd);
            GeoGrid gg = gd.findGridByShortName("mean2t24");
            System.out.println(gg);
            GridDatatype gdt = gg.makeSubset(new Range(0,0), new Range(0,0), new Range(0,0), new Range(0,0), new Range(0,0), new Range(0,0));
            System.out.println(gdt);
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}

from thredds.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.