當前位置: 首頁>>代碼示例>>Java>>正文


Java CF類代碼示例

本文整理匯總了Java中ucar.nc2.constants.CF的典型用法代碼示例。如果您正苦於以下問題:Java CF類的具體用法?Java CF怎麽用?Java CF使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


CF類屬於ucar.nc2.constants包,在下文中一共展示了CF類的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: IoosSosObservation

import ucar.nc2.constants.CF; //導入依賴的package包/類
public IoosSosObservation(CF.FeatureType featureType, TimePeriod samplingTime,
        Map<SensorAsset, ? extends AbstractSensorDataset> sensorDatasetMap,
        Set<OmObservableProperty> phenomena, Envelope envelope,
        HashMap<StationAsset,Point> stationPoints, SetMultimap<SensorAsset,Double> sensorHeights ) {
    super();
    this.featureType = featureType;
    this.samplingTime = samplingTime;
    this.sensorDatasetMap = sensorDatasetMap;
    this.phenomena = phenomena;
    this.envelope = envelope;
    this.stationPoints = stationPoints;
    this.sensorHeights = sensorHeights;

    //process datasets into lookup maps by station
    for (SensorAsset sensor : sensorDatasetMap.keySet()) {
        stationSensors.put(sensor.getStationAsset(), sensor);
    }
}
 
開發者ID:ioos,項目名稱:i52n-sos,代碼行數:19,代碼來源:IoosSosObservation.java

示例2: TimeSeriesSensorDataset

import ucar.nc2.constants.CF; //導入依賴的package包/類
public TimeSeriesSensorDataset( SensorAsset sensor, Double lng, Double lat, Double alt, 
        Map<Time, Map<OmObservableProperty, Map<SubSensor, Value<?>>>> dataValues) {        
    super( CF.FeatureType.timeSeries, sensor, dataValues);
    this.lng = lng;
    this.lat = lat;
    this.alt = alt;
}
 
開發者ID:ioos,項目名稱:i52n-sos,代碼行數:8,代碼來源:TimeSeriesSensorDataset.java

示例3: AbstractSensorDataset

import ucar.nc2.constants.CF; //導入依賴的package包/類
public AbstractSensorDataset( CF.FeatureType featureType, SensorAsset sensor,
        Map<Time,Map<OmObservableProperty,Map<SubSensor,Value<?>>>> dataValues){
    this.featureType = featureType;
    this.sensor = sensor;
    //make the sensorDataValues unmodifiable, since some data summaries will be made below and we don't want the data changing
    this.dataValues = Collections.unmodifiableMap(dataValues);

    //set times, phenomena, and subsensors
    Set<Time> timeSet = Sets.newHashSet();
    Set<OmObservableProperty> obsPropSet = Sets.newHashSet();
    Set<SubSensor> subSensorSet = Sets.newHashSet();
    for( Entry<Time,Map<OmObservableProperty, Map<SubSensor,Value<?>>>> dataValuesEntry : dataValues.entrySet() ){
        Time time = dataValuesEntry.getKey();
        timeSet.add(time);
        for( Map.Entry<OmObservableProperty, Map<SubSensor,Value<?>>> phenObsEntry : dataValuesEntry.getValue().entrySet() ){
            OmObservableProperty phen = phenObsEntry.getKey();                    
            Set<SubSensor> phenSubSensors = phenObsEntry.getValue().keySet();                
            obsPropSet.add(phen);                
            for (SubSensor subSensor : phenSubSensors) {
                if (subSensor != null) {
                    subSensorSet.add(subSensor);
                }
            }                    
        }
    }

    List<Time> timeList = Lists.newArrayList(timeSet);
    Collections.sort(timeList);
    times = Collections.unmodifiableList(timeList);

    List<OmObservableProperty> obsPropList = Lists.newArrayList(obsPropSet);
    Collections.sort(obsPropList);
    obsProps = Collections.unmodifiableList(obsPropList);

    List<SubSensor> subSensorList = Lists.newArrayList(subSensorSet);
    Collections.sort(subSensorList);
    subSensors = Collections.unmodifiableList(subSensorList);
}
 
開發者ID:ioos,項目名稱:i52n-sos,代碼行數:39,代碼來源:AbstractSensorDataset.java

示例4: getNodcTemplateVersion

import ucar.nc2.constants.CF; //導入依賴的package包/類
private String getNodcTemplateVersion(CF.FeatureType featureType) throws CodedException{
    if (featureType.equals(CF.FeatureType.timeSeries)) {
        return NODCConstants.NODC_TIMESERIES_ORTHOGONAL_TEMPLATE_1_0;
    } else if (featureType.equals(CF.FeatureType.timeSeriesProfile)) {
        return NODCConstants.NODC_TIMESERIESPROFILE_ORTHOGONAL_TEMPLATE_1_0;
    }
    throw new NoApplicableCodeException().withMessage("Feature type " + featureType.name()
            + " is not supported for netCDF output");
}
 
開發者ID:ioos,項目名稱:i52n-sos,代碼行數:10,代碼來源:AbstractIoosNetcdfEncoder.java

示例5: getCfRole

import ucar.nc2.constants.CF; //導入依賴的package包/類
private String getCfRole(CF.FeatureType featureType) throws CodedException {
    if (featureType.equals(CF.FeatureType.timeSeries)) {
        return CF.TIMESERIES_ID;
    } else if (featureType.equals(CF.FeatureType.timeSeriesProfile)) {
        return CF.TIMESERIES_ID;
    } else if (featureType.equals(CF.FeatureType.trajectory) || featureType.equals(CF.FeatureType.trajectoryProfile)) {
        return CF.TRAJECTORY_ID;
    } else {
        throw new NoApplicableCodeException().withMessage("Feature type " + featureType.name()
                + " is not supported for netCDF output");
    }
}
 
開發者ID:ioos,項目名稱:i52n-sos,代碼行數:13,代碼來源:AbstractIoosNetcdfEncoder.java

示例6: isZPositive

import ucar.nc2.constants.CF; //導入依賴的package包/類
private boolean isZPositive(CoordinateAxis1D zAxis) {
    if (zAxis == null)
        return false;
    if (zAxis.getPositive() != null) {
        return zAxis.getPositive().equalsIgnoreCase(CF.POSITIVE_UP);
    }
    if (zAxis.getAxisType() == AxisType.Height)
        return true;
    return zAxis.getAxisType() != AxisType.Pressure;
}
 
開發者ID:Reading-eScience-Centre,項目名稱:edal-java,代碼行數:11,代碼來源:CdmGridDatasetFactory.java

示例7: TrajectoryProfileSensorDataset

import ucar.nc2.constants.CF; //導入依賴的package包/類
public TrajectoryProfileSensorDataset( SensorAsset sensor,  
        Map<Time, Map<OmObservableProperty, Map<SubSensor, Value<?>>>> dataValues) {        
    super( CF.FeatureType.trajectoryProfile, sensor, dataValues);
}
 
開發者ID:ioos,項目名稱:i52n-sos,代碼行數:5,代碼來源:TrajectoryProfileSensorDataset.java

示例8: getFeatureType

import ucar.nc2.constants.CF; //導入依賴的package包/類
public CF.FeatureType getFeatureType() {
    return featureType;
}
 
開發者ID:ioos,項目名稱:i52n-sos,代碼行數:4,代碼來源:AbstractSensorDataset.java

示例9: TimeSeriesProfileSensorDataset

import ucar.nc2.constants.CF; //導入依賴的package包/類
public TimeSeriesProfileSensorDataset( SensorAsset sensor, Double lng, Double lat, 
        Map<Time, Map<OmObservableProperty, Map<SubSensor, Value<?>>>> dataValues) {        
    super( CF.FeatureType.timeSeriesProfile, sensor, dataValues);
    this.lng = lng;
    this.lat = lat;
}
 
開發者ID:ioos,項目名稱:i52n-sos,代碼行數:7,代碼來源:TimeSeriesProfileSensorDataset.java

示例10: TrajectorySensorDataset

import ucar.nc2.constants.CF; //導入依賴的package包/類
public TrajectorySensorDataset( SensorAsset sensor, Double alt, 
        Map<Time, Map<OmObservableProperty, Map<SubSensor, Value<?>>>> dataValues) {        
    super( CF.FeatureType.trajectory, sensor, dataValues);
    this.alt = alt;
}
 
開發者ID:ioos,項目名稱:i52n-sos,代碼行數:6,代碼來源:TrajectorySensorDataset.java

示例11: createSensor

import ucar.nc2.constants.CF; //導入依賴的package包/類
private static void createSensor(int i, CF.FeatureType featureType, Offering hNetworkOffering, Procedure networkProcedure,
        Offering hStationOffering, Procedure stationProcedure, StationAsset station, SamplingFeature samplingFeature,
        FeatureOfInterest hStationFeature, Point stationPoint, Phenomenon phen,
        OmObservableProperty omObsProp, ObservableProperty obsProp, String unit, ObservationType obsType, ProcedureDescriptionFormat pdf,
        Map<String,Codespace> codespaceCache, Map<String,Unit> unitCache, Session session) throws OwsExceptionReport {
    String phenShortName = getPhenomenonShortId(phen.getId());
    final SimpleIo airTempSimpleIo = new SimpleIo(phenShortName, phen.getId(), unit);
    final SensorAsset sensor = new SensorAsset(TEST, Integer.toString(i), phenShortName);
    final String sensorSml = IoosTestDataSmlGenerator.createSensorSensorMl(sensor.getAssetId(),
            "Test station " + i + " " + phen.getName() + " sensor",
            "Test station " + i + " " + phen.getName() + " sensor",
            "Station number " + i + " " + phen.getName() + " sensor",
            CollectionHelper.list(airTempSimpleIo));

    //TODO switch to manually build System instead of making xml
    //TODO decode xml
    Object decodedXml = CodingHelper.decodeXmlObject(sensorSml);
    org.n52.sos.ogc.sensorML.System sensorSystem = new org.n52.sos.ogc.sensorML.System();
    sensorSystem.setIdentifier(sensor.getAssetId());
    sensorSystem.setParentProcedures(CollectionHelper.list(station.getAssetId()));
    final Procedure sensorProcedure = insertProcedure(sensorSystem, pdf, sensorSml, session);

    Set<ObservationConstellation> obsConsts = new HashSet<ObservationConstellation>();
    Set<ObservationConstellation> sensorObsConsts = new HashSet<ObservationConstellation>();

    // when offering and procedure are same hiddenChild is false, otherwise true
    ObservationConstellation sensorForNetworkOffering = obsConstDAO.checkOrInsertObservationConstellation(
            sensorProcedure, obsProp, hNetworkOffering, true, session);
    obsConsts.add(sensorForNetworkOffering);
    sensorObsConsts.add(sensorForNetworkOffering);

    obsConsts.add(obsConstDAO.checkOrInsertObservationConstellation(stationProcedure,
            obsProp, hNetworkOffering, true, session));
    obsConsts.add(obsConstDAO.checkOrInsertObservationConstellation(networkProcedure,
            obsProp, hNetworkOffering, false, session));

    ObservationConstellation sensorForStationOffering = obsConstDAO.checkOrInsertObservationConstellation(
            sensorProcedure, obsProp, hStationOffering, true, session);
    obsConsts.add(sensorForStationOffering);
    sensorObsConsts.add(sensorForStationOffering);

    obsConsts.add(obsConstDAO.checkOrInsertObservationConstellation(stationProcedure,
            obsProp, hStationOffering, false, session));

    //set measurement types on sesnor obs consts
    for (ObservationConstellation obsConst : sensorObsConsts) {
        obsConst.setObservationType(obsType);
        session.save(obsConst);
    }

    //create OmObservationConstellation for OmObservations
    OmObservationConstellation omObsConst = new OmObservationConstellation();
    omObsConst.setProcedure(sensorSystem);
    omObsConst.setObservableProperty(omObsProp);
    omObsConst.setFeatureOfInterest(samplingFeature);

    //add values
    DateTime obsEndTime = new DateTime(DateTimeZone.UTC).withMillisOfSecond(0).withSecondOfMinute(0).withMinuteOfHour(0);
    if (featureType.equals(CF.FeatureType.timeSeriesProfile)) {
        for (int h = 0; h < NUM_HEIGHTS_PER_PROFILE; h++) {
            Geometry foiGeom = GeomHelper.createLatLngPoint(stationPoint.getY(), stationPoint.getX(), 0 - 5.0 * h);
            String foiId;
            try {
                foiId = IoosSosUtil.createObservationFeatureOfInterestId(station, stationPoint, sensor, stationPoint, foiGeom);
            } catch (UnsupportedGeometryTypeException e) {
                throw new NoApplicableCodeException().causedBy(e);
            }
            SamplingFeature profileFeature = new SamplingFeature(new CodeWithAuthority(foiId));
            profileFeature.setGeometry(foiGeom);
            FeatureOfInterest hProfileFeature = featureOfInterestDAO.checkOrInsertFeatureOfInterest(profileFeature, session);
            insertObservation(sensorObsConsts, omObsConst, obsEndTime, hProfileFeature, unit, codespaceCache, unitCache, session);
        }
    } else {
        //normal time series
        insertObservation(sensorObsConsts, omObsConst, obsEndTime, hStationFeature, unit, codespaceCache, unitCache, session);
    }
}
 
開發者ID:ioos,項目名稱:i52n-sos,代碼行數:78,代碼來源:IoosHibernateTestDataManager.java


注:本文中的ucar.nc2.constants.CF類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。