Search in sources :

Example 1 with Temperature

use of org.tensorics.core.examples.meteo.domain.Temperature in project tensorics-core by tensorics.

the class WeatherHistoryInEurope method calculate.

// tag::import[]
/*
     * calculate an average monthly temperature at the ROME Latitude like cities
     */
@SuppressWarnings("unused")
public void calculate() {
    Tensor<QuantifiedValue<Double>> importedData = importDataForCities();
    Latitude romeLatitude = EuropeanCapital.ROMA.getLatitude();
    Tensor<QuantifiedValue<Double>> sliceAtTropicCancerAndRome = from(importedData).extract(romeLatitude);
    Temperature temperature = new Temperature(importedData);
    Tensor<QuantifiedValue<Double>> elementTimes = calculateQ(importedData).elementTimes(importedData);
    Temperature elementTimes2 = calculateQ(temperature).elementTimes(temperature);
    /* dimension will be reduced to only Longitude and Time */
    sliceAtTropicCancerAndRome.shape().dimensionSet();
    // 
    // from(sliceAtTropicCancerAndRome).reduce(Time.class).byAveragingIn(field)
    TensoricSupport<Double> fullTensoricSupport = Tensorics.using(Structures.doubles());
}
Also used : Temperature(org.tensorics.core.examples.meteo.domain.Temperature) Latitude(org.tensorics.core.examples.meteo.domain.coordinates.Latitude) QuantifiedValue(org.tensorics.core.quantity.QuantifiedValue)

Aggregations

Temperature (org.tensorics.core.examples.meteo.domain.Temperature)1 Latitude (org.tensorics.core.examples.meteo.domain.coordinates.Latitude)1 QuantifiedValue (org.tensorics.core.quantity.QuantifiedValue)1