congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
Sequence
Code IndexAdd Tabnine to your IDE (free)

How to use
Sequence
in
ucar.nc2

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

origin: edu.ucar/cdm

public StructureDataIterator getStructureIterator(int bufferSize) throws java.io.IOException {
 return new StructureDataConverter(this, orgSeq.getStructureIterator(bufferSize));
}
origin: edu.ucar/bufr

private void addSequence(Structure parent, DataDescriptor dataDesc) {
 //String seqName = ftype == (FeatureType.STATION_PROFILE) ? "profile" : "seq";
 String seqName = "seq" + seqNum;
 seqNum++;
 Sequence seq = new Sequence(ncfile, null, parent, seqName);
 seq.setDimensions(""); // scalar
 for (DataDescriptor dkey : dataDesc.getSubKeys())
  addMember(seq, dkey);
 parent.addMemberVariable(seq);
 seq.setSPobject(dataDesc);
 dataDesc.name = seqName;
 dataDesc.refersTo = seq;
}
origin: edu.ucar/netcdf

private StructureDataRegexp.Vinfo setVinfo(RandomAccessFile raff, NetcdfFile ncfile, Pattern p, String seqName) {
 Sequence seq = (Sequence) ncfile.findVariable(seqName);
 StructureMembers sm = seq.makeStructureMembers();
 StructureDataRegexp.Vinfo result = new StructureDataRegexp.Vinfo(raff, sm, p);
 seq.setSPobject(result);
 int fldno = 1;
 for (StructureMembers.Member m : sm.getMembers()) {
  StructureDataRegexp.VinfoField vf = new StructureDataRegexp.VinfoField(fldno++);
  Variable v = seq.findVariable(m.getName());
  Attribute att = v.findAttribute("iosp_scale");
  if (att != null) {
   vf.hasScale = true;
   vf.scale = att.getNumericValue().floatValue();
   //v.remove(att);
  }
  m.setDataObject(vf);
 }
 return result;
}
origin: edu.ucar/cdm

public Sequence(NetcdfFile ncfile, Group group, Structure parent, String shortName) {
 super(ncfile, group, parent, shortName);
 List<Dimension> dims = new ArrayList<>();
 dims.add(Dimension.VLEN);
 setDimensions(dims);
 setDataType(DataType.SEQUENCE);
}
origin: edu.ucar/netcdf

protected Sequence makeSequence(NetcdfFile ncfile) {
 Sequence seq = new Sequence(ncfile, null, null, RECORD);
     "time of stroke", null,
     secondsSince1970, AxisType.Time);
 seq.addMemberVariable(v);
 seq.addMemberVariable(v);
 seq.addMemberVariable(v);
 seq.addMemberVariable(v);
      "error ellipse semi-major axis", null,
      "km", null);
  seq.addMemberVariable(v);
      "error ellipse minor axis ", null,
      "km", null);
  seq.addMemberVariable(v);
      "error ellipse axis angle of orientation ", null, "degrees",
      null);
  seq.addMemberVariable(v);
      "multiplicity [#strokes per flash]",
      null, "", null);
  seq.addMemberVariable(v);
origin: edu.ucar/netcdf

Structure makeStructure(Structure parent) throws InvalidRangeException {
 Sequence seq = new Sequence(ncfile, null, parent, "otherData");
 seq.addAttribute(new Attribute(CDM.LONG_NAME, catNames[8]));
 int pos = 0;
 Variable v = seq.addMemberVariable(new Variable(ncfile, null, parent, "data", DataType.INT, ""));
 v.addAttribute(new Attribute(CDM.LONG_NAME, "additional data specified in table 101.1"));
 v.addAttribute(new Attribute(_Coordinate.AxisType, AxisType.Pressure.toString()));
 v.setSPobject(new Vinfo(pos));
 pos += 4;
 v = seq.addMemberVariable(new Variable(ncfile, null, parent, "table101code", DataType.SHORT, ""));
 v.addAttribute(new Attribute(CDM.LONG_NAME, "code figure from table 101"));
 v.addAttribute(new Attribute(CDM.MISSING_VALUE, (short) 999));
 v.setSPobject(new Vinfo(pos));
 pos += 2;
 v = seq.addMemberVariable(new Variable(ncfile, null, parent, "indicatorFlags", DataType.CHAR, ""));
 v.setDimensionsAnonymous(new int[]{2});
 v.addAttribute(new Attribute(CDM.LONG_NAME, "quality marks: 0=data, 1=form"));
 v.setSPobject(new Vinfo(pos));
 pos += 2;
 return seq;
}
origin: Unidata/thredds

private void makeObsRecord(BufrConfig bufrConfig) throws IOException {
 recordStructure = new Sequence(ncfile, null, null, BufrIosp2.obsRecord);
 ncfile.addVariable(null, recordStructure);
origin: edu.ucar/bufr

members = seq.makeStructureMembers();
for (StructureMembers.Member m : members.getMembers()) {
 m.setDataParam(offset);
 Variable mv = seq.findVariable(m.getName());
 DataDescriptor dk = (DataDescriptor) mv.getSPobject();
 if (dk.replication == 0)
origin: Unidata/thredds

@Test
@Category(NeedsCdmUnitTest.class)
public void testRead() throws IOException {
 try (NetcdfFile ncfile = NetcdfFile.open(TestDir.cdmUnitTestDir + "ft/point/200929100.ingest")) {
  Sequence record = (Sequence) ncfile.findVariable("record");
  List<String> expectedMemberNames = Arrays.asList("tsec", "nsec", "lat", "lon", "sgnl", "mult", "fill",
      "majorAxis", "eccent", "ellipseAngle", "chisqr");
  Assert.assertEquals(Sets.newHashSet(expectedMemberNames), Sets.newHashSet(record.getVariableNames()));
  try (StructureDataIterator iter = record.getStructureIterator()) {
   int recordCount = 0;
   while (iter.hasNext()) {
    StructureData data = iter.next();
    // Assert that a single value from the first record equals an expected value.
    // Kinda lazy, but checking all values would be impractical.
    if (recordCount++ == 0) {
     Assert.assertEquals(-700, data.getScalarShort("sgnl"));
    }
   }
   Assert.assertEquals(1165, recordCount);
  }
 }
}
origin: edu.ucar/netcdf

/**
 * UnsupportedOperation
 *
 * @throws UnsupportedOperationException
 */
@Override
public Array read(ucar.ma2.Section section) throws java.io.IOException, ucar.ma2.InvalidRangeException {
 return read();
}
origin: edu.ucar/cdm

/**
 * Open existing file, and populate ncfile with it. This method is only
 * called by the NetcdfFile constructor on itself. The provided NetcdfFile
 * object will be empty except for the location String and the
 * IOServiceProvider associated with this NetcdfFile object.
 *
 * @param raf        the file to work on, it has already passed the
 *                   isValidFile() test.
 * @param ncfile     add objects to this empty NetcdfFile
 * @param cancelTask used to monitor user cancellation; may be null.
 * @throws IOException if read error
 */
public void open(RandomAccessFile raf, NetcdfFile ncfile, CancelTask cancelTask) throws IOException {
 super.open(raf, ncfile, cancelTask);
 isExtended = checkFormat();
 isoDateFormat = new SimpleDateFormat();
 isoDateFormat.setTimeZone(java.util.TimeZone.getTimeZone("GMT"));
 isoDateFormat.applyPattern(isExtended
     ? TIME_FORMAT_EX
     : TIME_FORMAT);
 Sequence seq = makeSequence(ncfile);
 ncfile.addVariable(null, seq);
 addLightningGlobalAttributes(ncfile);
 ncfile.finish();
 sm = seq.makeStructureMembers();
 ArrayStructureBB.setOffsets(sm);
}
origin: edu.ucar/bufr

SeqIter() {
 addTime = (construct.recordStructure.findVariable(ConstructNC.TIME_NAME) != null);
 reset();
}
origin: Unidata/thredds

    "Height_of_station", "Short_station_or_site_name", "Type_of_measuring_equipment_used",
    "Time_significance", "Time_period_or_displacement", "seq1");
Assert.assertEquals(Sets.newHashSet(expectedMemberNames), Sets.newHashSet(obs.getVariableNames()));
ArraySequence obsArray = (ArraySequence) obs.read();
int obsCount = 0;
origin: Unidata/thredds

private void annotateObs(Sequence recordStructure) {
 StandardFields.StandardFieldsFromStructure extract = new StandardFields.StandardFieldsFromStructure(centerId, recordStructure);
 Formatter f = new Formatter();
 String name = extract.getFieldName(BufrCdmIndexProto.FldType.lat);
 if (name != null) f.format("%s ", name);
 name = extract.getFieldName(BufrCdmIndexProto.FldType.lon);
 if (name != null) f.format("%s ", name);
 name = extract.getFieldName(BufrCdmIndexProto.FldType.height);
 if (name != null) f.format("%s ", name);
 name = extract.getFieldName(BufrCdmIndexProto.FldType.heightAboveStation);
 if (name != null) f.format("%s ", name);
 recordStructure.addAttribute(new Attribute("coordinates", f.toString()));
}
origin: edu.ucar/netcdf

private void makeIndex(File indexFile) throws IOException {
 Vinfo stnInfo = (Vinfo) stnSeq.getSPobject();
 StructureMembers.Member m = stnInfo.sm.findMember(STNID);
 TableParser.Field f = (TableParser.Field) m.getDataObject();
 Vinfo dataInfo = (Vinfo) dataSeq.getSPobject();
 m = dataInfo.sm.findMember(STNID);
 f = (TableParser.Field) m.getDataObject();
origin: edu.ucar/cdm

Structure makeStructure(Structure parent) throws InvalidRangeException {
 Sequence seq = new Sequence(ncfile, null, parent, "otherData");
 seq.addAttribute(new Attribute(CDM.LONG_NAME, catNames[8]));
 int pos = 0;
 Variable v = seq.addMemberVariable(new Variable(ncfile, null, parent, "data", DataType.INT, ""));
 v.addAttribute(new Attribute(CDM.LONG_NAME, "additional data specified in table 101.1"));
 v.addAttribute(new Attribute(_Coordinate.AxisType, AxisType.Pressure.toString()));
 v.setSPobject(new Vinfo(pos));
 pos += 4;
 v = seq.addMemberVariable(new Variable(ncfile, null, parent, "table101code", DataType.SHORT, ""));
 v.addAttribute(new Attribute(CDM.LONG_NAME, "code figure from table 101"));
 v.addAttribute(new Attribute(CDM.MISSING_VALUE, (short) 999));
 v.setSPobject(new Vinfo(pos));
 pos += 2;
 v = seq.addMemberVariable(new Variable(ncfile, null, parent, "indicatorFlags", DataType.CHAR, ""));
 v.setDimensionsAnonymous(new int[]{2});
 v.addAttribute(new Attribute(CDM.LONG_NAME, "quality marks: 0=data, 1=form"));
 v.setSPobject(new Vinfo(pos));
 return seq;
}
origin: edu.ucar/cdm

static Structure decodeStructure(NetcdfFile ncfile, Group g, Structure parent, NcStreamProto.Structure s) {
 Structure ncvar = (s.getDataType() == ucar.nc2.stream.NcStreamProto.DataType.SEQUENCE) ?
     new Sequence(ncfile, g, parent, s.getName()) : new Structure(ncfile, g, parent, s.getName());
 ncvar.setDataType(decodeDataType(s.getDataType()));
 List<Dimension> dims = new ArrayList<Dimension>(6);
 for (ucar.nc2.stream.NcStreamProto.Dimension dim : s.getShapeList()) {
  Dimension ncdim = decodeDim(dim);
  if (!ncdim.isShared())
   dims.add(ncdim);
  else {
   Dimension d = g.findDimension(ncdim.getShortName());
   if (d == null)
    throw new IllegalStateException("Can find shared dimension " + dim.getName());
   dims.add(d);
  }
 }
 ncvar.setDimensions(dims);
 for (ucar.nc2.stream.NcStreamProto.Attribute att : s.getAttsList())
  ncvar.addAttribute(decodeAtt(att));
 for (ucar.nc2.stream.NcStreamProto.Variable vp : s.getVarsList())
  ncvar.addMemberVariable(decodeVar(ncfile, g, ncvar, vp));
 for (NcStreamProto.Structure sp : s.getStructsList())
  ncvar.addMemberVariable(decodeStructure(ncfile, g, ncvar, sp));
 return ncvar;
}
origin: Unidata/thredds

protected Sequence makeSequence(NetcdfFile ncfile) {
 Sequence seq = new Sequence(ncfile, null, null, RECORD);
     "time of stroke", null,
     secondsSince1970, AxisType.Time);
 seq.addMemberVariable(v);
 seq.addMemberVariable(v);
 seq.addMemberVariable(v);
 seq.addMemberVariable(v);
      "error ellipse semi-major axis", null,
      "km", null);
  seq.addMemberVariable(v);
      "error ellipse minor axis ", null,
      "km", null);
  seq.addMemberVariable(v);
      "error ellipse axis angle of orientation ", null, "degrees",
      null);
  seq.addMemberVariable(v);
      "multiplicity [#strokes per flash]",
      null, "", null);
  seq.addMemberVariable(v);
origin: Unidata/thredds

members = seq.makeStructureMembers();
for (StructureMembers.Member m : members.getMembers()) {
 m.setDataParam(offset);
 Variable mv = seq.findVariable(m.getName());
 BufrConfig.FieldConverter fld = (BufrConfig.FieldConverter) mv.getSPobject();
 DataDescriptor dk = fld.dds;
origin: edu.ucar/netcdf

public Sequence(NetcdfFile ncfile, Group group, Structure parent, String shortName) {
 super(ncfile, group, parent, shortName);
 List<Dimension> dims = new ArrayList<Dimension>();
 dims.add(Dimension.VLEN);
 setDimensions(dims);
 setDataType(DataType.SEQUENCE);
}
ucar.nc2Sequence

Javadoc

Sequence is a one-dimensional Structure with indeterminate length. The only data access is through getStructureIterator(). However, read() will read in the entire data and return an ArraySequence.

Most used methods

  • getStructureIterator
  • <init>
  • findVariable
  • makeStructureMembers
  • setDimensions
  • setSPobject
  • addAttribute
  • addMemberVariable
  • read
    UnsupportedOperation
  • getSPobject
  • setDataType
  • getVariableNames
  • setDataType,
  • getVariableNames

Popular in Java

  • Running tasks concurrently on multiple threads
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • runOnUiThread (Activity)
  • getResourceAsStream (ClassLoader)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Join (org.hibernate.mapping)
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now