当前位置: 首页>>代码示例>>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;未经允许,请勿转载。