public void writeProfileData(ProfileFeature profile, int nobs) throws IOException { trackBB(profile.getLatLon(), profile.getTime()); StructureDataScalar profileCoords = new StructureDataScalar("Coords"); profileCoords.addMember(latName, null, null, DataType.DOUBLE, profile.getLatLon().getLatitude()); profileCoords.addMember(lonName, null, null, DataType.DOUBLE, profile.getLatLon().getLongitude()); if (profile.getTime() != null) // LOOK time not always part of profile profileCoords.addMember(profileTimeName, null, null, DataType.DOUBLE, timeUnit.makeOffsetFromRefDate(profile.getTime())); profileCoords.addMemberString(profileIdName, null, null, profile.getName().trim(), id_strlen); profileCoords.addMember(numberOfObsName, null, null, DataType.INT, nobs); StructureData profileData = profile.getFeatureData(); StructureDataComposite sdall = new StructureDataComposite(); sdall.add(profileCoords); // coords first so it takes precedence sdall.add(profileData); profileRecno = super.writeStructureData(profileRecno, profileStruct, sdall, featureVarMap); }
public int writeProfile (ProfileFeature profile) throws IOException { profile.resetIteration(); int count = 0; while (profile.hasNext()) { PointFeature pf = profile.next(); if (!headerDone) { if (id_strlen == 0) id_strlen = profile.getName().length() * 2; writeHeader(profile, pf); headerDone = true; } writeObsData(pf); count++; } writeProfileData(profile, count); return count; }
@Override public List<CalendarDate> getTimes() throws IOException { List<CalendarDate> result = new ArrayList<>(); for (ProfileFeature pf : this) { result.add(pf.getTime()); } return result; }
else { for (ProfileFeature profile : spf) { prof_strlen = Math.max(prof_strlen, profile.getName().length()); countProfiles++; for (TrajectoryProfileFeature spf : fc) { for (ProfileFeature profile : spf) { if (profile.getTime() == null) continue; // assume this means its a "incomplete multidimensional"
public boolean filter(PointFeatureCollection pointFeatureCollection) { ProfileFeature profileFeature = (ProfileFeature) pointFeatureCollection; return boundingBox.contains(profileFeature.getLatLon()); } }
public int writeProfile (ProfileFeature profile) throws IOException { int count = 0; for (PointFeature pf : profile) { if (!headerDone) { if (id_strlen == 0) id_strlen = profile.getName().length() * 2; writeHeader(profile, pf); headerDone = true; } writeObsData(pf); count++; } writeProfileData(profile, count); return count; }
private void writeHeader(ProfileFeature profile, PointFeature obs) throws IOException { Formatter coordNames = new Formatter().format("%s %s %s", profileTimeName, latName, lonName); List<VariableSimpleIF> coords = new ArrayList<>(); if (useAlt) { coords.add( VariableSimpleImpl.makeScalar(altitudeCoordinateName, "obs altitude", altUnits, DataType.DOUBLE) .add(new Attribute(CF.STANDARD_NAME, "altitude")) .add(new Attribute(CF.POSITIVE, CF1Convention.getZisPositive(altitudeCoordinateName, altUnits)))); coordNames.format(" %s", altitudeCoordinateName); } super.writeHeader(coords, profile.getFeatureData(), obs.getFeatureData(), coordNames.toString()); }
public boolean filter(PointFeatureCollection pointFeatureCollection) { ProfileFeature profileFeature = (ProfileFeature) pointFeatureCollection; return boundingBox.contains(profileFeature.getLatLon()); } }
public int writeProfile (StationProfileFeature spf, ProfileFeature profile) throws IOException { int count = 0; for (PointFeature pf : profile) { if (!headerDone) { if (id_strlen == 0) id_strlen = profile.getName().length() * 2; writeHeader(spf, profile, pf); headerDone = true; } writeObsData(pf); count++; } Integer stnIndex = stationIndexMap.get(spf.getName()); if (stnIndex == null) { System.out.printf("BAD station %s%n", spf.getName()); } else { writeProfileData(stnIndex, profile, count); } return count; }
private void writeHeader(ProfileFeature profile, PointFeature obs) throws IOException { Formatter coordNames = new Formatter().format("%s %s %s", profileTimeName, latName, lonName); List<VariableSimpleIF> coords = new ArrayList<>(); if (useAlt) { coords.add( VariableSimpleImpl.makeScalar(altitudeCoordinateName, "obs altitude", altUnits, DataType.DOUBLE) .add(new Attribute(CF.STANDARD_NAME, "altitude")) .add(new Attribute(CF.POSITIVE, CF1Convention.getZisPositive(altitudeCoordinateName, altUnits)))); coordNames.format(" %s", altitudeCoordinateName); } super.writeHeader(coords, profile.getFeatureData(), obs.getFeatureData(), coordNames.toString()); }
public void writeProfileData(ProfileFeature profile, int nobs) throws IOException { trackBB(profile.getLatLon(), CalendarDate.of(profile.getTime())); StructureDataScalar profileCoords = new StructureDataScalar("Coords"); profileCoords.addMember(latName, null, null, DataType.DOUBLE, false, profile.getLatLon().getLatitude()); profileCoords.addMember(lonName, null, null, DataType.DOUBLE, false, profile.getLatLon().getLongitude()); if (profile.getTime() != null) profileCoords.addMember(profileTimeName, null, null, DataType.DOUBLE, false, timeUnit.makeValue(profile.getTime())); // LOOK time not always part of profile profileCoords.addMemberString(profileIdName, null, null, profile.getName().trim(), id_strlen); profileCoords.addMember(numberOfObsName, null, null, DataType.INT, false, nobs); StructureData profileData = profile.getFeatureData(); StructureDataComposite sdall = new StructureDataComposite(); sdall.add(profileCoords); // coords first so it takes precedence sdall.add(profileData); profileRecno = super.writeStructureData(profileRecno, profileStruct, sdall, featureVarMap); }
public int writeProfile (StationProfileFeature spf, ProfileFeature profile) throws IOException { profile.resetIteration(); int count = 0; while (profile.hasNext()) { PointFeature pf = profile.next(); if (!headerDone) { if (id_strlen == 0) id_strlen = profile.getName().length() * 2; writeHeader(spf, profile, pf); headerDone = true; } writeObsData(pf); count++; } Integer stnIndex = stationIndexMap.get(spf.getName()); if (stnIndex == null) { System.out.printf("BAD station %s%n", spf.getName()); } else { writeProfileData(stnIndex, profile, count); } return count; }
@Override public ProfileFeature getProfileByDate(CalendarDate date) throws IOException { for (ProfileFeature pf : this) { if (pf.getTime().equals(date)) return pf; } return null; }
public boolean filter(PointFeatureCollection pointFeatureCollection) { ProfileFeature profileFeature = (ProfileFeature) pointFeatureCollection; return boundingBox.contains(profileFeature.getLatLon()); } }
public int writeProfile (TrajectoryProfileFeature section, ProfileFeature profile) throws IOException { int count = 0; for (PointFeature pf : profile) { if (!headerDone) { if (id_strlen == 0) id_strlen = profile.getName().length() * 2; writeHeader(section, profile, pf); headerDone = true; } writeObsData(pf); count++; } Integer sectionIndex = trajIndexMap.get(section.getName()); if (sectionIndex == null) { sectionIndex = writeSectionData(section); trajIndexMap.put(section.getName(), sectionIndex); } writeProfileData(sectionIndex, profile, count); return count; }
private void writeHeader(SectionFeature section, ProfileFeature profile, PointFeature obs) throws IOException { StructureData sectionData = section.getFeatureData(); StructureData profileData = profile.getFeatureData(); StructureData obsData = obs.getFeatureData(); Formatter coordNames = new Formatter().format("%s %s %s", profileTimeName, latName, lonName); List<VariableSimpleIF> obsCoords = new ArrayList<>(); if (useAlt) { obsCoords.add( VariableSimpleImpl.makeScalar(altitudeCoordinateName, "obs altitude", altUnits, DataType.DOUBLE) .add(new Attribute(CF.STANDARD_NAME, "altitude")) .add(new Attribute(CF.POSITIVE, CF1Convention.getZisPositive(altitudeCoordinateName, altUnits)))); coordNames.format(" %s", altitudeCoordinateName); } super.writeHeader2(obsCoords, sectionData, profileData, obsData, coordNames.toString()); }
public void writeProfileData(int stnIndex, ProfileFeature profile, int nobs) throws IOException { trackBB(profile.getLatLon(), CalendarDate.of(profile.getTime())); StructureDataScalar profileCoords = new StructureDataScalar("Coords"); profileCoords.addMember(latName, null, null, DataType.DOUBLE, false, profile.getLatLon().getLatitude()); profileCoords.addMember(lonName, null, null, DataType.DOUBLE, false, profile.getLatLon().getLongitude()); //Date date = (profile.getTime() != null) ? (double) profile.getTime().getTime() : 0.0; // LOOK (profile.getTime() != null) ??? double timeInMyUnits = timeUnit.makeValue(profile.getTime()); profileCoords.addMember(profileTimeName, null, null, DataType.DOUBLE, false, timeInMyUnits); // LOOK time not always part of profile profileCoords.addMemberString(profileIdName, null, null, profile.getName().trim(), id_strlen); profileCoords.addMember(numberOfObsName, null, null, DataType.INT, false, nobs); profileCoords.addMember(stationIndexName, null, null, DataType.INT, false, stnIndex); StructureDataComposite sdall = new StructureDataComposite(); sdall.add(profileCoords); // coords first so it takes precedence sdall.add(profile.getFeatureData()); profileRecno = super.writeStructureData(profileRecno, profileStruct, sdall, profileVarMap); }
public int writeProfile (SectionFeature section, ProfileFeature profile) throws IOException { profile.resetIteration(); int count = 0; while (profile.hasNext()) { PointFeature pf = profile.next(); if (!headerDone) { if (id_strlen == 0) id_strlen = profile.getName().length() * 2; writeHeader(section, profile, pf); headerDone = true; } writeObsData(pf); count++; } Integer sectionIndex = trajIndexMap.get(section.getName()); if (sectionIndex == null) { sectionIndex = writeSectionData(section); trajIndexMap.put(section.getName(), sectionIndex); } writeProfileData(sectionIndex, profile, count); return count; }