Re: [netcdf-java] RunTime coordinate axis

John,

I have discovered another point of conflict to my proposal of permuting run and time dimensions an is in :
ucar.nc2.dt.grid.GridCoordSys.makeTimeAxisForRun(int)

and more precisely tAxis.slice, which is assumint the runtime dimension in the 1st position

private CoordinateAxis1DTime makeTimeAxisForRun(int run_index) {
    VariableDS section;
    try {
      section = (VariableDS) tAxis.slice(0, run_index);
      return CoordinateAxis1DTime.factory(ds, section, null);
    } catch (InvalidRangeException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    }
    return null;
  }

A.


--
Antonio S. Cofiño
Grupo de Meteorología de Santander
Dep. de Matemática Aplicada y
        Ciencias de la Computación
Universidad de Cantabria
http://www.meteo.unican.es

El 02/03/2013 22:44, "Antonio S. Cofiño" escribió:
Dear John,

(I'm using the netcdf-java 4.3.15)
As you can see in the attached ncml,I'm defining a RunTime dimension in the Total_precipitation_surface inner than the time dimension. I'm doing this because I need to do the outer aggregation for the forecast time dimension. Also the time variable is been aggregated.

The problem is that the Total_precipitation_surface variable it's no been recognized as a Grid data type. If I permute dimensions on the time variable then the variable is recognized as Grid datatype.

This is right? or I'm forced to define as first dimension the RunTime axis on the time 2D coordinated axis?

Looking at:
ucar.nc2.dt.grid.GridCoordSys.isGridCoordSys(Formatter, CoordinateSystem, VariableEnhanced)

which it appears to be the responsible for deciding if a Variable is a Grid datatype

It appears that it could be easily fixed if we modified this part:
      if (!rt1D.getDimension(0).equals(t.getDimension(0))) {
        if (sbuff != null) {
sbuff.format("%s: Time axis must use RunTime dimension%n", cs.getName());
        }
        return false;
      }

coding also the check for the 2nd dimension:
if (!rt1D.getDimension(0).equals(t.getDimension(0)) && !rt1D.getDimension(0).equals(t.getDimension(1))) {
        if (sbuff != null) {
sbuff.format("%s: Time axis must use RunTime dimension%n", cs.getName());
        }
        return false;
      }

It's correct?

Antonio




_______________________________________________
netcdf-java mailing list
netcdf-java@xxxxxxxxxxxxxxxx
For list information or to unsubscribe, visit: 
http://www.unidata.ucar.edu/mailing_lists/



  • 2013 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-java archives: