Handle new grib2 packaging format.
LocationBasedServices/mowesta/pipeline/head This commit looks good

This commit is contained in:
Marcus Handte
2026-07-30 19:06:43 +02:00
parent a954034c72
commit ec384792fa
4 changed files with 703 additions and 724 deletions
+1 -1
View File
@@ -61,7 +61,7 @@ allprojects {
// locoslab libraries and code
versionGeometry = '1.4.0'
versionCarta = '1.3.0'
versionGrib2 = '1.0.1'
versionGrib2 = '1.0.2'
versionAuth = '1.1.0'
// tools
versionCli = '1.4'
File diff suppressed because it is too large Load Diff
@@ -25,17 +25,17 @@ public class VideoGeneratorExample {
* @throws IOException Thrown if the files cannot be read.
*/
public static void main(String[] args) throws IOException {
Time time = new Time(2024, 3, 12);
Time time = new Time(2026, 7, 29);
NumericPrediction[] predictions = new NumericPrediction[] {
// new NumericPrediction(PredictionType.ICON_GLOBAL, new File("/Users/marcus/Data/mowesta/test")),
// new NumericPrediction(PredictionType.ICON_GLOBAL, new File("dwd-data/global")),
new NumericPrediction(PredictionType.COSMO_EUROPE, new File("dwd-data/germany")),
// new NumericPrediction(PredictionType.ICON_EUROPE, new File("dwd-data/eu"))
// new NumericPrediction(PredictionType.ICON_EUROPE, new File("dwd-data/eu"))
};
String[] prefixes = new String[] {
// "global",
"global",
"germany",
// "europe"
"europe"
};
for (NumericPrediction prediction: predictions) {
if (!prediction.isAvailable(time)) {
@@ -48,7 +48,7 @@ public class VideoGeneratorExample {
if (p.isAvailable(time)) {
VideoGenerator videoGenerator = new VideoGenerator(p, c.createComposer(time));
long start = System.currentTimeMillis();
Variable variable = Variable.CLCT;
Variable variable = Variable.PMSL;
String name = "video-" + prefixes[i] + "-" + variable.getFolder();
videoGenerator.createVideo(variable, time, 8, 10, new File(name + ".mp4"), new File(name + ".jpg"), (kfr, ifr) -> {
System.out.println("Key: " + kfr + " Int:" + ifr);
@@ -19,8 +19,9 @@ import java.util.logging.Level;
import com.locoslab.library.grib2.Grib2Data;
import com.locoslab.library.grib2.Grib2File;
import com.locoslab.library.grib2.data.DoubleArray;
import com.locoslab.library.grib2.decoder.SimpleDataDecoder;
import com.locoslab.library.grib2.decoder.SimpleStreamDecoder;
import com.locoslab.library.grib2.decoder.Decoder;
import com.locoslab.library.grib2.decoder.CcsdsDataDecoder;
import com.mowesta.api.Coordinate;
import com.mowesta.api.weather.SoilType;
import com.mowesta.api.weather.WeatherCondition;
@@ -279,7 +280,7 @@ public class WeatherForecastSyncSessionBean extends AbstractSyncSessionBean {
try {
Grib2Data data = grib2.nextData();
hours.add(hour);
SimpleDataDecoder decoder = new SimpleDataDecoder(data);
Decoder decoder = new CcsdsDataDecoder(data);
IDataSource ds = new Grib2MixedSource(longitudes, latitudes, new SimpleStreamDecoder(decoder));
prepareData(v, hour, ds);
counter += 1;