Codota Logo
Sequence
Code IndexAdd Codota 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)

  • Common ways to obtain Sequence
private void myMethod () {
Sequence s =
  • Codota IconNetcdfFile ncfile;String fullNameEscaped;(Sequence) ncfile.findVariable(fullNameEscaped)
  • Codota IconNetcdfFile ncfile;String shortName;new Sequence(ncfile, null, null, shortName)
  • Codota IconNetcdfFile ncfile;Structure parent;String str;new Sequence(ncfile, null, parent, str)
  • Smart code suggestions by Codota
}
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

  • Start an intent from android
  • setContentView (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • addToBackStack (FragmentTransaction)
  • FileWriter (java.io)
    Convenience class for writing character files. The constructors of this class assume that the defaul
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate(i
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now