public float getGateSize() { try { return getRadialDistance(1) - getRadialDistance(0); } catch (IOException e) { e.printStackTrace(); return 0.0f; } }
public float getMeanAzimuth() { if(Double.isNaN(meanAzimuth)) setMeanAzimuth(); return (float) meanAzimuth; }
public float getMeanElevation() { if( Double.isNaN(meanElevation) ) setMeanElevation(); return (float) meanElevation ; }
public float getAzimuth( int ray) throws IOException { String aziName = "Azimuth"; Array aziData = null; if(aziData == null) { try { Array aziTmp = ds.findVariable(aziName).read(); if(isVolume) { int [] aziOrigin = new int[2]; aziOrigin[0] = sweepno; aziOrigin[1] = 0; int [] aziShape = {1, getRadialNumber()}; aziData = aziTmp.section(aziOrigin, aziShape); } else { aziData = aziTmp; } } catch (IOException e) { e.printStackTrace(); } catch (ucar.ma2.InvalidRangeException e) { e.printStackTrace(); } } Index index = aziData.getIndex(); return aziData.getFloat(index.set(ray)); }
private Netcdf2Variable(NetcdfDataset nds, VariableSimpleIF v, Variable v0) { super(v.getShortName(), v0.getAttributes()); sweeps = new ArrayList(); nsweeps = 0; name = v.getShortName(); int[] shape = v0.getShape(); int count = v0.getRank() - 1; int ngates = shape[count]; count--; int nrays = shape[count]; count--; if(shape.length == 3) nsweeps = shape[count]; else nsweeps = 1; for(int i = 0; i< nsweeps; i++) sweeps.add( new Netcdf2Sweep(v0, i, nrays, ngates)) ; }
private Netcdf2Variable(NetcdfDataset nds, VariableSimpleIF v, Variable v0) { super(v.getShortName(), v0.getAttributes()); sweeps = new ArrayList(); nsweeps = 0; name = v.getShortName(); int[] shape = v0.getShape(); int count = v0.getRank() - 1; int ngates = shape[count]; count--; int nrays = shape[count]; count--; if(shape.length == 3) nsweeps = shape[count]; else nsweeps = 1; for(int i = 0; i< nsweeps; i++) sweeps.add( new Netcdf2Sweep(v0, i, nrays, ngates)) ; }
public float getAzimuth(int ray) throws IOException { String aziName = "Azimuth"; try { Array aziData = ds.findVariable(aziName).read(); if(isVolume) { int [] aziOrigin = new int[2]; aziOrigin[0] = sweepno; aziOrigin[1] = 0; int [] aziShape = {1, getRadialNumber()}; aziData = aziData.section(aziOrigin, aziShape); } Index index = aziData.getIndex(); return aziData.getFloat(index.set(ray)); } catch (ucar.ma2.InvalidRangeException e) { throw new IOException(e); } }
public float getGateSize() { try { return getRadialDistance(1) - getRadialDistance(0); } catch (IOException e) { e.printStackTrace(); return 0.0f; } }
public float getRadialDistance(int gate) throws IOException { float gateStart = getRangeToFirstGate(); Variable gateSize = ds.findVariable("GateWidth"); float [] data = (float [])gateSize.read().get1DJavaArray(float.class); float dist = gateStart + gate*data[0]; return dist; }
public float getMeanAzimuth() { if(Double.isNaN(meanAzimuth)) setMeanAzimuth(); return (float) meanAzimuth; }
public float getMeanElevation() { if( Double.isNaN(meanElevation) ) setMeanElevation(); return (float) meanElevation ; }
public float getRadialDistance(int gate) throws IOException { float gateStart = getRangeToFirstGate(); Variable gateSize = ds.findVariable("GateWidth"); float [] data = (float [])gateSize.read().get1DJavaArray(float.class); float dist = (float)(gateStart + gate*data[0]); return dist; }