diff --git a/.gitignore b/.gitignore index e7682aa5..b4514214 100644 --- a/.gitignore +++ b/.gitignore @@ -1,35 +1,3 @@ -# Java related -target/** -*.jar -*.war -*.ear -*.class - -# eclipse specific -*.pydevproject -.project -.metadata -bin/** -tmp/** -tmp/**/* -*.tmp -*.bak -*.swp -*~.nib -local.properties -.classpath -.settings/ -.loadpath - -# External tool builders -.externalToolBuilders/ - -# Locally stored "Eclipse launch configurations" -*.launch -/.gradle/ -*/.gradle/ -/build/ - # VSCode .vscode diff --git a/README.md b/README.md index 40341ac5..6ac35ef1 100644 --- a/README.md +++ b/README.md @@ -43,17 +43,6 @@ From the IDSS Engine project root directory `idss-engine/build///`: > **Image Name** `idsse/commons/python-base-sci:` -### Java Base Image ---- -Any java based microservices within IDSS Engine should use the following image as its base - -#### Build -From the IDSS Engine project root directory `idss-engine/build///`: - -`$ docker-compose build java_base` - -> **Image Name** `idsse/commons/java-base:` - ### RabbitMQ Server --- The IDSS Engine can be deployed with Docker and/or Kubernetes. If developers are deploying locally with Docker, they diff --git a/docker/java/Dockerfile b/docker/java/Dockerfile deleted file mode 100644 index 44fa3fcb..00000000 --- a/docker/java/Dockerfile +++ /dev/null @@ -1,34 +0,0 @@ -# Conda base image -FROM continuumio/miniconda3:4.10.3-alpine - -ARG maintainer - -LABEL maintainer "${maintainer}" - -# Setup conda ENV -ENV CONDA_DIR /opt/conda -ENV PATH $CONDA_DIR/bin:$PATH -ENV SHELL /bin/bash -ENV LC_ALL en_US.UTF-8 -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US.UTF-8 - -# Install core dependencies -RUN conda config --add channels conda-forge && \ - conda install \ - openjdk=8 \ - pillow=9.3.0 \ - numpy=1.22.3 \ - netcdf4=1.6.2 \ - h5netcdf=1.1.0 \ - awscli=1.27.60 && \ - conda clean -y --all - -# Get the latest package updates to keep security vulnerabilities down -RUN apk update && apk upgrade -# Install any specific packages via apk (alpine package keeper) -#RUN apk add --no-cache \ -# apk-tools=2.12.7-r0 - -# Get the latest package updates to keep security vulnerabilties down -RUN pip install --upgrade wheel setuptools \ No newline at end of file diff --git a/java/.gitignore b/java/.gitignore deleted file mode 100644 index 84c048a7..00000000 --- a/java/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build/ diff --git a/java/bin/.gitignore b/java/bin/.gitignore deleted file mode 100644 index 7eed456b..00000000 --- a/java/bin/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/main/ -/test/ diff --git a/java/build.gradle b/java/build.gradle deleted file mode 100644 index d3b01cc5..00000000 --- a/java/build.gradle +++ /dev/null @@ -1,48 +0,0 @@ -group = 'gov.noaa.gsl.idssEngine' -apply plugin: 'eclipse' - -apply plugin: 'java' -apply plugin: 'eclipse' -apply plugin: 'maven-publish' - -version = '1.0' -sourceCompatibility = 1.8 -targetCompatibility = 1.8 - -repositories { - maven { - url uri("${projectDir}/libs") - } - maven { url "https://repo.maven.apache.org/maven2" } - maven { url "https://repo1.maven.org/maven2/" } -} - -description = 'commons' -dependencies { - implementation 'joda-time:joda-time:2.1' - implementation 'org.locationtech.jts:jts-core:1.16.0' - implementation 'org.apache.commons:commons-math:2.2' - implementation 'org.json:json:20201115' - implementation 'com.rabbitmq:amqp-client:5.12.0' - implementation 'gov.noaa.gsd.fiqas:cartography:1.1' - implementation 'gov.noaa.gsd.fiqas:math:1.1' - implementation 'gov.noaa.gsd.fiqas:util:1.1' - testImplementation 'org.junit.jupiter:junit-jupiter:5.8.2' -} - -test { - useJUnitPlatform() -// Include this to see standard out/err from tests -// testLogging { -// showStandardStreams = true -// } -} - -publishing { - publications { - mavenJava(MavenPublication) { - from components.java - } - } -} - diff --git a/java/build/tmp/compileJava/source-classes-mapping.txt b/java/build/tmp/compileJava/source-classes-mapping.txt deleted file mode 100644 index 618d8e48..00000000 --- a/java/build/tmp/compileJava/source-classes-mapping.txt +++ /dev/null @@ -1,48 +0,0 @@ -gov/noaa/gsl/idssEngine/commons/imsMessage/ImsEvent.java - gov.noaa.gsl.idssEngine.commons.imsMessage.ImsEvent -gov/noaa/gsl/idssEngine/commons/Logger.java - gov.noaa.gsl.idssEngine.commons.Logger - gov.noaa.gsl.idssEngine.commons.Logger$Level -gov/noaa/gsl/idssEngine/commons/aspect/Relational.java - gov.noaa.gsl.idssEngine.commons.aspect.Relational - gov.noaa.gsl.idssEngine.commons.aspect.Relational$1 -gov/noaa/gsl/idssEngine/commons/aspect/WxModel.java - gov.noaa.gsl.idssEngine.commons.aspect.WxModel -gov/noaa/gsl/idssEngine/commons/Sid.java - gov.noaa.gsl.idssEngine.commons.Sid -gov/noaa/gsl/idssEngine/commons/imsMessage/ImsResponse.java - gov.noaa.gsl.idssEngine.commons.imsMessage.ImsResponse - gov.noaa.gsl.idssEngine.commons.imsMessage.ImsResponse$ThreatPeriod -gov/noaa/gsl/idssEngine/commons/ProductType.java - gov.noaa.gsl.idssEngine.commons.ProductType -gov/noaa/gsl/idssEngine/commons/GridUtils.java - gov.noaa.gsl.idssEngine.commons.GridUtils - gov.noaa.gsl.idssEngine.commons.GridUtils$MaxInHood -gov/noaa/gsl/idssEngine/commons/aspect/Units.java - gov.noaa.gsl.idssEngine.commons.aspect.Units -gov/noaa/gsl/idssEngine/commons/aspect/WxType.java - gov.noaa.gsl.idssEngine.commons.aspect.WxType -gov/noaa/gsl/idssEngine/commons/aspect/Field.java - gov.noaa.gsl.idssEngine.commons.aspect.Field - gov.noaa.gsl.idssEngine.commons.aspect.Field$1 -gov/noaa/gsl/idssEngine/commons/imsMessage/ImsThreshold.java - gov.noaa.gsl.idssEngine.commons.imsMessage.ImsThreshold -gov/noaa/gsl/idssEngine/commons/imsMessage/ImsLocation.java - gov.noaa.gsl.idssEngine.commons.imsMessage.ImsLocation -gov/noaa/gsl/idssEngine/commons/imsMessage/ImsThresholdSet.java - gov.noaa.gsl.idssEngine.commons.imsMessage.ImsThresholdSet - gov.noaa.gsl.idssEngine.commons.imsMessage.ImsThresholdSet$1 -gov/noaa/gsl/idssEngine/commons/WbgtCalc.java - gov.noaa.gsl.idssEngine.commons.WbgtCalc -gov/noaa/gsl/idssEngine/commons/GeoCoords.java - gov.noaa.gsl.idssEngine.commons.GeoCoords - gov.noaa.gsl.idssEngine.commons.GeoCoords$GridGeoCoords - gov.noaa.gsl.idssEngine.commons.GeoCoords$GridGeoCoords$GridIterator - gov.noaa.gsl.idssEngine.commons.GeoCoords$ListsIterator -gov/noaa/gsl/idssEngine/commons/UnitsConversion.java - gov.noaa.gsl.idssEngine.commons.UnitsConversion - gov.noaa.gsl.idssEngine.commons.UnitsConversion$1 -gov/noaa/gsl/idssEngine/commons/imsMessage/ImsEventReader.java - gov.noaa.gsl.idssEngine.commons.imsMessage.ImsEventReader -gov/noaa/gsl/idssEngine/commons/GeometryUtils.java - gov.noaa.gsl.idssEngine.commons.GeometryUtils diff --git a/java/build/tmp/jar/MANIFEST.MF b/java/build/tmp/jar/MANIFEST.MF deleted file mode 100644 index 58630c02..00000000 --- a/java/build/tmp/jar/MANIFEST.MF +++ /dev/null @@ -1,2 +0,0 @@ -Manifest-Version: 1.0 - diff --git a/java/gradle/wrapper/gradle-wrapper.jar b/java/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 249e5832..00000000 Binary files a/java/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/java/gradle/wrapper/gradle-wrapper.properties b/java/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index ae04661e..00000000 --- a/java/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/java/gradlew b/java/gradlew deleted file mode 100755 index a69d9cb6..00000000 --- a/java/gradlew +++ /dev/null @@ -1,240 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -############################################################################## -# -# Gradle start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh Gradle -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -# -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: $0 may be a link -app_path=$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] -do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac -done - -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" -APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "$*" -} >&2 - -die () { - echo - echo "$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done -fi - -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. - -set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' - -exec "$JAVACMD" "$@" diff --git a/java/gradlew.bat b/java/gradlew.bat deleted file mode 100644 index 53a6b238..00000000 --- a/java/gradlew.bat +++ /dev/null @@ -1,91 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/java/libs/gov/noaa/gsd/fiqas/cartography/1.1/cartography-1.1.jar b/java/libs/gov/noaa/gsd/fiqas/cartography/1.1/cartography-1.1.jar deleted file mode 100644 index 1901651e..00000000 Binary files a/java/libs/gov/noaa/gsd/fiqas/cartography/1.1/cartography-1.1.jar and /dev/null differ diff --git a/java/libs/gov/noaa/gsd/fiqas/cartography/1.1/cartography-1.1.module b/java/libs/gov/noaa/gsd/fiqas/cartography/1.1/cartography-1.1.module deleted file mode 100644 index da821455..00000000 --- a/java/libs/gov/noaa/gsd/fiqas/cartography/1.1/cartography-1.1.module +++ /dev/null @@ -1,90 +0,0 @@ -{ - "formatVersion": "1.1", - "component": { - "group": "gov.noaa.gsd.fiqas", - "module": "cartography", - "version": "1.1", - "attributes": { - "org.gradle.status": "release" - } - }, - "createdBy": { - "gradle": { - "version": "7.0" - } - }, - "variants": [ - { - "name": "apiElements", - "attributes": { - "org.gradle.category": "library", - "org.gradle.dependency.bundling": "external", - "org.gradle.jvm.version": 8, - "org.gradle.libraryelements": "jar", - "org.gradle.usage": "java-api" - }, - "files": [ - { - "name": "cartography-1.1.jar", - "url": "cartography-1.1.jar", - "size": 73166, - "sha512": "ab112729ea5d7bd663783f3cb16d997068fba916c6279ed109d928223e9bdc84f36180cb945b9ded4045f894f0135830310ff553ac16f208ee594b1f125ca996", - "sha256": "d1363670127f3be0ce9a34e1e48adef4679e23d5ecf3daf11a25fa17fc960982", - "sha1": "6b8abda30aea8129fb2974bb79039683c7d56847", - "md5": "bfb762d207f85764e1f0145320761db9" - } - ] - }, - { - "name": "runtimeElements", - "attributes": { - "org.gradle.category": "library", - "org.gradle.dependency.bundling": "external", - "org.gradle.jvm.version": 8, - "org.gradle.libraryelements": "jar", - "org.gradle.usage": "java-runtime" - }, - "dependencies": [ - { - "group": "com.google.guava", - "module": "guava", - "version": { - "requires": "16+" - } - }, - { - "group": "ucar", - "module": "netcdfAll", - "version": { - "requires": "4.6" - } - }, - { - "group": "gov.noaa.gsd.fiqas", - "module": "math", - "version": { - "requires": "1.1" - } - }, - { - "group": "gov.noaa.gsd.fiqas", - "module": "util", - "version": { - "requires": "1.1" - } - } - ], - "files": [ - { - "name": "cartography-1.1.jar", - "url": "cartography-1.1.jar", - "size": 73166, - "sha512": "ab112729ea5d7bd663783f3cb16d997068fba916c6279ed109d928223e9bdc84f36180cb945b9ded4045f894f0135830310ff553ac16f208ee594b1f125ca996", - "sha256": "d1363670127f3be0ce9a34e1e48adef4679e23d5ecf3daf11a25fa17fc960982", - "sha1": "6b8abda30aea8129fb2974bb79039683c7d56847", - "md5": "bfb762d207f85764e1f0145320761db9" - } - ] - } - ] -} diff --git a/java/libs/gov/noaa/gsd/fiqas/cartography/1.1/cartography-1.1.pom b/java/libs/gov/noaa/gsd/fiqas/cartography/1.1/cartography-1.1.pom deleted file mode 100644 index cb6d6e74..00000000 --- a/java/libs/gov/noaa/gsd/fiqas/cartography/1.1/cartography-1.1.pom +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - 4.0.0 - gov.noaa.gsd.fiqas - cartography - 1.1 - - - com.google.guava - guava - 16+ - runtime - - - ucar - netcdfAll - 4.6 - runtime - - - gov.noaa.gsd.fiqas - math - 1.1 - runtime - - - gov.noaa.gsd.fiqas - util - 1.1 - runtime - - - diff --git a/java/libs/gov/noaa/gsd/fiqas/cartography/maven-metadata-local.xml b/java/libs/gov/noaa/gsd/fiqas/cartography/maven-metadata-local.xml deleted file mode 100644 index c35ea9fb..00000000 --- a/java/libs/gov/noaa/gsd/fiqas/cartography/maven-metadata-local.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - gov.noaa.gsd.fiqas - cartography - - 1.1 - 1.1 - - 1.1 - - 20201005175203 - - diff --git a/java/libs/gov/noaa/gsd/fiqas/common/1.0/common-1.0.jar b/java/libs/gov/noaa/gsd/fiqas/common/1.0/common-1.0.jar deleted file mode 100644 index 0906fe5f..00000000 Binary files a/java/libs/gov/noaa/gsd/fiqas/common/1.0/common-1.0.jar and /dev/null differ diff --git a/java/libs/gov/noaa/gsd/fiqas/common/1.0/common-1.0.pom b/java/libs/gov/noaa/gsd/fiqas/common/1.0/common-1.0.pom deleted file mode 100644 index 003c64fc..00000000 --- a/java/libs/gov/noaa/gsd/fiqas/common/1.0/common-1.0.pom +++ /dev/null @@ -1,100 +0,0 @@ - - - 4.0.0 - gov.noaa.gsd.fiqas - common - 1.0 - - - joda-time - joda-time - 2.1 - compile - - - jfree - jfreechart - 1.0.5 - compile - - - ucar - netcdfAll - 4.6 - compile - - - org.hdfgroup - hdf-bundle - 1.0 - compile - - - org.json - json - 1.0 - compile - - - concurrency - forkjoiny - 1.0.20100528 - compile - - - commons-math - commons-math - 2.2 - compile - - - org.postgresql - postgresql - 9.3-1104-jdbc41 - compile - - - mysql - mysql-connector-java - 5.1.39 - compile - - - org.locationtech.jts - jts-core - 1.16.1 - compile - - - gov.noaa.gsd.fiqas - cartography - 1.1 - compile - - - gov.noaa.gsd.fiqas - math - 1.1 - compile - - - gov.noaa.gsd.fiqas - util - 1.1 - compile - - - gov.noaa.gsd.fiqas - gis - 1.1 - compile - - - gov.noaa.gsd.fiqas - verification - 1.1 - compile - - - diff --git a/java/libs/gov/noaa/gsd/fiqas/common/maven-metadata-local.xml b/java/libs/gov/noaa/gsd/fiqas/common/maven-metadata-local.xml deleted file mode 100644 index 0fd2afff..00000000 --- a/java/libs/gov/noaa/gsd/fiqas/common/maven-metadata-local.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - gov.noaa.gsd.fiqas - common - - 1.0 - - 1.0 - - 20200701192648 - - diff --git a/java/libs/gov/noaa/gsd/fiqas/gis/1.1/gis-1.1.jar b/java/libs/gov/noaa/gsd/fiqas/gis/1.1/gis-1.1.jar deleted file mode 100644 index 47b6b888..00000000 Binary files a/java/libs/gov/noaa/gsd/fiqas/gis/1.1/gis-1.1.jar and /dev/null differ diff --git a/java/libs/gov/noaa/gsd/fiqas/gis/1.1/gis-1.1.module b/java/libs/gov/noaa/gsd/fiqas/gis/1.1/gis-1.1.module deleted file mode 100644 index d0f7e298..00000000 --- a/java/libs/gov/noaa/gsd/fiqas/gis/1.1/gis-1.1.module +++ /dev/null @@ -1,79 +0,0 @@ -{ - "formatVersion": "1.1", - "component": { - "group": "gov.noaa.gsd.fiqas", - "module": "gis", - "version": "1.1", - "attributes": { - "org.gradle.status": "release" - } - }, - "createdBy": { - "gradle": { - "version": "6.6", - "buildId": "fghbpmfa4rf33pzzdpkwxbgusy" - } - }, - "variants": [ - { - "name": "apiElements", - "attributes": { - "org.gradle.category": "library", - "org.gradle.dependency.bundling": "external", - "org.gradle.jvm.version": 8, - "org.gradle.libraryelements": "jar", - "org.gradle.usage": "java-api" - }, - "dependencies": [ - { - "group": "gov.noaa.gsd.fiqas", - "module": "cartography", - "version": { - "requires": "1.1" - } - } - ], - "files": [ - { - "name": "gis-1.1.jar", - "url": "gis-1.1.jar", - "size": 55860, - "sha512": "f642d4a0428efefebf6ebc82457c3533e88c51c9e9517d18951995fcae1caced710b40a7d59c5b304d989dba1e2a1d6dc87ea63f5516132b519772bdcf164610", - "sha256": "e80fb8facd77a012b999f68c97b6ad1d37ea8e2574b7499a4726afde4fdc13a5", - "sha1": "4cc62e8c5b11e4f929e20131b14d1456aa141aab", - "md5": "aa447c474dc120386e9e1f7cc6935cdc" - } - ] - }, - { - "name": "runtimeElements", - "attributes": { - "org.gradle.category": "library", - "org.gradle.dependency.bundling": "external", - "org.gradle.jvm.version": 8, - "org.gradle.libraryelements": "jar", - "org.gradle.usage": "java-runtime" - }, - "dependencies": [ - { - "group": "gov.noaa.gsd.fiqas", - "module": "cartography", - "version": { - "requires": "1.1" - } - } - ], - "files": [ - { - "name": "gis-1.1.jar", - "url": "gis-1.1.jar", - "size": 55860, - "sha512": "f642d4a0428efefebf6ebc82457c3533e88c51c9e9517d18951995fcae1caced710b40a7d59c5b304d989dba1e2a1d6dc87ea63f5516132b519772bdcf164610", - "sha256": "e80fb8facd77a012b999f68c97b6ad1d37ea8e2574b7499a4726afde4fdc13a5", - "sha1": "4cc62e8c5b11e4f929e20131b14d1456aa141aab", - "md5": "aa447c474dc120386e9e1f7cc6935cdc" - } - ] - } - ] -} diff --git a/java/libs/gov/noaa/gsd/fiqas/gis/1.1/gis-1.1.pom b/java/libs/gov/noaa/gsd/fiqas/gis/1.1/gis-1.1.pom deleted file mode 100644 index 09136217..00000000 --- a/java/libs/gov/noaa/gsd/fiqas/gis/1.1/gis-1.1.pom +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - 4.0.0 - gov.noaa.gsd.fiqas - gis - 1.1 - - - gov.noaa.gsd.fiqas - cartography - 1.1 - compile - - - diff --git a/java/libs/gov/noaa/gsd/fiqas/gis/maven-metadata-local.xml b/java/libs/gov/noaa/gsd/fiqas/gis/maven-metadata-local.xml deleted file mode 100644 index 24bed0e2..00000000 --- a/java/libs/gov/noaa/gsd/fiqas/gis/maven-metadata-local.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - gov.noaa.gsd.fiqas - gis - - 1.1 - 1.1 - - 1.1 - - 20201005175203 - - diff --git a/java/libs/gov/noaa/gsd/fiqas/math/1.1/math-1.1.jar b/java/libs/gov/noaa/gsd/fiqas/math/1.1/math-1.1.jar deleted file mode 100644 index 20eeb28c..00000000 Binary files a/java/libs/gov/noaa/gsd/fiqas/math/1.1/math-1.1.jar and /dev/null differ diff --git a/java/libs/gov/noaa/gsd/fiqas/math/1.1/math-1.1.module b/java/libs/gov/noaa/gsd/fiqas/math/1.1/math-1.1.module deleted file mode 100644 index 5b613fe7..00000000 --- a/java/libs/gov/noaa/gsd/fiqas/math/1.1/math-1.1.module +++ /dev/null @@ -1,79 +0,0 @@ -{ - "formatVersion": "1.1", - "component": { - "group": "gov.noaa.gsd.fiqas", - "module": "math", - "version": "1.1", - "attributes": { - "org.gradle.status": "release" - } - }, - "createdBy": { - "gradle": { - "version": "6.6", - "buildId": "fghbpmfa4rf33pzzdpkwxbgusy" - } - }, - "variants": [ - { - "name": "apiElements", - "attributes": { - "org.gradle.category": "library", - "org.gradle.dependency.bundling": "external", - "org.gradle.jvm.version": 8, - "org.gradle.libraryelements": "jar", - "org.gradle.usage": "java-api" - }, - "dependencies": [ - { - "group": "org.apache.commons", - "module": "commons-math", - "version": { - "requires": "2.2" - } - } - ], - "files": [ - { - "name": "math-1.1.jar", - "url": "math-1.1.jar", - "size": 162822, - "sha512": "50104b09840a389f2cc062ad6fac4152f33585adaccd56f3933203125a2b80147b1a423108adfb9e6b381d8f240ba29964087fee977008af23a87f4b3289ceb1", - "sha256": "a476a5c28c4c5bfffcfc5e05a16c7bd1af0f194173ff53004496b9c72e25c441", - "sha1": "615999193151713b55327179fc502e6e58cf2b8b", - "md5": "07b52564f81b76a7815c673c25d45b6a" - } - ] - }, - { - "name": "runtimeElements", - "attributes": { - "org.gradle.category": "library", - "org.gradle.dependency.bundling": "external", - "org.gradle.jvm.version": 8, - "org.gradle.libraryelements": "jar", - "org.gradle.usage": "java-runtime" - }, - "dependencies": [ - { - "group": "org.apache.commons", - "module": "commons-math", - "version": { - "requires": "2.2" - } - } - ], - "files": [ - { - "name": "math-1.1.jar", - "url": "math-1.1.jar", - "size": 162822, - "sha512": "50104b09840a389f2cc062ad6fac4152f33585adaccd56f3933203125a2b80147b1a423108adfb9e6b381d8f240ba29964087fee977008af23a87f4b3289ceb1", - "sha256": "a476a5c28c4c5bfffcfc5e05a16c7bd1af0f194173ff53004496b9c72e25c441", - "sha1": "615999193151713b55327179fc502e6e58cf2b8b", - "md5": "07b52564f81b76a7815c673c25d45b6a" - } - ] - } - ] -} diff --git a/java/libs/gov/noaa/gsd/fiqas/math/1.1/math-1.1.pom b/java/libs/gov/noaa/gsd/fiqas/math/1.1/math-1.1.pom deleted file mode 100644 index 4dc1233d..00000000 --- a/java/libs/gov/noaa/gsd/fiqas/math/1.1/math-1.1.pom +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - 4.0.0 - gov.noaa.gsd.fiqas - math - 1.1 - - - org.apache.commons - commons-math - 2.2 - compile - - - diff --git a/java/libs/gov/noaa/gsd/fiqas/math/maven-metadata-local.xml b/java/libs/gov/noaa/gsd/fiqas/math/maven-metadata-local.xml deleted file mode 100644 index 7c0fc20b..00000000 --- a/java/libs/gov/noaa/gsd/fiqas/math/maven-metadata-local.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - gov.noaa.gsd.fiqas - math - - 1.1 - 1.1 - - 1.1 - - 20201005175203 - - diff --git a/java/libs/gov/noaa/gsd/fiqas/util/1.1/util-1.1.jar b/java/libs/gov/noaa/gsd/fiqas/util/1.1/util-1.1.jar deleted file mode 100644 index f3e3fe62..00000000 Binary files a/java/libs/gov/noaa/gsd/fiqas/util/1.1/util-1.1.jar and /dev/null differ diff --git a/java/libs/gov/noaa/gsd/fiqas/util/1.1/util-1.1.module b/java/libs/gov/noaa/gsd/fiqas/util/1.1/util-1.1.module deleted file mode 100644 index 9a1cf5fe..00000000 --- a/java/libs/gov/noaa/gsd/fiqas/util/1.1/util-1.1.module +++ /dev/null @@ -1,118 +0,0 @@ -{ - "formatVersion": "1.1", - "component": { - "group": "gov.noaa.gsd.fiqas", - "module": "util", - "version": "1.1", - "attributes": { - "org.gradle.status": "release" - } - }, - "createdBy": { - "gradle": { - "version": "7.0" - } - }, - "variants": [ - { - "name": "apiElements", - "attributes": { - "org.gradle.category": "library", - "org.gradle.dependency.bundling": "external", - "org.gradle.jvm.version": 8, - "org.gradle.libraryelements": "jar", - "org.gradle.usage": "java-api" - }, - "files": [ - { - "name": "util-1.1.jar", - "url": "util-1.1.jar", - "size": 742015, - "sha512": "88664e3c31fba6c52adcc18eb9d5a105f572a1ad16231b96229a35b4c52f9ccf16d6c39382422d27203379d2ea9d2725f757e3394e907ee87c6ccd5725f19b06", - "sha256": "bd6c817ec8c1cd2bd4b0dd1677bf868f83d56359841b7af6b1da8490657f29d1", - "sha1": "8dfa34d4b189083dfd0dd11aff2553bdee342caf", - "md5": "78ce9499b72fb2a693ea079b4263f15c" - } - ] - }, - { - "name": "runtimeElements", - "attributes": { - "org.gradle.category": "library", - "org.gradle.dependency.bundling": "external", - "org.gradle.jvm.version": 8, - "org.gradle.libraryelements": "jar", - "org.gradle.usage": "java-runtime" - }, - "dependencies": [ - { - "group": "gov.noaa.gsd.fiqas", - "module": "math", - "version": { - "requires": "1.1" - } - }, - { - "group": "joda-time", - "module": "joda-time", - "version": { - "requires": "2.1" - } - }, - { - "group": "jfree", - "module": "jfreechart", - "version": { - "requires": "1.0.5" - } - }, - { - "group": "org.apache.commons", - "module": "commons-math", - "version": { - "requires": "2.2" - } - }, - { - "group": "ucar", - "module": "netcdfAll", - "version": { - "requires": "4.6" - } - }, - { - "group": "org.json", - "module": "json", - "version": { - "requires": "20200518" - } - }, - { - "group": "org.postgresql", - "module": "postgresql", - "version": { - "requires": "9.3-1104-jdbc41" - } - }, - { - "group": "mysql", - "module": "mysql-connector-java", - "version": { - "requires": "5.1.39" - } - } - ], - "files": [ - { - "name": "util-1.1.jar", - "url": "util-1.1.jar", - "size": 742015, - "sha512": "88664e3c31fba6c52adcc18eb9d5a105f572a1ad16231b96229a35b4c52f9ccf16d6c39382422d27203379d2ea9d2725f757e3394e907ee87c6ccd5725f19b06", - "sha256": "bd6c817ec8c1cd2bd4b0dd1677bf868f83d56359841b7af6b1da8490657f29d1", - "sha1": "8dfa34d4b189083dfd0dd11aff2553bdee342caf", - "md5": "78ce9499b72fb2a693ea079b4263f15c" - } - ] - } - ] -} diff --git a/java/libs/gov/noaa/gsd/fiqas/util/1.1/util-1.1.pom b/java/libs/gov/noaa/gsd/fiqas/util/1.1/util-1.1.pom deleted file mode 100644 index 9cc07aba..00000000 --- a/java/libs/gov/noaa/gsd/fiqas/util/1.1/util-1.1.pom +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - 4.0.0 - gov.noaa.gsd.fiqas - util - 1.1 - - - gov.noaa.gsd.fiqas - math - 1.1 - runtime - - - joda-time - joda-time - 2.1 - runtime - - - jfree - jfreechart - 1.0.5 - runtime - - - org.apache.commons - commons-math - 2.2 - runtime - - - ucar - netcdfAll - 4.6 - runtime - - - org.json - json - 20200518 - runtime - - - org.postgresql - postgresql - 9.3-1104-jdbc41 - runtime - - - mysql - mysql-connector-java - 5.1.39 - runtime - - - diff --git a/java/libs/gov/noaa/gsd/fiqas/util/maven-metadata-local.xml b/java/libs/gov/noaa/gsd/fiqas/util/maven-metadata-local.xml deleted file mode 100644 index 0da7b42d..00000000 --- a/java/libs/gov/noaa/gsd/fiqas/util/maven-metadata-local.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - gov.noaa.gsd.fiqas - util - - 1.1 - 1.1 - - 1.1 - - 20201005175203 - - diff --git a/java/libs/gov/noaa/gsd/fiqas/verification/1.1/verification-1.1.jar b/java/libs/gov/noaa/gsd/fiqas/verification/1.1/verification-1.1.jar deleted file mode 100644 index b54d5d3d..00000000 Binary files a/java/libs/gov/noaa/gsd/fiqas/verification/1.1/verification-1.1.jar and /dev/null differ diff --git a/java/libs/gov/noaa/gsd/fiqas/verification/1.1/verification-1.1.module b/java/libs/gov/noaa/gsd/fiqas/verification/1.1/verification-1.1.module deleted file mode 100644 index bb9f10b5..00000000 --- a/java/libs/gov/noaa/gsd/fiqas/verification/1.1/verification-1.1.module +++ /dev/null @@ -1,107 +0,0 @@ -{ - "formatVersion": "1.1", - "component": { - "group": "gov.noaa.gsd.fiqas", - "module": "verification", - "version": "1.1", - "attributes": { - "org.gradle.status": "release" - } - }, - "createdBy": { - "gradle": { - "version": "6.6", - "buildId": "fghbpmfa4rf33pzzdpkwxbgusy" - } - }, - "variants": [ - { - "name": "apiElements", - "attributes": { - "org.gradle.category": "library", - "org.gradle.dependency.bundling": "external", - "org.gradle.jvm.version": 8, - "org.gradle.libraryelements": "jar", - "org.gradle.usage": "java-api" - }, - "dependencies": [ - { - "group": "gov.noaa.gsd.fiqas", - "module": "util", - "version": { - "requires": "1.1" - } - }, - { - "group": "gov.noaa.gsd.fiqas", - "module": "math", - "version": { - "requires": "1.1" - } - }, - { - "group": "gov.noaa.gsd.fiqas", - "module": "cartography", - "version": { - "requires": "1.1" - } - } - ], - "files": [ - { - "name": "verification-1.1.jar", - "url": "verification-1.1.jar", - "size": 369692, - "sha512": "31263734f9b421c8dbb7353b663ca4389d47f6b9e39879a6732cec8b9f5ff074a17edb321689f2f0e952c96a203265be20a7840278c2a10167060cb58a40afad", - "sha256": "549b288601d62e4fe3d8ba4b54fca8a0bfea43b98bd651ffc09b97464ab5c3fc", - "sha1": "be9d17bea6e31fda497dd663cd617d085270dd72", - "md5": "36490a40a42cad40bf7f34da3b3fa58b" - } - ] - }, - { - "name": "runtimeElements", - "attributes": { - "org.gradle.category": "library", - "org.gradle.dependency.bundling": "external", - "org.gradle.jvm.version": 8, - "org.gradle.libraryelements": "jar", - "org.gradle.usage": "java-runtime" - }, - "dependencies": [ - { - "group": "gov.noaa.gsd.fiqas", - "module": "util", - "version": { - "requires": "1.1" - } - }, - { - "group": "gov.noaa.gsd.fiqas", - "module": "math", - "version": { - "requires": "1.1" - } - }, - { - "group": "gov.noaa.gsd.fiqas", - "module": "cartography", - "version": { - "requires": "1.1" - } - } - ], - "files": [ - { - "name": "verification-1.1.jar", - "url": "verification-1.1.jar", - "size": 369692, - "sha512": "31263734f9b421c8dbb7353b663ca4389d47f6b9e39879a6732cec8b9f5ff074a17edb321689f2f0e952c96a203265be20a7840278c2a10167060cb58a40afad", - "sha256": "549b288601d62e4fe3d8ba4b54fca8a0bfea43b98bd651ffc09b97464ab5c3fc", - "sha1": "be9d17bea6e31fda497dd663cd617d085270dd72", - "md5": "36490a40a42cad40bf7f34da3b3fa58b" - } - ] - } - ] -} diff --git a/java/libs/gov/noaa/gsd/fiqas/verification/1.1/verification-1.1.pom b/java/libs/gov/noaa/gsd/fiqas/verification/1.1/verification-1.1.pom deleted file mode 100644 index 4442f585..00000000 --- a/java/libs/gov/noaa/gsd/fiqas/verification/1.1/verification-1.1.pom +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - 4.0.0 - gov.noaa.gsd.fiqas - verification - 1.1 - - - gov.noaa.gsd.fiqas - util - 1.1 - compile - - - gov.noaa.gsd.fiqas - math - 1.1 - compile - - - gov.noaa.gsd.fiqas - cartography - 1.1 - compile - - - diff --git a/java/libs/gov/noaa/gsd/fiqas/verification/maven-metadata-local.xml b/java/libs/gov/noaa/gsd/fiqas/verification/maven-metadata-local.xml deleted file mode 100644 index 738f64a7..00000000 --- a/java/libs/gov/noaa/gsd/fiqas/verification/maven-metadata-local.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - gov.noaa.gsd.fiqas - verification - - 1.1 - 1.1 - - 1.1 - - 20201005175204 - - diff --git a/java/libs/ucar/netcdfAll/4.6/netcdfAll-4.6.jar b/java/libs/ucar/netcdfAll/4.6/netcdfAll-4.6.jar deleted file mode 100644 index de728c84..00000000 Binary files a/java/libs/ucar/netcdfAll/4.6/netcdfAll-4.6.jar and /dev/null differ diff --git a/java/libs/ucar/netcdfAll/4.6/netcdfAll-4.6.jar.md5 b/java/libs/ucar/netcdfAll/4.6/netcdfAll-4.6.jar.md5 deleted file mode 100644 index e3a8120a..00000000 --- a/java/libs/ucar/netcdfAll/4.6/netcdfAll-4.6.jar.md5 +++ /dev/null @@ -1 +0,0 @@ -b598d468db05bb4e47f53f9289780de0 \ No newline at end of file diff --git a/java/libs/ucar/netcdfAll/4.6/netcdfAll-4.6.jar.sha1 b/java/libs/ucar/netcdfAll/4.6/netcdfAll-4.6.jar.sha1 deleted file mode 100644 index 9f70c9bf..00000000 --- a/java/libs/ucar/netcdfAll/4.6/netcdfAll-4.6.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -29295a23177e44998d0ef36caf6b01789124f3ba \ No newline at end of file diff --git a/java/libs/ucar/netcdfAll/4.6/netcdfAll-4.6.pom b/java/libs/ucar/netcdfAll/4.6/netcdfAll-4.6.pom deleted file mode 100644 index 15108d01..00000000 --- a/java/libs/ucar/netcdfAll/4.6/netcdfAll-4.6.pom +++ /dev/null @@ -1,9 +0,0 @@ - - - 4.0.0 - ucar - netcdfAll - 4.6 - POM was created by Sonatype Nexus - diff --git a/java/libs/ucar/netcdfAll/4.6/netcdfAll-4.6.pom.md5 b/java/libs/ucar/netcdfAll/4.6/netcdfAll-4.6.pom.md5 deleted file mode 100644 index 6b0eb3b4..00000000 --- a/java/libs/ucar/netcdfAll/4.6/netcdfAll-4.6.pom.md5 +++ /dev/null @@ -1 +0,0 @@ -602486a413535530b159b85e55976a7f \ No newline at end of file diff --git a/java/libs/ucar/netcdfAll/4.6/netcdfAll-4.6.pom.sha1 b/java/libs/ucar/netcdfAll/4.6/netcdfAll-4.6.pom.sha1 deleted file mode 100644 index a800c927..00000000 --- a/java/libs/ucar/netcdfAll/4.6/netcdfAll-4.6.pom.sha1 +++ /dev/null @@ -1 +0,0 @@ -12fef5ebff829af97588cea12f531c27e60a202a \ No newline at end of file diff --git a/java/libs/ucar/netcdfAll/maven-metadata.xml b/java/libs/ucar/netcdfAll/maven-metadata.xml deleted file mode 100644 index bb596563..00000000 --- a/java/libs/ucar/netcdfAll/maven-metadata.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - ucar - netcdfAll - - 4.6 - 4.6 - - 4.0 - 4.1 - 4.2 - 4.3 - 4.6 - - 20160809163545 - - diff --git a/java/libs/ucar/netcdfAll/maven-metadata.xml.md5 b/java/libs/ucar/netcdfAll/maven-metadata.xml.md5 deleted file mode 100644 index dd3a6216..00000000 --- a/java/libs/ucar/netcdfAll/maven-metadata.xml.md5 +++ /dev/null @@ -1 +0,0 @@ -4b202cba19af39a90900edd0cb680752 \ No newline at end of file diff --git a/java/libs/ucar/netcdfAll/maven-metadata.xml.sha1 b/java/libs/ucar/netcdfAll/maven-metadata.xml.sha1 deleted file mode 100644 index dea3d919..00000000 --- a/java/libs/ucar/netcdfAll/maven-metadata.xml.sha1 +++ /dev/null @@ -1 +0,0 @@ -e7b975afb0008bc7ff0be9ad762dec3b3f29a16e \ No newline at end of file diff --git a/java/settings.gradle b/java/settings.gradle deleted file mode 100644 index b0a668f0..00000000 --- a/java/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'idss-engine-commons' diff --git a/java/src/main/java/gov/noaa/gsl/idssEngine/commons/GridUtils.java b/java/src/main/java/gov/noaa/gsl/idssEngine/commons/GridUtils.java deleted file mode 100644 index cec05a6d..00000000 --- a/java/src/main/java/gov/noaa/gsl/idssEngine/commons/GridUtils.java +++ /dev/null @@ -1,326 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2020 Regents of the University of Colorado. All rights reserved. - * - * Contributors: - * Geary Layne - *******************************************************************************/ -package gov.noaa.gsl.idssEngine.commons; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Set; -import java.util.concurrent.ForkJoinPool; -import java.util.concurrent.RecursiveAction; - -import gov.noaa.gsd.fiqas.util.grid.tool.RadialHood; - -public class GridUtils { - - public static float getMax(float[][] grid, Set domainSet) { - if(domainSet.size()==0) return Float.NaN; - - int[] ij = domainSet.iterator().next(); - float max = grid[ij[0]][ij[1]]; - for(int[] xy : domainSet) { - float v = grid[xy[0]][xy[1]]; - if(maxmax) grid1[i][j]=max; - grid1[i][j] = v; - } - } - return grid1; - } - - public static float[][] getSum(float[][] grid1, float[][] grid2) { - if(grid1==null || grid2==null) return null; - - int d1=grid1.length, d2=grid1[0].length; - for(int i=0; imax) grid1[i][j]=max; - grid1[i][j] = v; - } - } - return grid1; - } - - public static float[][] copy(float[][] grid) { - if(grid==null) return null; - - int d1=grid.length, d2=grid[0].length; - float[][] ansGrid = new float[d1][d2]; - for(int i=0; ivalue) grid[i][j]=value; - } - } - } - - public static void ensureBounds(float[][] grid, float lowerValue, float upperValue) { - if(grid==null) return; - - int d1=grid.length, d2=grid[0].length; - for(int i=0; iupperValue) grid[i][j]=upperValue; - } - } - } - - - // RH: =100*(EXP((17.625*TD)/(243.04+TD))/EXP((17.625*T)/(243.04+T))) - public static float[][] getRelativeHumidityGrid(float[][] tempInKelvin, float[][] dewpointInKelvin) { - if(tempInKelvin==null || dewpointInKelvin==null) return null; - - int d1=tempInKelvin.length, d2=tempInKelvin[0].length; - float[][] grid = new float[d1][d2]; - for(int i=0; i=80) { - final float rh2 = rh*rh; - final float t2 = t*t; - grid[i][j] = (float)(-42.379 + 2.04901523*t + 10.14333127*rh - - .22475541*t*rh - .00683783*t2 - .05481717*rh2 - + .00122874*t2*rh + .00085282*t*rh2 - .00000199*t2*rh2); - if(rh<13 && (t>80 && t<=112)) { - grid[i][j] -= ((13.0-rh)/4.0)*Math.sqrt((17.0-Math.abs(t-95.0))/17.0); - } - else if(rh>85 && (t>80 && t<=87)) { - grid[i][j] += ((rh-85.0)/10.0) * ((87.0-t)/5.0); - } - } - } - } - - return grid; - } - - // wc = 35.74 + (0.6215 × Temperature) − (35.75 × WindSpeed^0.16) + (0.4275 × Temperature × WindSpeed^0.16) - public static float[][] getWindChillGrid(float[][] windSpeedInMilesPerHour, float[][] tempInFahrenheit) { - if(windSpeedInMilesPerHour==null || tempInFahrenheit==null) return null; - - int width=windSpeedInMilesPerHour.length, height=windSpeedInMilesPerHour[0].length; - float[][] grid = new float[width][height]; - for(int i=0; i xySet = rh.getNeighborhood(i, j, 0, 0, xMax, yMax); - double cnt=0; - for(int[] xy : xySet) { - if(grid[xy[0]][xy[1]]>=thresh) cnt++; - } - ansGrid[i][j] = (float)(cnt/(double)xySet.size()); - } - } - return ansGrid; - } - - public static float[][] getMaxInHood(float[][] grid, Collection offsets) { - if(grid==null) return null; - - int d1=grid.length, d2=grid[0].length; - float[][] outputGrid = new float[d1][d2]; -// getMaxInHoodCore(0, d1, 0, d2, grid, offsets, outputGrid); - forkJoinPool.invoke(new MaxInHood(0,d1,0,d2,grid, offsets, outputGrid)); - return grid; - } - - public static void getMaxInHoodCore(int startD1, int endD1, int startD2, int endD2, float[][] inputGrid, Collection offsets, float[][] outputGrid) { - final int d1=inputGrid.length, d2=inputGrid[0].length; - for(int i=startD1; i=0 && x=0 && y offsets; - final int startD1, endD1, startD2, endD2; - - MaxInHood(int startD1, int endD1, int startD2, int endD2, float[][] inputGrid, Collection offsets, float[][] outputGrid) { - this.startD1 = startD1; this.endD1 = endD1; - this.startD2 = startD2; this.endD2 = endD2; - this.inputGrid = inputGrid; this.outputGrid = outputGrid; - this.offsets = new ArrayList<>(offsets); - } - - protected void compute() { - int deltaD1 = endD1-startD1; - int deltaD2 = endD2-startD2; - if (deltaD1*deltaD2 < splitThreshold) { - getMaxInHoodCore(deltaD2, deltaD2, deltaD1, deltaD2, inputGrid, offsets, outputGrid); - } else { - if(deltaD1>deltaD2) { - int midD1 = (startD1+endD1) >>> 1; - invokeAll(new MaxInHood(startD1, midD1, startD2, endD2, inputGrid, offsets, outputGrid), - new MaxInHood(midD1, endD1, startD2, endD2, inputGrid, offsets, outputGrid)); - } else { - int midD2 = (startD2+endD2) >>> 1; - invokeAll(new MaxInHood(startD1, endD1, startD2, midD2, inputGrid, offsets, outputGrid), - new MaxInHood(startD1, endD1, midD2, endD2, inputGrid, offsets, outputGrid)); - } - } - } - } - - - - - -} diff --git a/java/src/main/java/gov/noaa/gsl/idssEngine/commons/Logger.java b/java/src/main/java/gov/noaa/gsl/idssEngine/commons/Logger.java deleted file mode 100644 index b99530ec..00000000 --- a/java/src/main/java/gov/noaa/gsl/idssEngine/commons/Logger.java +++ /dev/null @@ -1,223 +0,0 @@ -/********************************************************************************* - * Copyright (c) 2021 Regents of the University of Colorado. All rights reserved. - * - * Contributors: - * Geary Layne -*********************************************************************************/ -package gov.noaa.gsl.idssEngine.commons; - -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.util.concurrent.TimeoutException; - -import org.json.JSONObject; - -import com.rabbitmq.client.Connection; - -public class Logger { - - public enum Level { - DEBUG, INFO, WARN, ERROR, STATUS; //must be ordered from least to most - - public boolean notBelow(Level level) { - if(level == null) return true; - return this.compareTo(level) >= 0; - } - }; - - private final Rabbitmq statusRp; - private final String service; - private final Level level; - private Sid sid = Sid.Empty; - - public Logger(String service) { - this(service, (Level)null, null, null); - } - - public Logger(String service, Level level) { - this(service, level, null, null); - } - - public Logger(String service, Level level, Connection connection) { - this(service, level, connection, null); - } - - public Logger(String service, JSONObject configObj) { - this(service, (Level)null, null, configObj); - } - - public Logger(String service, Connection connection, JSONObject configObj) { - this(service, (Level)null, connection, configObj); - } - - public Logger(String service, Level level, JSONObject configObj) { - this(service, level, null, configObj); - } - - public Logger(String service, String level, Connection connection, JSONObject configObj) { - this(service, Level.valueOf(level), connection, configObj); - } - - public Logger(String service, Level level, Connection connection, JSONObject configObj) { - if(level == null) { - if(configObj == null) { - level = Level.ERROR; - } else { - try { - if(configObj.has("logLevel")) level = Level.valueOf(configObj.getString("logLevel")); - } catch(Exception e) { - warn("Failed to read log level json config file, using default level: "+Level.ERROR); - level = Level.ERROR; - } - } - } - - this.service = service; - if(level.equals(Level.STATUS)) { - warn("Highest level allowed is ERROR, using ERROR instead of "+level); - level = Level.ERROR; - } - this.level = level; - - if(configObj == null) { - this.statusRp = null; - warn("No config file was provided, thus STATUS messages will not to sent via RabbitMQ"); - } else { - try { - this.statusRp = new Rabbitmq(connection, "status", configObj); - } catch(Exception e) { - throw new IllegalArgumentException(e); - } - } - } - - public Sid setSid(Sid sid) { - Sid old_sid = this.sid; - this.sid = sid; - return old_sid; - } - public Sid clearSid() { - return setSid(Sid.Empty); - } - - public void debug(String message) { - debug(sid, service, message); - } - public void debug(Sid sid, String message) { - debug(sid, service, message); - } - public void debug(String service, String message) { - debug(sid, service, message); - } - public void debug(Sid sid, String service, String message) { - if(level.equals(Level.DEBUG)) { - System.out.println(Level.DEBUG+": "+formatMessage(sid, service, message)); - } - } - - public void info(String message) { - info(sid, service, message); - } - public void info(Sid sid, String message) { - info(sid, service, message); - } - public void info(String service, String message) { - info(sid, service, message); - } - public void info(Sid sid, String service, String message) { - if(Level.INFO.notBelow(level)) { - System.out.println(Level.INFO+": "+formatMessage(sid, service, message)); - } - } - - public void warn(String message) { - warn(sid, service, message); - } - public void warn(Sid sid, String message) { - warn(sid, service, message); - } - public void warn(String service, String message) { - warn(sid, service, message); - } - public void warn(Sid sid, String service, String message) { - if(Level.WARN.notBelow(level)) { - System.out.println(Level.WARN+": "+formatMessage(sid, service, message)); - } - } - - public void error(String message) { - error(sid, service, message, null, true); - } - public void error(Sid sid, String message) { - error(sid, service, message, null, true); - } - public void error(String service, String message) { - error(sid, service, message, null, true); - } - public void error(Sid sid, String service, String message) { - error(sid, service, message, null, true); - } - public void error(String message, Exception e) { - error(sid, service, message, e, true); - } - public void error(Sid sid, String message, Exception e) { - error(sid, service, message, e, true); - } - public void error(String service, String message, Exception e) { - error(sid, service, message, e, true); - } - public void error(Sid sid, String service, String message, Exception e) { - error(sid, service, message, e, true); - } - public void error(String message, Exception e, boolean sendToQueue) { - error(sid, service, message, e, sendToQueue); - } - public void error(Sid sid, String message, Exception e, boolean sendToQueue) { - error(sid, service, message, e, sendToQueue); - } - public void error(Sid sid, String service, String message, Exception exception, boolean sendToQueue) { - String formatStr = formatMessage(sid, service, message); - if(exception != null) { - final StringBuilder builder = new StringBuilder(formatStr); - builder.append("\n\t"+exception.toString()); - for(StackTraceElement ste : exception.getStackTrace()) { - builder.append("\n\t\t"); - builder.append(ste.toString()); - } - formatStr = builder.toString(); - } - System.err.println(Level.ERROR+": "+formatStr); - } - - public void status(int numComplete, int totalSteps) { - status(sid, service, numComplete, totalSteps); - } - public void status(Sid sid, int numComplete, int totalSteps) { - status(sid, service, numComplete, totalSteps); - } - public void status(String service, int numComplete, int totalSteps) { - status(sid, service, numComplete, totalSteps); - } - public void status(Sid sid, String service, int numComplete, int totalSteps) { - String formatStr = formatMessage(sid, service, numComplete, totalSteps); - System.out.println(Level.STATUS+": "+formatStr); - if(statusRp!=null) { - try { - statusRp.basicPublish(Level.STATUS.toString(), null, formatStr.getBytes(StandardCharsets.UTF_8)); - debug("Status set to rabbitMQ: "); - } catch(IOException e) { - error(sid, service, "Unable to publish status to queue", e, false); - } - } - } - - private String formatMessage(Sid sid, String service, int numComplete, int totalSteps) { - return String.format("%s:%s:%02d:%02d:%s; %d/%d", - sid.key, sid.originator, sid.issueDt.getHourOfDay(), sid.issueDt.getMinuteOfHour(), service, numComplete, totalSteps); - } - private String formatMessage(Sid sid, String service, String message) { - return String.format("%s:%s:%02d:%02d:%s; %s", - sid.key, sid.originator, sid.issueDt.getHourOfDay(), sid.issueDt.getMinuteOfHour(), service, message); - } - -} diff --git a/java/src/main/java/gov/noaa/gsl/idssEngine/commons/ProductType.java b/java/src/main/java/gov/noaa/gsl/idssEngine/commons/ProductType.java deleted file mode 100644 index 333a4f13..00000000 --- a/java/src/main/java/gov/noaa/gsl/idssEngine/commons/ProductType.java +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2020 Regents of the University of Colorado. All rights reserved. - * - * Contributors: - * Geary Layne - *******************************************************************************/ -package gov.noaa.gsl.idssEngine.commons; - - -public enum ProductType { - Deterministic, - MemberEnsemble, - PercentileEnsemble, - PointObs; - - public static final String DetermKey = ProductType.Deterministic.toString(); -} diff --git a/java/src/main/java/gov/noaa/gsl/idssEngine/commons/Rabbitmq.java b/java/src/main/java/gov/noaa/gsl/idssEngine/commons/Rabbitmq.java deleted file mode 100644 index 08fe98a3..00000000 --- a/java/src/main/java/gov/noaa/gsl/idssEngine/commons/Rabbitmq.java +++ /dev/null @@ -1,268 +0,0 @@ -/********************************************************************************* - * Copyright (c) 2022 Regents of the University of Colorado. All rights reserved. - * - * Contributors: - * Geary Layne -*********************************************************************************/ -package gov.noaa.gsl.idssEngine.commons; - -import java.io.IOException; -import java.util.concurrent.TimeoutException; - -import org.json.JSONObject; - -import com.rabbitmq.client.AMQP.BasicProperties; -import com.rabbitmq.client.Channel; -import com.rabbitmq.client.Connection; -import com.rabbitmq.client.ConnectionFactory; -import com.rabbitmq.client.Consumer; - -public class Rabbitmq { - - static public class ConnectionParams { - public final String rabMqVhost; - public final String rabMqHost; - public final String rabMqPortNum; - public final String rabMqUser; - public final String rabMqPwd; - - static public ConnectionParams fromRabbitmqObj(JSONObject rabbitmqObj) { - String vHost = rabbitmqObj.has("virtualHost") ? rabbitmqObj.getString("virtualHost") : null; - String hostName = rabbitmqObj.has("hostName") ? rabbitmqObj.getString("hostName") : null; - String portNum = rabbitmqObj.has("portNumber") ? Integer.toString(rabbitmqObj.getInt("portNumber")) : null; - String userName = rabbitmqObj.has("userName") ? rabbitmqObj.getString("userName") : null; - String password = rabbitmqObj.has("password") ? rabbitmqObj.getString("password") : null; - return new ConnectionParams(vHost, hostName, portNum, userName, password); - } - public ConnectionParams(String rabMqVhost, String rabMqHost, String rabMqPortNum, - String rabMqUser, String rabMqPwd) { - this.rabMqVhost=rabMqVhost; this.rabMqHost=rabMqHost; this.rabMqPortNum=rabMqPortNum; - this.rabMqUser=rabMqUser; this.rabMqPwd=rabMqPwd; - } - } - - static public class Topology { - public final String exchName, exchType, exchRoutingKey; - public final String queueName, queueRoutingKey; - public final boolean queueDurable, queueExclusive, queueAutoDelete; - - public Topology(String topologyKey, JSONObject rabbitmqObj) { - this(rabbitmqObj.getJSONObject(topologyKey)); - } - public Topology(JSONObject topologyObj) { - this(topologyObj.has("exchangeName") ? topologyObj.getString("exchangeName") : null, - topologyObj.has("exchangeType") ? topologyObj.getString("exchangeType") : null, - topologyObj.has("exchangeRoutingKey") ? topologyObj.getString("exchangeRoutingKey") : null, - topologyObj.has("queueName") ? topologyObj.getString("queueName") : null, - topologyObj.has("queueRoutingKey") ? topologyObj.getString("queueRoutingKey") : null, - topologyObj.has("queueDurable") ? Boolean.parseBoolean(topologyObj.getString("queueDurable")) : false, - topologyObj.has("queueExclusive") ? Boolean.parseBoolean(topologyObj.getString("queueExclusive")) : false, - topologyObj.has("queueAutoDelete") ? Boolean.parseBoolean(topologyObj.getString("queueAutoDelete")) : false); - } - public Topology(String exchName, String exchType, String exchRoutingKey, String queueName, String queueRoutingKey, - boolean queueDurable, boolean queueExclusive, boolean queueAutoDelete) { - this.exchName=exchName; this.exchType=exchType; this.exchRoutingKey=exchRoutingKey; - this.queueName=queueName; this.queueRoutingKey=queueRoutingKey; - this.queueDurable=queueDurable; this.queueExclusive=queueExclusive; this.queueAutoDelete=queueAutoDelete; - } - } - - public static Connection getConnection(String connName, JSONObject rabbitmqOb) { - ConnectionParams connParams = ConnectionParams.fromRabbitmqObj(rabbitmqOb); - return getConnection(connName, connParams); - } - public static Connection getConnection(String connName, ConnectionParams connParams) { - return getConnection(connName, - connParams.rabMqVhost, connParams.rabMqHost, connParams.rabMqPortNum, - connParams.rabMqUser, connParams.rabMqPwd); - } - public static Connection getConnection(String connName, - String rabMqVhost, String rabMqHost, String rabMqPortNum, - String rabMqUser, String rabMqPwd) { - return getConnection(connName, rabMqVhost, rabMqHost, Integer.parseInt(rabMqPortNum), rabMqUser, rabMqPwd); - } - public static Connection getConnection(String connName, - String rabMqVhost, String rabMqHost, int rabMqPortNum, - String rabMqUser, String rabMqPwd) { - int numAttempts = 5; - int attemptWait = 5500; - ConnectionFactory factory = new ConnectionFactory(); - factory.setUsername(rabMqUser); - factory.setPassword(rabMqPwd); - factory.setVirtualHost(rabMqVhost); - factory.setHost(rabMqHost); - factory.setPort(rabMqPortNum); - factory.setTopologyRecoveryEnabled(true); - factory.setAutomaticRecoveryEnabled(true); - - Connection connection = null; - for(int i=0; i response; - Exception exception = null; - Thread thread; - public ReadStream(String name, InputStream is) { - this(name, is, false); - } - public ReadStream(String name, InputStream is, boolean storeResponse) { - this.name = name; - this.is = is; - if(storeResponse) - response = new ArrayList<>(); - else - response = null; - } - public void start () { - thread = new Thread (this); - thread.start (); - } - public void run () { - try { - InputStreamReader isr = new InputStreamReader (is); - BufferedReader br = new BufferedReader (isr); - if(response!=null) { - response.clear(); - while (true) { - String s = br.readLine (); - if (s == null) break; - response.add(s); - } - } else { - while (true) { - String s = br.readLine (); - if (s == null) break; -// System.out.println ("[" + name + "] " + s); - } - } - is.close (); - } catch (Exception e) { - exception = e; - } - } - - public List getResponse() { - return response; - } - public Exception getExceptions() { - return exception; - } - } - - public static int run(String[] cmd, List errorResponse) throws Exception { - return run(cmd, errorResponse, null); - } - public static int run(String[] cmd, List errorResponse, List inputResponse) throws Exception { - Process p = null; - try { - p = Runtime.getRuntime().exec(cmd) ; - ReadStream s1 = new ReadStream("stdin", p.getInputStream(), inputResponse!=null); - ReadStream s2 = new ReadStream("stderr", p.getErrorStream(), errorResponse!=null); - s1.start (); - s2.start (); - int result = p.waitFor(); - if(inputResponse!=null) inputResponse.addAll(s1.response); - if(errorResponse!=null) errorResponse.addAll(s2.response); - if(s1.exception!=null) throw s1.exception; - if(s2.exception!=null) throw s2.exception; - return result; - } finally { - if(p != null) - p.destroy(); - } - } -} diff --git a/java/src/main/java/gov/noaa/gsl/idssEngine/commons/Sid.java b/java/src/main/java/gov/noaa/gsl/idssEngine/commons/Sid.java deleted file mode 100644 index 9138ceb2..00000000 --- a/java/src/main/java/gov/noaa/gsl/idssEngine/commons/Sid.java +++ /dev/null @@ -1,62 +0,0 @@ -/********************************************************************************* - * Copyright (c) 2021 Regents of the University of Colorado. All rights reserved. - * - * Contributors: - * Geary Layne -*********************************************************************************/ -package gov.noaa.gsl.idssEngine.commons; - -import java.util.Objects; -import java.util.UUID; - -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; - -import gov.noaa.gsd.fiqas.util.time.DateTimeFactory; - -public class Sid { - - public final String key; - public final String originator; - public final DateTime issueDt; - - public static final Sid Empty = new Sid("None", "none", new DateTime(0, DateTimeZone.UTC)); - public Sid(String key, String originator, DateTime issueDt) { - this.key = key; - this.originator = originator; - this.issueDt = issueDt; - } - - public Sid(UUID key, String originator, DateTime issueDt) { - this(key.toString(), originator, issueDt); - } - - public Sid(String key, String originator, String issueDt) { - this(key, originator, DateTimeFactory.newInstance(issueDt)); - } - - @Override - public int hashCode() { - return Objects.hash(issueDt, key, originator); - } - - @Override - public boolean equals(Object obj) { - if( this == obj ) - return true; - if( obj == null ) - return false; - if( getClass() != obj.getClass() ) - return false; - Sid other = (Sid) obj; - return Objects.equals(issueDt, other.issueDt) - && Objects.equals(key, other.key) - && Objects.equals(originator, other.originator); - } - - @Override - public String toString() { - return String.format("Sid(%s, %s, %s)", key, originator, issueDt); - } - -} diff --git a/java/src/main/java/gov/noaa/gsl/idssEngine/commons/UnitsConversion.java b/java/src/main/java/gov/noaa/gsl/idssEngine/commons/UnitsConversion.java deleted file mode 100644 index a0ebe233..00000000 --- a/java/src/main/java/gov/noaa/gsl/idssEngine/commons/UnitsConversion.java +++ /dev/null @@ -1,2125 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2020 Regents of the University of Colorado. All rights reserved. - * - * Contributors: - * Geary Layne - *******************************************************************************/ -package gov.noaa.gsl.idssEngine.commons; - -import gov.noaa.gsl.idssEngine.commons.aspect.Units; - -public class UnitsConversion { - - public static final double nineFifth = 9.0/5.0; - public static final double fiveNinth = 5.0/9.0; - - public static float convert(Units srcUnits, Units destUnits, float value) { - if(srcUnits == destUnits) return value; - switch(srcUnits) { - case Inches: - return convertInches(destUnits, value); - case Feet: - return convertFeet(destUnits, value); - case Miles: - return convertMiles(destUnits, value); - case KgPerM2: - return convertKgPerM2(destUnits, value); - case Meters: - return convertMeters(destUnits, value); - case Fahrenheit: - return convertFahrenheit(destUnits, value); - case Kelvin: - return convertKelvin(destUnits, value); - case Celsius: - return convertCelcius(destUnits, value); - case MetersPerSecond: - return convertMetersPerSecond(destUnits, value); - case MilesPerHour: - return convertMilesPerHour(destUnits, value); - case Knots: - return convertKnots(destUnits, value); - case Pascals: - return convertPascals(destUnits, value); - default: - } - throw new UnsupportedOperationException("Units covertion for ("+srcUnits+") not currently supported"); - } - public static double convert(Units srcUnits, Units destUnits, double value) { - if(srcUnits == destUnits) return value; - switch(srcUnits) { - case Inches: - return convertInches(destUnits, value); - case Feet: - return convertFeet(destUnits, value); - case Miles: - return convertMiles(destUnits, value); - case KgPerM2: - return convertKgPerM2(destUnits, value); - case Meters: - return convertMeters(destUnits, value); - case Fahrenheit: - return convertFahrenheit(destUnits, value); - case Kelvin: - return convertKelvin(destUnits, value); - case Celsius: - return convertCelcius(destUnits, value); - case MetersPerSecond: - return convertMetersPerSecond(destUnits, value); - case MilesPerHour: - return convertMilesPerHour(destUnits, value); - case Knots: - return convertKnots(destUnits, value); - case Pascals: - return convertPascals(destUnits, value); - default: - } - throw new UnsupportedOperationException("Units covertion for ("+srcUnits+") not currently supported"); - } - - public static float[] convert(Units srcUnits, Units destUnits, float[] array) { - if(srcUnits == destUnits) return array; - switch(srcUnits) { - case Inches: - return convertInches(destUnits, array); - case Feet: - return convertFeet(destUnits, array); - case Miles: - return convertMiles(destUnits, array); - case KgPerM2: - return convertKgPerM2(destUnits, array); - case Meters: - return convertMeters(destUnits, array); - case Fahrenheit: - return convertFahrenheit(destUnits, array); - case Kelvin: - return convertKelvin(destUnits, array); - case Celsius: - return convertCelcius(destUnits, array); - case MetersPerSecond: - return convertMetersPerSecond(destUnits, array); - case MilesPerHour: - return convertMilesPerHour(destUnits, array); - case Knots: - return convertKnots(destUnits, array); - case Pascals: - return convertPascals(destUnits, array); - default: - } - throw new UnsupportedOperationException("Units covertion for ("+srcUnits+") not currently supported"); - } - - public static double[] convert(Units srcUnits, Units destUnits, double[] array) { - if(srcUnits == destUnits) return array; - switch(srcUnits) { - case Inches: - return convertInches(destUnits, array); - case Feet: - return convertFeet(destUnits, array); - case Miles: - return convertMiles(destUnits, array); - case KgPerM2: - return convertKgPerM2(destUnits, array); - case Meters: - return convertMeters(destUnits, array); - case Fahrenheit: - return convertFahrenheit(destUnits, array); - case Kelvin: - return convertKelvin(destUnits, array); - case Celsius: - return convertCelcius(destUnits, array); - case MetersPerSecond: - return convertMetersPerSecond(destUnits, array); - case MilesPerHour: - return convertMilesPerHour(destUnits, array); - case Knots: - return convertKnots(destUnits, array); - case Pascals: - return convertPascals(destUnits, array); - default: - } - throw new UnsupportedOperationException("Units covertion for ("+srcUnits+") not currently supported"); - } - - public static float[][] convert(Units srcUnits, Units destUnits, float[][] grid) { - if(srcUnits == destUnits) return grid; - switch(srcUnits) { - case Inches: - return convertInches(destUnits, grid); - case Feet: - return convertFeet(destUnits, grid); - case Miles: - return convertMiles(destUnits, grid); - case KgPerM2: - return convertKgPerM2(destUnits, grid); - case Meters: - return convertMeters(destUnits, grid); - case Fahrenheit: - return convertFahrenheit(destUnits, grid); - case Kelvin: - return convertKelvin(destUnits, grid); - case Celsius: - return convertCelcius(destUnits, grid); - case MetersPerSecond: - return convertMetersPerSecond(destUnits, grid); - case MilesPerHour: - return convertMilesPerHour(destUnits, grid); - case Knots: - return convertKnots(destUnits, grid); - case Pascals: - return convertPascals(destUnits, grid); - default: - } - throw new UnsupportedOperationException("Units covertion for ("+srcUnits+") not currently supported"); - } - - public static double[][] convert(Units srcUnits, Units destUnits, double[][] grid) { - if(srcUnits == destUnits) return grid; - switch(srcUnits) { - case Inches: - return convertInches(destUnits, grid); - case Feet: - return convertFeet(destUnits, grid); - case Miles: - return convertMiles(destUnits, grid); - case KgPerM2: - return convertKgPerM2(destUnits, grid); - case Meters: - return convertMeters(destUnits, grid); - case Fahrenheit: - return convertFahrenheit(destUnits, grid); - case Kelvin: - return convertKelvin(destUnits, grid); - case Celsius: - return convertCelcius(destUnits, grid); - case MetersPerSecond: - return convertMetersPerSecond(destUnits, grid); - case MilesPerHour: - return convertMilesPerHour(destUnits, grid); - case Knots: - return convertKnots(destUnits, grid); - case Pascals: - return convertPascals(destUnits, grid); - default: - } - throw new UnsupportedOperationException("Units covertion for ("+srcUnits+") not currently supported"); - } - - ////////////////////////////////////// convert Inches /////////////////////////////////////////////// - public static float convertInches(Units destUnits, float value) { - switch(destUnits) { - case Inches: - return value; - case Feet: - return inchesToFeet(value); - case Miles: - return inchesToMiles(value); - case Meters: - return inchesToMeters(value); - case KgPerM2: - return inchesToKgPerM2(value); - default: - } - throw new UnsupportedOperationException("Units covertion from inches to ("+destUnits+") not currently supported"); - } - public static double convertInches(Units destUnits, double value) { - switch(destUnits) { - case Inches: - return value; - case Feet: - return inchesToFeet(value); - case Miles: - return inchesToMiles(value); - case Meters: - return inchesToMeters(value); - case KgPerM2: - return inchesToKgPerM2(value); - default: - } - throw new UnsupportedOperationException("Units covertion from inches to ("+destUnits+") not currently supported"); - } - - public static float[] convertInches(Units destUnits, float[] array) { - switch(destUnits) { - case Inches: - return array; -// case Feet: -// return inchesToFeet(grid); -// case Miles: -// return inchesToMiles(grid); -// case Meters: -// return inchesToMeters(grid); -// case KgPerM2: -// return inchesToKgPerM2(grid); - default: - } - throw new UnsupportedOperationException("Units covertion from inches to ("+destUnits+") not currently supported"); - } - public static double[] convertInches(Units destUnits, double[] array) { - switch(destUnits) { - case Inches: - return array; -// case Feet: -// return inchesToFeet(grid); -// case Miles: -// return inchesToMiles(grid); -// case Meters: -// return inchesToMeters(grid); -// case KgPerM2: -// return inchesToKgPerM2(grid); - default: - } - throw new UnsupportedOperationException("Units covertion from inches to ("+destUnits+") not currently supported"); - } - public static float[][] convertInches(Units destUnits, float[][] grid) { - switch(destUnits) { - case Inches: - return grid; -// case Feet: -// return inchesToFeet(grid); -// case Miles: -// return inchesToMiles(grid); -// case Meters: -// return inchesToMeters(grid); -// case KgPerM2: -// return inchesToKgPerM2(grid); - default: - } - throw new UnsupportedOperationException("Units covertion from inches to ("+destUnits+") not currently supported"); - } - public static double[][] convertInches(Units destUnits, double[][] grid) { - switch(destUnits) { - case Inches: - return grid; -// case Feet: -// return inchesToFeet(grid); -// case Miles: -// return inchesToMiles(grid); -// case Meters: -// return inchesToMeters(grid); -// case KgPerM2: -// return inchesToKgPerM2(grid); - default: - } - throw new UnsupportedOperationException("Units covertion from inches to ("+destUnits+") not currently supported"); - } - ////////////////////////////////////// convert Inches /////////////////////////////////////////////// - ////////////////////////////////////// convert Feet ////////////////////////////////////////////////// - - public static float convertFeet(Units destUnits, float value) { - switch(destUnits) { - case Inches: - return feetToInches(value); - case Feet: - return value; - case Miles: - return feetToMiles(value); - case Meters: - return feetToMeters(value); - case KgPerM2: - return feetToKgPerM2(value); - default: - } - throw new UnsupportedOperationException("Units covertion from feet to ("+destUnits+") not currently supported"); - } - public static double convertFeet(Units destUnits, double value) { - switch(destUnits) { - case Inches: - return feetToInches(value); - case Feet: - return value; - case Miles: - return feetToMiles(value); - case Meters: - return feetToMeters(value); - case KgPerM2: - return feetToKgPerM2(value); - default: - } - throw new UnsupportedOperationException("Units covertion from feet to ("+destUnits+") not currently supported"); - } - public static float[] convertFeet(Units destUnits, float[] array) { - switch(destUnits) { - case Inches: - return feetToInches(array); - case Feet: - return array; - case Miles: - return feetToMiles(array); - case Meters: - return feetToMeters(array); - case KgPerM2: - return feetToKgPerM2(array); - default: - } - throw new UnsupportedOperationException("Units covertion from feet to ("+destUnits+") not currently supported"); - } - public static double[] convertFeet(Units destUnits, double[] array) { - switch(destUnits) { - case Inches: - return feetToInches(array); - case Feet: - return array; - case Miles: - return feetToMiles(array); - case Meters: - return feetToMeters(array); - case KgPerM2: - return feetToKgPerM2(array); - default: - } - throw new UnsupportedOperationException("Units covertion from feet to ("+destUnits+") not currently supported"); - } - public static float[][] convertFeet(Units destUnits, float[][] grid) { - switch(destUnits) { - case Inches: - return feetToInches(grid); - case Feet: - return grid; - case Miles: - return feetToMiles(grid); - case Meters: - return feetToMeters(grid); - case KgPerM2: - return feetToKgPerM2(grid); - default: - } - throw new UnsupportedOperationException("Units covertion from feet to ("+destUnits+") not currently supported"); - } - public static double[][] convertFeet(Units destUnits, double[][] grid) { - switch(destUnits) { - case Inches: - return feetToInches(grid); - case Feet: - return grid; - case Miles: - return feetToMiles(grid); - case Meters: - return feetToMeters(grid); - case KgPerM2: - return feetToKgPerM2(grid); - default: - } - throw new UnsupportedOperationException("Units covertion from feet to ("+destUnits+") not currently supported"); - } - ////////////////////////////////////// convert Feet ////////////////////////////////////////////////// - ////////////////////////////////////// convert Meters /////////////////////////////////////////////// - - public static float convertMeters(Units destUnits, float value) { - switch(destUnits) { - case Inches: - return metersToInches(value); - case Feet: - return metersToFeet(value); - case Miles: - return metersToMiles(value); - case Meters: - return value; -// case KgPerM2: -// return metersToKgPerM2(value); - default: - } - throw new UnsupportedOperationException("Units covertion from meters to ("+destUnits+") not currently supported"); - } - public static double convertMeters(Units destUnits, double value) { - switch(destUnits) { - case Inches: - return metersToInches(value); - case Feet: - return metersToFeet(value); - case Miles: - return metersToMiles(value); - case Meters: - return value; -// case KgPerM2: -// return metersToKgPerM2(value); - default: - } - throw new UnsupportedOperationException("Units covertion from meters to ("+destUnits+") not currently supported"); - } - - public static float[] convertMeters(Units destUnits, float[] array) { - switch(destUnits) { - case Inches: - return metersToInches(array); - case Feet: - return metersToFeet(array); - case Miles: - return metersToMiles(array); - case Meters: - return array; -// case KgPerM2: -// return metersToKgPerM2(grid); - default: - } - throw new UnsupportedOperationException("Units covertion from meters to ("+destUnits+") not currently supported"); - } - public static double[] convertMeters(Units destUnits, double[] array) { - switch(destUnits) { - case Inches: - return metersToInches(array); - case Feet: - return metersToFeet(array); - case Miles: - return metersToMiles(array); - case Meters: - return array; -// case KgPerM2: -// return metersToKgPerM2(grid); - default: - } - throw new UnsupportedOperationException("Units covertion from meters to ("+destUnits+") not currently supported"); - } - public static float[][] convertMeters(Units destUnits, float[][] grid) { - switch(destUnits) { - case Inches: - return metersToInches(grid); - case Feet: - return metersToFeet(grid); - case Miles: - return metersToMiles(grid); - case Meters: - return grid; -// case KgPerM2: -// return metersToKgPerM2(grid); - default: - } - throw new UnsupportedOperationException("Units covertion from meters to ("+destUnits+") not currently supported"); - } - public static double[][] convertMeters(Units destUnits, double[][] grid) { - switch(destUnits) { - case Inches: - return metersToInches(grid); - case Feet: - return metersToFeet(grid); - case Miles: - return metersToMiles(grid); - case Meters: - return grid; -// case KgPerM2: -// return metersToKgPerM2(grid); - default: - } - throw new UnsupportedOperationException("Units covertion from meters to ("+destUnits+") not currently supported"); - } - - ////////////////////////////////////// convert Meters /////////////////////////////////////////////// - ////////////////////////////////////// convert Miles ///////////////////////////////////////////////// - - public static float convertMiles(Units destUnits, float value) { - switch(destUnits) { - case Inches: - return milesToInches(value); - case Feet: - return milesToFeet(value); - case Miles: - return value; - case Meters: - return milesToMeters(value); - default: - } - throw new UnsupportedOperationException("Units covertion from miles to ("+destUnits+") not currently supported"); - } - public static double convertMiles(Units destUnits, double value) { - switch(destUnits) { - case Inches: - return milesToInches(value); - case Feet: - return milesToFeet(value); - case Miles: - return value; - case Meters: - return milesToMeters(value); - default: - } - throw new UnsupportedOperationException("Units covertion from miles to ("+destUnits+") not currently supported"); - } - public static float[] convertMiles(Units destUnits, float[] array) { - switch(destUnits) { - case Inches: - return milesToInches(array); - case Feet: - return milesToFeet(array); - case Miles: - return array; - case Meters: - return milesToMeters(array); - default: - } - throw new UnsupportedOperationException("Units covertion from miles to ("+destUnits+") not currently supported"); - } - public static float[][] convertMiles(Units destUnits, float[][] grid) { - switch(destUnits) { - case Inches: - return milesToInches(grid); - case Feet: - return milesToFeet(grid); - case Miles: - return grid; - case Meters: - return milesToMeters(grid); - default: - } - throw new UnsupportedOperationException("Units covertion from miles to ("+destUnits+") not currently supported"); - } - public static double[] convertMiles(Units destUnits, double[] array) { - switch(destUnits) { - case Inches: - return milesToInches(array); - case Feet: - return milesToFeet(array); - case Miles: - return array; - case Meters: - return milesToMeters(array); - default: - } - throw new UnsupportedOperationException("Units covertion from miles to ("+destUnits+") not currently supported"); - } - public static double[][] convertMiles(Units destUnits, double[][] grid) { - switch(destUnits) { - case Inches: - return milesToInches(grid); - case Feet: - return milesToFeet(grid); - case Miles: - return grid; - case Meters: - return milesToMeters(grid); - default: - } - throw new UnsupportedOperationException("Units covertion from miles to ("+destUnits+") not currently supported"); - } - - ////////////////////////////////////// convert Miles ///////////////////////////////////////////////// - ////////////////////////////////////// convert KgPerM2 //////////////////////////////////////////// - - public static float convertKgPerM2(Units destUnits, float value) { - switch(destUnits) { - case Inches: - return kgPerM2ToInches(value); - case KgPerM2: - return value; - default: - } - throw new UnsupportedOperationException("Units covertion from kgPerM2 to ("+destUnits+") not currently supported"); - } - - public static double convertKgPerM2(Units destUnits, double value) { - throw new UnsupportedOperationException("Implement this convertion"); - } - - public static float[] convertKgPerM2(Units destUnits, float[] array) { - switch(destUnits) { - case Inches: - return kgPerM2ToInches(array); - case KgPerM2: - return array; - default: - } - throw new UnsupportedOperationException("Units covertion from kgPerM2 to ("+destUnits+") not currently supported"); - } - - public static double[] convertKgPerM2(Units destUnits, double[] array) { - switch(destUnits) { - case Inches: - return kgPerM2ToInches(array); - case KgPerM2: - return array; - default: - } - throw new UnsupportedOperationException("Units covertion from kgPerM2 to ("+destUnits+") not currently supported"); - } - - public static float[][] convertKgPerM2(Units destUnits, float[][] grid) { - switch(destUnits) { - case Inches: - return kgPerM2ToInches(grid); - case KgPerM2: - return grid; - default: - } - throw new UnsupportedOperationException("Units covertion from kgPerM2 to ("+destUnits+") not currently supported"); - } - - public static double[][] convertKgPerM2(Units destUnits, double[][] grid) { - throw new UnsupportedOperationException("Implement this convertion"); - } - - ////////////////////////////////////// convert KgPerM2 //////////////////////////////////////////// - ////////////////////////////////////// convert Fahrenheit /////////////////////////////////////////// - - public static float convertFahrenheit(Units destUnits, float value) { - switch(destUnits) { - case Kelvin: - return fahrenheitToKelvin(value); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - - public static double convertFahrenheit(Units destUnits, double value) { - switch(destUnits) { - case Kelvin: - return fahrenheitToKelvin(value); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - - public static float[] convertFahrenheit(Units destUnits, float[] array) { - switch(destUnits) { - case Kelvin: - return fahrenheitToKelvin(array); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - public static double[] convertFahrenheit(Units destUnits, double[] array) { - switch(destUnits) { - case Kelvin: - return fahrenheitToKelvin(array); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - - public static float[][] convertFahrenheit(Units destUnits, float[][] grid) { - switch(destUnits) { - case Kelvin: - return fahrenheitToKelvin(grid); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - public static double[][] convertFahrenheit(Units destUnits, double[][] grid) { - switch(destUnits) { - case Kelvin: - return fahrenheitToKelvin(grid); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - - ////////////////////////////////////// convert Fahrenheit ////////////////////////////////////////// - ////////////////////////////////////// convert Kelvin //////////////////////////////////////////////// - - public static float convertKelvin(Units destUnits, float value) { - switch(destUnits) { - case Fahrenheit: - return kelvinToFahrenheit(value); - case Celsius: - return kelvinToCelcius(value); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - - public static double convertKelvin(Units destUnits, double value) { - switch(destUnits) { - case Fahrenheit: - return kelvinToFahrenheit(value); - case Celsius: - return kelvinToCelcius(value); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - - public static float[] convertKelvin(Units destUnits, float[] array) { - switch(destUnits) { - case Fahrenheit: - return kelvinToFahrenheit(array); - case Celsius: - return kelvinToCelcius(array); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - public static double[] convertKelvin(Units destUnits, double[] array) { - switch(destUnits) { - case Fahrenheit: - return kelvinToFahrenheit(array); - case Celsius: - return kelvinToCelcius(array); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - - public static float[][] convertKelvin(Units destUnits, float[][] grid) { - switch(destUnits) { - case Fahrenheit: - return kelvinToFahrenheit(grid); - case Celsius: - return kelvinToCelcius(grid); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - public static double[][] convertKelvin(Units destUnits, double[][] grid) { - switch(destUnits) { - case Fahrenheit: - return kelvinToFahrenheit(grid); - case Celsius: - return kelvinToCelcius(grid); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - - ////////////////////////////////////// convert Kelvin //////////////////////////////////////////////// - ////////////////////////////////////// convert Celcius //////////////////////////////////////////////// - - public static float convertCelcius(Units destUnits, float value) { - switch(destUnits) { - case Fahrenheit: - return celciusToFahrenheit(value); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - - public static double convertCelcius(Units destUnits, double value) { - switch(destUnits) { - case Fahrenheit: - return celciusToFahrenheit(value); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - - public static float[] convertCelcius(Units destUnits, float[] array) { - switch(destUnits) { - case Fahrenheit: - return celciusToFahrenheit(array); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - - public static double[] convertCelcius(Units destUnits, double[] array) { - switch(destUnits) { - case Fahrenheit: - return celciusToFahrenheit(array); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - - public static float[][] convertCelcius(Units destUnits, float[][] grid) { - switch(destUnits) { - case Fahrenheit: - return celciusToFahrenheit(grid); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - public static double[][] convertCelcius(Units destUnits, double[][] grid) { - switch(destUnits) { - case Fahrenheit: - return celciusToFahrenheit(grid); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - - ////////////////////////////////////// convert Celcius ////////////////////////////////////////////// - ////////////////////////////////////// convert Pascals ////////////////////////////////////////////// - - public static float convertPascals(Units destUnits, float value) { - switch(destUnits) { - case MilliBars: - return pascalsToMilliBars(value); - case InchesOfMercury: - return pascalsToInchesOfMercury(value); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - - public static double convertPascals(Units destUnits, double value) { - switch(destUnits) { - case MilliBars: - return pascalsToMilliBars(value); - case InchesOfMercury: - return pascalsToInchesOfMercury(value); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - - public static float[] convertPascals(Units destUnits, float[] array) { - switch(destUnits) { - case MilliBars: - return pascalsToMilliBars(array); - case InchesOfMercury: - return pascalsToInchesOfMercury(array); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - - public static double[] convertPascals(Units destUnits, double[] array) { - switch(destUnits) { - case MilliBars: - return pascalsToMilliBars(array); - case InchesOfMercury: - return pascalsToInchesOfMercury(array); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - - public static float[][] convertPascals(Units destUnits, float[][] grid) { - switch(destUnits) { - case MilliBars: - return pascalsToMilliBars(grid); - case InchesOfMercury: - return pascalsToInchesOfMercury(grid); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - public static double[][] convertPascals(Units destUnits, double[][] grid) { - switch(destUnits) { - case MilliBars: - return pascalsToMilliBars(grid); - case InchesOfMercury: - return pascalsToInchesOfMercury(grid); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - - ////////////////////////////////////// convert Pascals ////////////////////////////////////////////// - ////////////////////////////////////// convert MetersPerSecond ///////////////////////////////// - - public static float convertMetersPerSecond(Units destUnits, float value) { - switch(destUnits) { - case MilesPerHour: - return metersPerSecToMilesPerHour(value); - case MetersPerHour: - return metersPerSecToMetersPerHour(value); - case Knots: - return metersPerSecToKnots(value); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - - public static double convertMetersPerSecond(Units destUnits, double value) { - switch(destUnits) { - case MilesPerHour: - return metersPerSecToMilesPerHour(value); - case MetersPerHour: - return metersPerSecToMetersPerHour(value); - case Knots: - return metersPerSecToKnots(value); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - - public static float[] convertMetersPerSecond(Units destUnits, float[] array) { - switch(destUnits) { - case MilesPerHour: - return metersPerSecToMilesPerHour(array); - case MetersPerHour: - return metersPerSecToMetersPerHour(array); - case Knots: - return metersPerSecToKnots(array); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - - public static double[] convertMetersPerSecond(Units destUnits, double[] array) { - switch(destUnits) { - case MilesPerHour: - return metersPerSecToMilesPerHour(array); - case MetersPerHour: - return metersPerSecToMetersPerHour(array); - case Knots: - return metersPerSecToKnots(array); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - public static float[][] convertMetersPerSecond(Units destUnits, float[][] grid) { - switch(destUnits) { - case MilesPerHour: - return metersPerSecToMilesPerHour(grid); - case MetersPerHour: - return metersPerSecToMetersPerHour(grid); - case Knots: - return metersPerSecToKnots(grid); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - public static double[][] convertMetersPerSecond(Units destUnits, double[][] grid) { - switch(destUnits) { - case MilesPerHour: - return metersPerSecToMilesPerHour(grid); - case MetersPerHour: - return metersPerSecToMetersPerHour(grid); - case Knots: - return metersPerSecToKnots(grid); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - - ////////////////////////////////////// convert MetersPerSecond ///////////////////////////////// - ////////////////////////////////////// convert MilesPerHour //////////////////////////////////////// - - public static float convertMilesPerHour(Units destUnits, float value) { - switch(destUnits) { - case MetersPerSecond: - return milesPerHourToMetersPerSec(value); - case MetersPerHour: - return milesPerHourToMetersPerHour(value); - case Knots: - return milesPerHourToKnots(value); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - - public static double convertMilesPerHour(Units destUnits, double value) { - switch(destUnits) { - case MetersPerSecond: - return milesPerHourToMetersPerSec(value); - case MetersPerHour: - return milesPerHourToMetersPerHour(value); - case Knots: - return milesPerHourToKnots(value); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - - public static float[] convertMilesPerHour(Units destUnits, float[] array) { - switch(destUnits) { - case MetersPerSecond: - return milesPerHourToMetersPerSec(array); - case MetersPerHour: - return milesPerHourToMetersPerHour(array); - case Knots: - return milesPerHourToKnots(array); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - - public static double[] convertMilesPerHour(Units destUnits, double[] array) { - switch(destUnits) { - case MetersPerSecond: - return milesPerHourToMetersPerSec(array); - case MetersPerHour: - return milesPerHourToMetersPerHour(array); - case Knots: - return milesPerHourToKnots(array); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - public static float[][] convertMilesPerHour(Units destUnits, float[][] grid) { - switch(destUnits) { - case MetersPerSecond: - return milesPerHourToMetersPerSec(grid); - case MetersPerHour: - return milesPerHourToMetersPerHour(grid); - case Knots: - return milesPerHourToKnots(grid); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - public static double[][] convertMilesPerHour(Units destUnits, double[][] grid) { - switch(destUnits) { - case MetersPerSecond: - return milesPerHourToMetersPerSec(grid); - case MetersPerHour: - return milesPerHourToMetersPerHour(grid); - case Knots: - return milesPerHourToKnots(grid); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - - ////////////////////////////////////// convert MilesPerHour //////////////////////////////////////// - ////////////////////////////////////// convert Knots //////////////////////////////////////////////////// - - public static float convertKnots(Units destUnits, float value) { - switch(destUnits) { - case MetersPerSecond: - return knotsToMetersPerSec(value); - case MetersPerHour: - return knotsToMetersPerHour(value); - case MilesPerHour: - return knotsToMilesPerHour(value); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - - public static double convertKnots(Units destUnits, double value) { - switch(destUnits) { - case MetersPerSecond: - return knotsToMetersPerSec(value); - case MetersPerHour: - return knotsToMetersPerHour(value); - case MilesPerHour: - return knotsToMilesPerHour(value); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - - public static float[] convertKnots(Units destUnits, float[] array) { - switch(destUnits) { - case MetersPerSecond: - return knotsToMetersPerSec(array); - case MetersPerHour: - return knotsToMetersPerHour(array); - case MilesPerHour: - return knotsToMilesPerHour(array); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - - public static double[] convertKnots(Units destUnits, double[] array) { - switch(destUnits) { - case MetersPerSecond: - return knotsToMetersPerSec(array); - case MetersPerHour: - return knotsToMetersPerHour(array); - case MilesPerHour: - return knotsToMilesPerHour(array); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - public static float[][] convertKnots(Units destUnits, float[][] grid) { - switch(destUnits) { - case MetersPerSecond: - return knotsToMetersPerSec(grid); - case MetersPerHour: - return knotsToMetersPerHour(grid); - case MilesPerHour: - return knotsToMilesPerHour(grid); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - public static double[][] convertKnots(Units destUnits, double[][] grid) { - switch(destUnits) { - case MetersPerSecond: - return knotsToMetersPerSec(grid); - case MetersPerHour: - return knotsToMetersPerHour(grid); - case MilesPerHour: - return knotsToMilesPerHour(grid); - default: - } - throw new UnsupportedOperationException("Implement this convertion for ("+destUnits+")"); - } - - ////////////////////////////////////// convert Knots ////////////////////////////////////////////////// - ////////////////////////////////////// convert Fahrenheit /////////////////////////////////////////// - - public static float fahrenheitToKelvin(float value) { - return (float)((value - 32) * fiveNinth + 273.15); - } - public static double fahrenheitToKelvin(double value) { - return (value - 32) * fiveNinth + 273.15; - } - public static float[] fahrenheitToKelvin(float[] array) { - for(int i=array.length-1; i>=0; i--) { - array[i] = (float)((array[i] - 32) * fiveNinth + 273.15); - } - return array; - } - public static double[] fahrenheitToKelvin(double[] array) { - for(int i=array.length-1; i>=0; i--) { - array[i] = (array[i] - 32) * fiveNinth + 273.15; - } - return array; - } - public static float[][] fahrenheitToKelvin(float[][] grid) { - int d1=grid.length, d2=grid[0].length; - for(int i=0; i=0; i--) { - array[i] = (float)((array[i] - 273.15) * nineFifth + 32); - } - return array; - } - public static double[] kelvinToFahrenheit(double[] array) { - for(int i=array.length-1; i>=0; i--) { - array[i] = (array[i] - 273.15) * nineFifth + 32; - } - return array; - } - public static float[][] kelvinToFahrenheit(float[][] grid) { - int d1=grid.length, d2=grid[0].length; - for(int i=0; i=0; i--) { - array[i] = (float)(array[i] - 273.15); - } - return array; - } - public static double[] kelvinToCelcius(double[] array) { - for(int i=array.length-1; i>=0; i--) { - array[i] = array[i] - 273.15; - } - return array; - } - public static float[][] kelvinToCelcius(float[][] grid) { - int d1=grid.length, d2=grid[0].length; - for(int i=0; i=0; i--) { - array[i] = (float)(array[i] * nineFifth + 32); - } - return array; - } - public static double[] celciusToFahrenheit(double[] array) { - for(int i=array.length-1; i>=0; i--) { - array[i] = array[i] * nineFifth + 32; - } - return array; - } - public static float[][] celciusToFahrenheit(float[][] grid) { - int d1=grid.length, d2=grid[0].length; - for(int i=0; i=0; i--) { - array[i] = (float)(array[i] / 100.0); - } - return array; - } - public static double[] pascalsToMilliBars(double[] array) { - for(int i=array.length-1; i>=0; i--) { - array[i] = array[i] / 100.0; - } - return array; - } - public static float[][] pascalsToMilliBars(float[][] grid) { - int d1=grid.length, d2=grid[0].length; - for(int i=0; i=0; i--) { - array[i] = (float)(array[i] / 3386.4); - } - return array; - } - public static double[] pascalsToInchesOfMercury(double[] array) { - for(int i=array.length-1; i>=0; i--) { - array[i] = array[i] / 3386.4; - } - return array; - } - public static float[][] pascalsToInchesOfMercury(float[][] grid) { - int d1=grid.length, d2=grid[0].length; - for(int i=0; i=0; i--) { - array[i] = (float)((array[i] * 2.23693629)); - } - return array; - } - public static double[] metersPerSecToMilesPerHour(double[] array) { - for(int i=array.length-1; i>=0; i--) { - array[i] = (array[i] * 2.23693629); - } - return array; - } - public static float[][] metersPerSecToMilesPerHour(float[][] grid) { - int d1=grid.length, d2=grid[0].length; - for(int i=0; i=0; i--) { - array[i] = (float)((array[i] * 3600.0)); - } - return array; - } - public static double[] metersPerSecToMetersPerHour(double[] array) { - for(int i=array.length-1; i>=0; i--) { - array[i] = (array[i] * 3600.0); - } - return array; - } - public static float[][] metersPerSecToMetersPerHour(float[][] grid) { - int d1=grid.length, d2=grid[0].length; - for(int i=0; i=0; i--) { - array[i] = (float)((array[i] * 1.94384449)); - } - return array; - } - public static double[] metersPerSecToKnots(double[] array) { - for(int i=array.length-1; i>=0; i--) { - array[i] = (array[i] * 1.94384449); - } - return array; - } - public static float[][] metersPerSecToKnots(float[][] grid) { - int d1=grid.length, d2=grid[0].length; - for(int i=0; i=0; i--) { - array[i] = (float)((array[i] * 0.44704)); - } - return array; - } - public static double[] milesPerHourToMetersPerSec(double[] array) { - for(int i=array.length-1; i>=0; i--) { - array[i] = (array[i] * 0.44704); - } - return array; - } - public static float[][] milesPerHourToMetersPerSec(float[][] grid) { - int d1=grid.length, d2=grid[0].length; - for(int i=0; i=0; i--) { - array[i] = (float)((array[i] * 1609.344)); - } - return array; - } - public static double[] milesPerHourToMetersPerHour(double[] array) { - for(int i=array.length-1; i>=0; i--) { - array[i] = (array[i] * 1609.344); - } - return array; - } - public static float[][] milesPerHourToMetersPerHour(float[][] grid) { - int d1=grid.length, d2=grid[0].length; - for(int i=0; i=0; i--) { - array[i] = (float)((array[i] * 0.868976242)); - } - return array; - } - public static double[] milesPerHourToKnots(double[] array) { - for(int i=array.length-1; i>=0; i--) { - array[i] = (array[i] * 0.868976242); - } - return array; - } - public static float[][] milesPerHourToKnots(float[][] grid) { - int d1=grid.length, d2=grid[0].length; - for(int i=0; i=0; i--) { - array[i] = (float)((array[i] * 0.514444445)); - } - return array; - } - public static double[] knotsToMetersPerSec(double[] array) { - for(int i=array.length-1; i>=0; i--) { - array[i] = (array[i] * 0.514444445); - } - return array; - } - public static float[][] knotsToMetersPerSec(float[][] grid) { - int d1=grid.length, d2=grid[0].length; - for(int i=0; i=0; i--) { - array[i] = (float)((array[i] * 1852.0)); - } - return array; - } - public static double[] knotsToMetersPerHour(double[] array) { - for(int i=array.length-1; i>=0; i--) { - array[i] = (array[i] * 1852.0); - } - return array; - } - public static float[][] knotsToMetersPerHour(float[][] grid) { - int d1=grid.length, d2=grid[0].length; - for(int i=0; i=0; i--) { - array[i] = (float)((array[i] * 1.150779448)); - } - return array; - } - public static double[] knotsToMilesPerHour(double[] array) { - for(int i=array.length-1; i>=0; i--) { - array[i] = (array[i] * 1.150779448); - } - return array; - } - public static float[][] knotsToMilesPerHour(float[][] grid) { - int d1=grid.length, d2=grid[0].length; - for(int i=0; i=0; i--) { - array[i] = (float)(array[i]*12.0); - } - return array; - } - public static double[] feetToInches(double[] array) { - for(int i=array.length-1; i>=0; i--) { - array[i] = array[i]*12.0; - } - return array; - } - public static float[][] feetToInches(float[][] grid) { - int d1=grid.length, d2=grid[0].length; - for(int i=0; i=0; i--) { - array[i] = (float)(array[i]/5280.0); - } - return array; - } - public static double[] feetToMiles(double[] array) { - for(int i=array.length-1; i>=0; i--) { - array[i] = array[i]/5280.0; - } - return array; - } - public static float[][] feetToMiles(float[][] grid) { - int d1=grid.length, d2=grid[0].length; - for(int i=0; i=0; i--) { - array[i] = (float)(array[i]/0.3048); - } - return array; - } - public static double[] feetToMeters(double[] array) { - for(int i=array.length-1; i>=0; i--) { - array[i] = array[i]/0.3048; - } - return array; - } - public static float[][] feetToMeters(float[][] grid) { - int d1=grid.length, d2=grid[0].length; - for(int i=0; i=0; i--) { - array[i] = (float)(array[i] * 39.37007874); - } - return array; - } - public static double[] metersToInches(double[] array) { - for(int i=array.length-1; i>=0; i--) { - array[i] = array[i] * 39.37007874; - } - return array; - } - public static float[][] metersToInches(float[][] grid) { - int d1=grid.length, d2=grid[0].length; - for(int i=0; i=0; i--) { - array[i] = (float)(array[i] * 0.3048); - } - return array; - } - public static double[] metersToFeet(double[] array) { - for(int i=array.length-1; i>=0; i--) { - array[i] = array[i] * 0.3048; - } - return array; - } - public static float[][] metersToFeet(float[][] grid) { - int d1=grid.length, d2=grid[0].length; - for(int i=0; i=0; i--) { - array[i] = (float)(array[i] / 1609.344); - } - return array; - } - public static double[] metersToMiles(double[] array) { - for(int i=array.length-1; i>=0; i--) { - array[i] = (array[i] / 1609.344); - } - return array; - } - public static float[][] metersToMiles(float[][] grid) { - int d1=grid.length, d2=grid[0].length; - for(int i=0; i=0; i--) { - array[i] = (float)(array[i]*63360); - } - return array; - } - public static double[] milesToInches(double[] array) { - for(int i=array.length-1; i>=0; i--) { - array[i] = array[i]*63360; - } - return array; - } - public static float[][] milesToInches(float[][] grid) { - int d1=grid.length, d2=grid[0].length; - for(int i=0; i=0; i--) { - array[i] = (float)(array[i]*5280); - } - return array; - } - public static double[] milesToFeet(double[] array) { - for(int i=array.length-1; i>=0; i--) { - array[i] = array[i]*5280; - } - return array; - } - public static float[][] milesToFeet(float[][] grid) { - int d1=grid.length, d2=grid[0].length; - for(int i=0; i=0; i--) { - array[i] = (float)(array[i]*1609.344); - } - return array; - } - public static double[] milesToMeters(double[] array) { - for(int i=array.length-1; i>=0; i--) { - array[i] = array[i]*1609.344; - } - return array; - } - public static float[][] milesToMeters(float[][] grid) { - int d1=grid.length, d2=grid[0].length; - for(int i=0; i=0; i--) { - array[i] *= 0.03937; - } - return array; - } - public static double[] kgPerM2ToInches(double[] array) { - for(int i=array.length-1; i>=0; i--) { - array[i] *= 0.03937; - } - return array; - } - public static float[][] kgPerM2ToInches(float[][] grid) { - int d1=grid.length, d2=grid[0].length; - for(int i=0; i map; - - // Instantiating the static map, must be on entry per IElement type - static - { - map = new HashMap<>(); - - map.put("1 hour rainfall", RAIN1HR); - map.put("1 HR RAINFALL", RAIN1HR); - map.put("3 hour rainfall", RAIN3HR); - map.put("3 HR RAINFALL", RAIN3HR); - map.put("6 hour rainfall", RAIN6HR); - map.put("6 HR RAINFALL", RAIN6HR); - map.put("12 hour rainfall", RAIN12HR); - map.put("12 HR RAINFALL", RAIN12HR); - map.put("24 hour rainfall", RAIN24HR); - map.put("24 HR RAINFALL", RAIN24HR); - - map.put("1 hour snowfall", SNOW1HR); - map.put("1 HR SNOWFALL", SNOW1HR); - map.put("3 hour snowfall", SNOW3HR); - map.put("3 HR SNOWFALL", SNOW3HR); - map.put("6 hour snowfall", SNOW6HR); - map.put("6 HR SNOWFALL", SNOW6HR); - map.put("12 hour snowfall", SNOW12HR); - map.put("12 HR SNOWFALL", SNOW12HR); - map.put("24 hour snowfall", SNOW24HR); - map.put("24 HR SNOWFALL", SNOW24HR); - - map.put("1 hour ice accumulation", ICE1HR); - map.put("1 HR ICE ACCUMULATION", ICE1HR); - map.put("3 hour ice accumulation", ICE3HR); - map.put("3 HR ICE ACCUMULATION", ICE3HR); - map.put("6 hour ice accumulation", ICE6HR); - map.put("6 HR ICE ACCUMULATION", ICE6HR); - map.put("12 hour ice accumulation", ICE12HR); - map.put("12 HR ICE ACCUMULATION", ICE12HR); - map.put("24 hour ice accumulation", ICE24HR); - map.put("24 HR ICE ACCUMULATION", ICE24HR); - - map.put("Temperature", TEMP); - map.put("TEMPERATURE", TEMP); - - map.put("relative Humidity", RH); - map.put("Relative Humidity", RH); - map.put("RELATIVE HUMIDITY", RH); - map.put("RELATIVEHUMIDITY", RH); - - map.put("dewpoint", TD); - map.put("dew point", TD); - map.put("Dewpoint", TD); - map.put("Dew point", TD); - map.put("DEWPOINT", TD); - map.put("DEW POINT", TD); - map.put("dew point temperature", TD); - map.put("Dew point temperature", TD); - map.put("Dew Point Temperature", TD); - map.put("DewPointTemperature", TD); - - map.put("visibility", VIS); - map.put("Visibility", VIS); - map.put("VISIBILITY", VIS); - - map.put("ceiling", CIG); - map.put("Ceiling", CIG); - map.put("CEILING", CIG); - - map.put("wind speed", WINDSPEED); - map.put("Wind speed", WINDSPEED); - map.put("Wind Speed", WINDSPEED); - map.put("Wind Speed (Sustained)", WINDSPEED); - map.put("WIND SPEED", WINDSPEED); - - map.put("wind gust", WINDGUST); - map.put("Wind gust", WINDGUST); - map.put("Wind Gust", WINDGUST); - map.put("WIND GUST", WINDGUST); - - map.put("wind direction", WINDDIR); - map.put("Wind direction", WINDDIR); - map.put("Wind Direction", WINDDIR); - map.put("WIND DIRECTION", WINDDIR); - - map.put("wind chill", WINDCHILL); - map.put("Wind chill", WINDCHILL); - map.put("Wind Chill", WINDCHILL); - map.put("WIND CHILL", WINDCHILL); - - map.put("heat index", HEATINDEX); - map.put("Heat index", HEATINDEX); - map.put("Heat Index", HEATINDEX); - map.put("HEAT INDEX", HEATINDEX); - - map.put("lightning", LIGHTNING); - map.put("Lightning", LIGHTNING); - - map.put("WEATHER TYPE INCLUDES RAIN", WXRAIN); - map.put("WEATHER TYPE INCLUDES SNOW", WXSNOW); - map.put("WEATHER TYPE INCLUDES FREEZING RAIN", WXFRZR); - map.put("WEATHER TYPE INCLUDES THUNDERSTORM", WXTHDR); - - map.put("WEATHER TYPE INCLUDES FREEZING PRECIP", WXFRZP); - map.put("FREEZING PRECIP", WXFRZP); - - map.put("RDSBFRZP", RDSBFRZP); - map.put("Road Subfreeze", RDSBFRZP); - map.put("ROAD SUBFREEZE", RDSBFRZP); - } - - public static Field get(String fieldString) { - if(fieldString.startsWith("CHANCE OF ")) fieldString = fieldString.substring(10); - else if(fieldString.startsWith("PROB OF ")) fieldString = fieldString.substring(8); -//System.out.println("->"+fieldString+"<-"); - Field field = map.get(fieldString); - if(field == null) - field = valueOf(fieldString); - if(field == null) - throw new IllegalArgumentException("Invalid element string ("+fieldString+")"); - return field; - } - - /* - public static Units getUnits(Field elm) { - switch(elm) { - case RAIN1HR: - case RAIN3HR: - case RAIN6HR: - case RAIN12HR: - case RAIN24HR: - case SNOW1HR: - case SNOW3HR: - case SNOW6HR: - case SNOW12HR: - case SNOW24HR: - case ICE1HR: - case ICE3HR: - case ICE6HR: - case ICE12HR: - case ICE24HR: - return Units.Inches; - case TEMP: - return Units.Fahrenheit; - case RH: - return Units.Percent; - case TD: - return Units.Fahrenheit; - case VIS: - return Units.Miles; - case CIG: - return Units.Feet; - case WINDSPEED: - case WINDGUST: - return Units.MilesPerHour; - case WINDDIR: - return Units.DegreesNorth; - case LIGHTNING: - return Units.Strikes; - case SPCSEVERE: - case SPCFIRE: - return Units.Level; - case WXTYPEIS: - return Units.Cat; - case WPCRAINFALL: - return Units.Percent; - case WXFRZR: - return Units.Bool; - case WXFRZP: - return Units.Bool; - - default: - throw new RuntimeException("Passed Field does not have orresponding Units"); - } - } - */ - - - -} diff --git a/java/src/main/java/gov/noaa/gsl/idssEngine/commons/aspect/Relational.java b/java/src/main/java/gov/noaa/gsl/idssEngine/commons/aspect/Relational.java deleted file mode 100644 index d2910532..00000000 --- a/java/src/main/java/gov/noaa/gsl/idssEngine/commons/aspect/Relational.java +++ /dev/null @@ -1,121 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2020 Regents of the University of Colorado. All rights reserved. - * - * Contributors: - * Geary Layne - *******************************************************************************/ -package gov.noaa.gsl.idssEngine.commons.aspect; - -import java.util.HashMap; -import java.util.Map; - -public enum Relational { - - // new Condition type must be added to lookup map - EQUAL, - GREATERTHAN, - GREATERTHANOREQUAL, - LESSTHAN, - LESSTHANOREQUAL, - BETWEEN; - - - public static Relational get(String relationalString) { - Relational relational = map.get(relationalString); - if(relational == null) - relational = valueOf(relationalString); - if(relational == null) - throw new IllegalArgumentException("Invalid condition string ("+relationalString+")"); - return relational; - } - - // Declaring the static lookup map - private static Map map; - - // Instantiating the static map, must be on entry per IrisCondition type - static - { - map = new HashMap<>(); - map.put("equal", EQUAL); - map.put("Equal", EQUAL); - map.put("equal to", EQUAL); - map.put("Equal to", EQUAL); - map.put("EQUALTO", EQUAL); - map.put("EQUAL TO", EQUAL); - map.put("EQ", EQUAL); - - map.put("greaterthan", GREATERTHAN); - map.put("Greaterthan", GREATERTHAN); -// map.put("GREATERTHAN", GREATERTHAN); - map.put("greater than", GREATERTHAN); - map.put("Greater than", GREATERTHAN); - map.put("Greater Than", GREATERTHAN); - map.put("GREATER THAN", GREATERTHAN); - map.put("more than", GREATERTHAN); - map.put("More Than", GREATERTHAN); - map.put("MORE THAN", GREATERTHAN); - map.put("GT", GREATERTHAN); - - map.put("greaterthanorequal", GREATERTHANOREQUAL); - map.put("Greaterthanorequal", GREATERTHANOREQUAL); -// map.put("GREATERTHANOREQUAL", GREATERTHANOREQUAL); - map.put("greater than or equal", GREATERTHANOREQUAL); - map.put("Greater than or equal", GREATERTHANOREQUAL); - map.put("Greater Than Or Equal", GREATERTHANOREQUAL); - map.put("GREATER THAN OR EQUAL", GREATERTHANOREQUAL); - map.put("greaterthanorequalto", GREATERTHANOREQUAL); - map.put("Greaterthanorequalto", GREATERTHANOREQUAL); - map.put("GREATERTHANOREQUALTO", GREATERTHANOREQUAL); - map.put("greater than or equal to", GREATERTHANOREQUAL); - map.put("Greater than or equal to", GREATERTHANOREQUAL); - map.put("Greater Than Or Equal To", GREATERTHANOREQUAL); - map.put("GREATER THAN OR EQUAL TO", GREATERTHANOREQUAL); - map.put("GTE", GREATERTHANOREQUAL); - - map.put("lessthan", LESSTHAN); - map.put("Lessthan", LESSTHAN); -// map.put("LESSTHAN", LESSTHAN); - map.put("less than", LESSTHAN); - map.put("Less than", LESSTHAN); - map.put("Less Than", LESSTHAN); - map.put("LESS THAN", LESSTHAN); - map.put("LT", LESSTHAN); - - map.put("lessthanorequal", LESSTHANOREQUAL); - map.put("Lessthanorequal", LESSTHANOREQUAL); -// map.put("LESSTHANOREQUAL", LESSTHANOREQUAL); - map.put("less than or equal", LESSTHANOREQUAL); - map.put("Less Than Or Equal", LESSTHANOREQUAL); - map.put("LESS THAN OR EQUAL", LESSTHANOREQUAL); - map.put("lessthanorequalto", LESSTHANOREQUAL); - map.put("Lessthanorequalto", LESSTHANOREQUAL); - map.put("LESSTHANOREQUALTO", LESSTHANOREQUAL); - map.put("less than or equal to", LESSTHANOREQUAL); - map.put("Less Than Or Equal To", LESSTHANOREQUAL); - map.put("LESS THAN OR EQUAL TO", LESSTHANOREQUAL); - map.put("LTE", LESSTHANOREQUAL); - - map.put("between", BETWEEN); - map.put("Between", BETWEEN); -// map.put("BETWEEN", BETWEEN); - map.put("BT", BETWEEN); - } - - public String toShortString() { - return toShortString(this); - } - - public static String toShortString(Relational relational) { - switch(relational) { - case EQUAL: return "EQ"; - case GREATERTHAN: return "GT"; - case GREATERTHANOREQUAL: return "GTE"; - case LESSTHAN: return "LT"; - case LESSTHANOREQUAL: return "LTE"; - case BETWEEN: return "BT"; - } - return null; - } - -} - diff --git a/java/src/main/java/gov/noaa/gsl/idssEngine/commons/aspect/Units.java b/java/src/main/java/gov/noaa/gsl/idssEngine/commons/aspect/Units.java deleted file mode 100644 index 6aaee6ac..00000000 --- a/java/src/main/java/gov/noaa/gsl/idssEngine/commons/aspect/Units.java +++ /dev/null @@ -1,121 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2020 Regents of the University of Colorado. All rights reserved. - * - * Contributors: - * Geary Layne - *******************************************************************************/ -package gov.noaa.gsl.idssEngine.commons.aspect; - -import java.util.HashMap; -import java.util.Map; - -public enum Units { - - // new IrisUnits type must be added to lookup map - Inches, - Feet, - Miles, - Meters, - KgPerM2, - MilesPerHour, - MetersPerSecond, - MetersPerHour, - Knots, - Fahrenheit, - Kelvin, - Celsius, - Percent, - Strikes, - DegreesNorth, - Pascals, - MilliBars, - InchesOfMercury, - WattsPerM2, - ThreatLevel, - Level, - Cat, - Bool, - None; - - public static Units get(String unitString) { - Units units = map.get(unitString); - if(units == null) - units = valueOf(unitString); - if(units == null) - throw new IllegalArgumentException("Invalid unit string ("+unitString+")"); - return units; - } - - // Declaring the static lookup map - private static Map map; - - // Instantiating the static map, must be on entry per IrisUnits type - static - { - map = new HashMap<>(); - map.put("inches", Inches); - map.put("INCHES", Inches); - map.put("feet", Feet); - map.put("FEET", Feet); - map.put("miles", Miles); - map.put("MILES", Miles); - map.put("m", Meters); - map.put("meters", Meters); - map.put("Meters", Meters); - map.put("METERS", Meters); - map.put("gpm", Meters); //TODO, approximately true - map.put("kg.m-2", KgPerM2); - map.put("kgPerM2", KgPerM2); - map.put("mph", MilesPerHour); - map.put("MPH", MilesPerHour); - map.put("milesPerHour", MilesPerHour); - map.put("miles per hour", MilesPerHour); - map.put("milesPerHour", MilesPerHour); - map.put("MILESPERHOUR", MilesPerHour); - map.put("MILES PER HOUR", MilesPerHour); - map.put("m/h", MetersPerHour); - map.put("m.s-1", MetersPerSecond); - map.put("m s**-1", MetersPerSecond); - map.put("m/s", MetersPerSecond); - map.put("metersPerSecond", MetersPerSecond); - map.put("Meters Per Second", MetersPerSecond); - map.put("meters per second", MetersPerSecond); - map.put("METERSPERSECOND", MetersPerSecond); - map.put("METERS PER SECOND", MetersPerSecond); - map.put("KNOTS", Knots); - map.put("knots", Knots); - map.put("KNOT", Knots); - map.put("knot", Knots); - map.put("KN", Knots); - map.put("kn", Knots); - map.put("F", Fahrenheit); - map.put("FAHRENHEIT", Fahrenheit); - map.put("DEG F", Fahrenheit); - map.put("K", Kelvin); - map.put("KELVIN", Kelvin); - map.put("C", Celsius); - map.put("CELSIUS", Celsius); - map.put("%", Percent); - map.put("percent", Percent); - map.put("PERCENT", Percent); - map.put("strikes", Strikes); - map.put("STRIKES", Strikes); - map.put("DegreesN", DegreesNorth); - map.put("DEG N", DegreesNorth); - map.put("Pa", Pascals); - map.put("pascals", Pascals); - map.put("PASCALS", Pascals); - map.put("millibars", MilliBars); - map.put("inHg", InchesOfMercury); - map.put("W.m-2", WattsPerM2); - map.put("wattsPerM2", WattsPerM2); - map.put("level", Level); - map.put("LEVEL", Level); - map.put("catagory", Cat); - map.put("Catagory", Cat); - map.put("bool", Bool); - map.put("BOOL", Bool); - } - - -} diff --git a/java/src/main/java/gov/noaa/gsl/idssEngine/commons/aspect/WxModel.java b/java/src/main/java/gov/noaa/gsl/idssEngine/commons/aspect/WxModel.java deleted file mode 100644 index 9ddcc363..00000000 --- a/java/src/main/java/gov/noaa/gsl/idssEngine/commons/aspect/WxModel.java +++ /dev/null @@ -1,71 +0,0 @@ -/********************************************************************************* - * Copyright (c) 2020 Regents of the University of Colorado. All rights reserved. - * - * Contributors: - * Geary Layne -*********************************************************************************/ -package gov.noaa.gsl.idssEngine.commons.aspect; - -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -public enum WxModel { - - ALL, - ANY, -// GFS, -// GEFS, -// HRRR, -// HRRRE, -// SREF, -// HREF, - NBM, -// NDFD, - NONE, - ; - -// public static Model[] allModels = {GFS, GEFS, HRRR, HRRRE, SREF, HREF, NBM, NDFD}; -// public static WxModel[] allModels = {NBM}; - - // Declaring the static lookup map - private static Map map; - - // Instantiating the static map, must be on entry per Weather Type - static - { - map = new HashMap<>(); - - map.put("Any model", ANY); - map.put("Any Model", ANY); - map.put("ANY MODEL", ANY); - map.put("All models", ALL); - map.put("All Models", ALL); - map.put("ALL MODELS", ALL); - map.put("None", NONE); - } - - public static WxModel get(String modelString) { - WxModel model = map.get(modelString); - if(model == null) - model = valueOf(modelString); - if(model == null) - throw new IllegalArgumentException("Invalid WxModel string ("+modelString+")"); - return model; - } - - public static WxModel[] getAllModels() { - WxModel[] allModels = WxModel.values(); - return Arrays.copyOf(allModels, allModels.length); - } - - public static String[] getAllModelsAsStrings() { - WxModel[] allModels = WxModel.values(); - int len = allModels.length; - String[] modelStrings = new String[len]; - int idx =0; - for(WxModel model : allModels) modelStrings[idx++] = model.toString(); - return modelStrings; - } -} - diff --git a/java/src/main/java/gov/noaa/gsl/idssEngine/commons/aspect/WxType.java b/java/src/main/java/gov/noaa/gsl/idssEngine/commons/aspect/WxType.java deleted file mode 100644 index b774d42d..00000000 --- a/java/src/main/java/gov/noaa/gsl/idssEngine/commons/aspect/WxType.java +++ /dev/null @@ -1,46 +0,0 @@ -/********************************************************************************* - * Copyright (c) 2020 Regents of the University of Colorado. All rights reserved. - * - * Contributors: - * Geary Layne -*********************************************************************************/ -package gov.noaa.gsl.idssEngine.commons.aspect; - -import java.util.HashMap; -import java.util.Map; - -public enum WxType { - - RAIN, - THUNDER, - SNOW, - ICE, - SLEET, - NONE, - ; - - // Declaring the static lookup map - private static Map map; - - // Instantiating the static map, must be on entry per Weather Type - static - { - map = new HashMap<>(); - - map.put("Rain", RAIN); - map.put("Thunderstorms", THUNDER); - map.put("Snow", SNOW); - map.put("Freezing Rain", ICE); - map.put("Sleet", SLEET); - map.put("None", NONE); - } - - public static WxType get(String wxTypeString) { - WxType wxType = map.get(wxTypeString); - if(wxType == null) - wxType = valueOf(wxTypeString); - if(wxType == null) - throw new IllegalArgumentException("Invalid WxType string ("+wxTypeString+")"); - return wxType; - } -} diff --git a/java/src/main/java/gov/noaa/gsl/idssEngine/commons/geo/Annulus.java b/java/src/main/java/gov/noaa/gsl/idssEngine/commons/geo/Annulus.java deleted file mode 100644 index 6b70e973..00000000 --- a/java/src/main/java/gov/noaa/gsl/idssEngine/commons/geo/Annulus.java +++ /dev/null @@ -1,58 +0,0 @@ -/********************************************************************************* - * Copyright (c) 2022 Regents of the University of Colorado. All rights reserved. - * - * Contributors: - * Geary Layne -*********************************************************************************/ -package gov.noaa.gsl.idssEngine.commons.geo; - -import org.locationtech.jts.geom.CoordinateSequence; -import org.locationtech.jts.geom.Geometry; -import org.locationtech.jts.geom.GeometryFactory; -import org.locationtech.jts.geom.Point; - -public class Annulus extends Point { - - private static final long serialVersionUID = -238226395010043772L; - - public static final String annulus = "Annulus"; - - public final double innerRadius; - public final double outerRadius; - - protected Annulus(CoordinateSequence coordinates, GeometryFactory factory) { - this(coordinates, 0, 0, factory); - } - private Annulus(CoordinateSequence coordinates, double outerRadius, double innerRadius, GeometryFactory factory) { - super(coordinates, factory); - this.outerRadius = outerRadius; - this.innerRadius = innerRadius; - } - - public Annulus(Point pnt, double outerRadius, double innerRadius) { - this(pnt.getCoordinateSequence(), outerRadius, innerRadius, pnt.getFactory()); - } - - @Override - public String getGeometryType() { - return annulus; - } - - @Override - public Geometry copy() { - return new Annulus((Point)super.copy(), outerRadius, innerRadius); - } - - public double getOuterRadius() { - return outerRadius; - } - - public double getInnerRadius() { - return innerRadius; - } - - @Override - public String toString() { - return String.format("ANNULUS (%s, RADIUS (%f, %f))", super.toString(), outerRadius, innerRadius); - } -} diff --git a/java/src/main/java/gov/noaa/gsl/idssEngine/commons/geo/Circle.java b/java/src/main/java/gov/noaa/gsl/idssEngine/commons/geo/Circle.java deleted file mode 100644 index c94eabaf..00000000 --- a/java/src/main/java/gov/noaa/gsl/idssEngine/commons/geo/Circle.java +++ /dev/null @@ -1,54 +0,0 @@ -/********************************************************************************* - * Copyright (c) 2022 Regents of the University of Colorado. All rights reserved. - * - * Contributors: - * Geary Layne -*********************************************************************************/ -package gov.noaa.gsl.idssEngine.commons.geo; - -import org.locationtech.jts.geom.CoordinateSequence; -import org.locationtech.jts.geom.Geometry; -import org.locationtech.jts.geom.GeometryFactory; -import org.locationtech.jts.geom.Point; - - -public class Circle extends Point { - - private static final long serialVersionUID = 4296686486631628512L; - - public static final String circle = "Circle"; - - final double radius; - - protected Circle(CoordinateSequence coordinates, GeometryFactory factory) { - this(coordinates, 0, factory); - } - private Circle(CoordinateSequence coordinates, double radius, GeometryFactory factory) { - super(coordinates, factory); - this.radius = radius; - } - - public Circle(Point pnt, double radius) { - this(pnt.getCoordinateSequence(), radius, pnt.getFactory()); - } - - @Override - public String getGeometryType() { - return circle; - } - - @Override - public Geometry copy() { - return new Circle((Point)super.copy(), radius); - } - - public double getRadius() { - return radius; - } - - @Override - public String toString() { - return String.format("CIRCLE (%s, RADIUS (%f))", super.toString(), radius); - } - -} diff --git a/java/src/main/java/gov/noaa/gsl/idssEngine/commons/geo/GeoCoords.java b/java/src/main/java/gov/noaa/gsl/idssEngine/commons/geo/GeoCoords.java deleted file mode 100644 index 43fb0c10..00000000 --- a/java/src/main/java/gov/noaa/gsl/idssEngine/commons/geo/GeoCoords.java +++ /dev/null @@ -1,175 +0,0 @@ -/********************************************************************************* - * Copyright (c) 2021 Regents of the University of Colorado. All rights reserved. - * - * Contributors: - * Geary Layne -*********************************************************************************/ -package gov.noaa.gsl.idssEngine.commons.geo; - -import java.awt.Point; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.NoSuchElementException; -import java.util.Set; - -public class GeoCoords implements Iterable { - - private List> coordSetList = null; - private List gridCoordList = null; - private boolean atLeastOne = false; - private int atMost = 0; - - public GeoCoords(Set coordSet) { - add(coordSet); - } - - public GeoCoords(int xOffset, int yOffset, byte[][] grid) { - add(xOffset, yOffset, grid); - } - - public GeoCoords add(Set coordSet) { - if(coordSet.size()>0) { -//System.out.println("adding Set"); - if(coordSetList == null) coordSetList = new ArrayList<>(); - coordSetList.add(coordSet); - atLeastOne = true; - atMost += coordSet.size(); - } - return this; - } - - public GeoCoords add(int xOffset, int yOffset, byte[][] grid) { - GridGeoCoords ggc = new GridGeoCoords(xOffset, yOffset, grid); - if(ggc.atLeastOne) { -//System.out.println("adding grid"); - if(gridCoordList == null) gridCoordList = new ArrayList<>(); - gridCoordList.add(ggc); - atLeastOne = true; - atMost += grid.length*grid[0].length; - } - return this; - } - - public boolean isEmpty() { - return !atLeastOne; - } - - public int atMost() { - return this.atMost; - } - - @Override - public Iterator iterator() { - return new ListsIterator(); - } - - class ListsIterator implements Iterator { - private int setIdx=-1, gridIdx=-1; - Iterator it = null; - - ListsIterator() { - if(coordSetList!=null) - setIdx = coordSetList.size(); - if(gridCoordList!=null) - gridIdx=gridCoordList.size(); - findNext(); - } - - @Override - public boolean hasNext() { - if(it==null) return false; - - if(it.hasNext()) return true; - - findNext(); - return hasNext(); - } - - @Override - public Point next() { - if(it==null) - throw new NoSuchElementException(); - - return it.next(); - } - - void findNext() { - for(setIdx--; setIdx>=0; setIdx--) { - it = coordSetList.get(setIdx).iterator(); - if(it.hasNext()) return; - } - - for(gridIdx--; gridIdx>=0; gridIdx--) { - it = gridCoordList.get(gridIdx).iterator(); - if(it.hasNext()) return; - } - it = null; - } - } - - class GridGeoCoords implements Iterable { - private final int xOffset, yOffset; - private final byte[][] grid; - private final boolean atLeastOne; - - - public GridGeoCoords(int xOffset, int yOffset, byte[][] grid) { - this.xOffset = xOffset; - this.yOffset = yOffset; - this.grid = grid; - atLeastOne = new GridIterator().hasNext(); - } - - @Override - public Iterator iterator() { - return new GridIterator(); - } - - public int atMost() { - return grid.length*grid[0].length; - } - - public boolean isEmpty() { - return !atLeastOne; - } - - class GridIterator implements Iterator { - - private int width=grid.length, height=grid[0].length; - private int x=0, y=-1; - - GridIterator() { - findNext(); - } - - @Override - public boolean hasNext() { - return x=width) return null; - Point pnt = new Point(x+xOffset,y+yOffset); - findNext(); - return pnt; - } - - public void reset() { - x=0; - y=-1; - findNext(); - } - private void findNext() { - // if last has been found don't look any more - if(x>=width) return; - for(; x0) return; - } - } - } - } - } -} diff --git a/java/src/main/java/gov/noaa/gsl/idssEngine/commons/geo/GeometryUtils.java b/java/src/main/java/gov/noaa/gsl/idssEngine/commons/geo/GeometryUtils.java deleted file mode 100644 index a3209683..00000000 --- a/java/src/main/java/gov/noaa/gsl/idssEngine/commons/geo/GeometryUtils.java +++ /dev/null @@ -1,176 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2020 Regents of the University of Colorado. All rights reserved. - * - * Contributors: - * Geary Layne - *******************************************************************************/ -package gov.noaa.gsl.idssEngine.commons.geo; - -import java.awt.Point; -import java.util.HashSet; -import java.util.Set; - -import org.locationtech.jts.geom.Coordinate; -import org.locationtech.jts.geom.Geometry; - -import gov.noaa.gsd.fiqas.cartography.GreatCircle; -import gov.noaa.gsd.fiqas.cartography.Projection; -import gov.noaa.gsd.fiqas.math.coord.cartesian.Polygon; -import gov.noaa.gsd.fiqas.math.coord.cartesian.Polyline; -import gov.noaa.gsd.fiqas.util.grid.tool.MathMorph; -import gov.noaa.gsd.fiqas.util.grid.tool.RadialHood; -import gov.noaa.gsd.fiqas.util.image.draw.PolyDrawler; - -public class GeometryUtils { - - public static GeoCoords getCoords(Geometry geometry, Projection proj) { - return getCoords(geometry, proj, 0); - } - - public static GeoCoords getCoords(Geometry geometry, Projection proj, double dilateRadiusInKm) { - - int numGeo = geometry.getNumGeometries(); - - if(numGeo==1) return addCoords(geometry, proj, dilateRadiusInKm, null); - - GeoCoords geoCoords = addCoords(geometry.getGeometryN(0), proj, dilateRadiusInKm, null); - - for(int i=1; i coordSet = new HashSet<>(); - Set hood = RadialHood.getOffsets(dilateRadiusInPixel, true); - final int x = coord[0], y = coord[1]; - for(int[] offset : hood) { - coordSet.add(new Point(x+offset[0], y+offset[1])); - } - - //remove inner hole, mind dilateRadius - if(geometry instanceof Annulus) { - double radiusInKm = ((Annulus)geometry).outerRadius - dilateRadiusInKm; - dilateRadiusInPixel = getDistInPixel(proj, coord, radiusInKm); - hood = RadialHood.getOffsets(dilateRadiusInPixel, true); - for(int[] offset : hood) { - coordSet.remove(new Point(x+offset[0], y+offset[1])); - } - } - - if(geoCoords == null) - return new GeoCoords(coordSet); - return geoCoords.add(coordSet); - } - } else { - int len = bdryCoords.length; - double[][] xyBdryCoords = new double[len][2]; - double[] xy = proj.mapLatLon(bdryCoords[0].y, bdryCoords[0].x); - xyBdryCoords[0] = xy; - double minX=xy[0], maxX=xy[0]; - double minY=xy[1], maxY=xy[1]; - for(int i=1; i (%f, %f)\n", proj.getProjSpec(), bdryCoords[i].y, bdryCoords[i].x, xy[0], xy[1]); - final double x=xy[0]; - final double y=xy[1]; - if(minX>x) minX=x; - if(maxXy) minY=y; - if(maxY=1.) - grid = MathMorph.dilate(grid, dilateRadiusInPixel); -//GridSummary.printDistribution(grid); - - if(geoCoords == null) - return new GeoCoords(xOffset, yOffset, grid); - return geoCoords.add(xOffset, yOffset, grid); -// { -// Set coords = PolyDrawler.drawPolygon(new Polygon(xyBdryCoords, true)); -// Set coordSet = new HashSet<>(coords.size()); -// for(int[] coord : coords) { -////System.out.println("\t"+Arrays.toString(coord)); -// coordSet.add(new Point(coord[0], coord[1])); -// } -//System.out.println("coordSet size: "+coordSet.size()); -// if(geoCoords == null) -// return new GeoCoords(coordSet); -// return geoCoords.add(coordSet); -// } - case "LineString": -//System.out.println("lineString"); - Set coords = PolyDrawler.drawPolyline(new Polyline(xyBdryCoords, true)); - Set coordSet = new HashSet<>(coords.size()); - if(dilateRadiusInKm==0) - for(int[] coord : coords) coordSet.add(new Point(coord[0], coord[1])); - else { - Set hood = RadialHood.getOffsets(dilateRadiusInPixel, true); -System.out.println("hood size: "+hood.size()); - for(int[] coord : coords) { - final int x = coord[0], y = coord[1]; - for(int[] offset : hood) - coordSet.add(new Point(x+offset[0], y+offset[1])); - } - } - if(geoCoords == null) - return new GeoCoords(coordSet); - return geoCoords.add(coordSet); - - default: - throw new UnsupportedOperationException("Geometry type ("+geoType+") not currently supported"); - } - } - return null; - } - - private static double getDistInPixel(Projection proj, Coordinate coord, double distInKm) { - int[] xyCoord = proj.mapLatLonToPixel(coord.y, coord.x); - return getDistInPixel(proj, xyCoord, distInKm); - } - private static double getDistInPixel(Projection proj, int[] pixelCoord, double distInKm) { - int x = pixelCoord[0]; - int y = pixelCoord[1]; - double[] latLon1 = proj.mapXY(x, y); - double[] latLon2 = proj.mapXY(x+1, y+1); - return distInKm/(GreatCircle.getDistance(latLon1, latLon2)/Math.sqrt(2)); - } -} diff --git a/java/src/main/java/gov/noaa/gsl/idssEngine/commons/imsMessage/ImsEvent.java b/java/src/main/java/gov/noaa/gsl/idssEngine/commons/imsMessage/ImsEvent.java deleted file mode 100644 index 882db19a..00000000 --- a/java/src/main/java/gov/noaa/gsl/idssEngine/commons/imsMessage/ImsEvent.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2020 Regents of the University of Colorado. All rights reserved. - * - * Contributors: - * Geary Layne - *******************************************************************************/ -package gov.noaa.gsl.idssEngine.commons.imsMessage; - -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -public class ImsEvent { - -// private final UUID id; -// private final String name; - public final long[] validTimes; //seconds since Epoch, Represents the start of an hour over which to evaluate the impact - public final ImsThresholdSet[] thresholdSets; - public final ImsLocation[] locations; - public final Map attrMap = new HashMap<>(); - - public ImsEvent(Map attrMap, long[] validTimes, ImsThresholdSet[] thresholdSets, ImsLocation location) { - this(attrMap, validTimes, thresholdSets, new ImsLocation[] {location}); - } - - public ImsEvent(Map attrMap, long[] validTimes, ImsThresholdSet[] thresholdSets, ImsLocation[] locations) { - this.attrMap.putAll(attrMap); - this.validTimes = Arrays.copyOf(validTimes, validTimes.length); - this.thresholdSets = Arrays.copyOf(thresholdSets, thresholdSets.length); - this.locations = Arrays.copyOf(locations, locations.length); - } - - public String getName() { - return attrMap.get("name").toString(); - } - public UUID getId() { - return UUID.fromString(getIdString()); - } - public String getIdString() { - return attrMap.get("id").toString(); - } - - public String toString() { - return String.format("ImsEvent(id: %s, name: \"%s\", \n\t\tvalidTimes: %s\n\t\tthresholdSets: %s\n\t\tlocations: %s", - getIdString(), getName(), Arrays.toString(validTimes), thresholdSets, locations); - } -} diff --git a/java/src/main/java/gov/noaa/gsl/idssEngine/commons/imsMessage/ImsEventReader.java b/java/src/main/java/gov/noaa/gsl/idssEngine/commons/imsMessage/ImsEventReader.java deleted file mode 100644 index f63fd23a..00000000 --- a/java/src/main/java/gov/noaa/gsl/idssEngine/commons/imsMessage/ImsEventReader.java +++ /dev/null @@ -1,274 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2020 Regents of the University of Colorado. All rights reserved. - * - * Contributors: - * Geary Layne - *******************************************************************************/ -package gov.noaa.gsl.idssEngine.commons.imsMessage; - -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.UUID; - -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; -import org.locationtech.jts.geom.Coordinate; -import org.locationtech.jts.geom.Geometry; -import org.locationtech.jts.geom.GeometryFactory; -import org.locationtech.jts.geom.MultiPolygon; -import org.locationtech.jts.geom.Polygon; - -import gov.noaa.gsl.idssEngine.commons.aspect.Field; -import gov.noaa.gsl.idssEngine.commons.aspect.WxModel; -import gov.noaa.gsl.idssEngine.commons.aspect.Relational; -import gov.noaa.gsl.idssEngine.commons.aspect.Units; - -public class ImsEventReader { - - public static void main(String[] args) throws IOException, JSONException { - System.out.println("Start ImsEventReader..."); - - String fileName = "/input-dir/iris_sample.json"; - ImsEvent[] imsEvents = ImsEventReader.fromJsonFile(fileName); - for(ImsEvent ie : imsEvents) - for(ImsThreshold it : ie.thresholdSets[0].thresholds) System.out.println(it); - - System.out.println("Finish ImsEventReader"); - } - - public static ImsEvent[] fromJsonFile(String fileName) throws IOException, JSONException { - byte[] encoded = Files.readAllBytes(Paths.get(fileName)); - String jsonString = new String(encoded, StandardCharsets.UTF_8); - return fromJsonString(jsonString); - } - - public static ImsEvent[] fromJsonString(String jsonString) throws JSONException { - try { - JSONObject rootObj = new JSONObject(jsonString); - return new ImsEvent[] {fromJsonObj(rootObj)}; - } catch(JSONException e) { -//if(true) throw new RuntimeException(e.getMessage()); - JSONArray arrayObj = new JSONArray(jsonString); - return fromJsonArray(arrayObj); - } - } - - public static ImsEvent[] fromJsonArray(JSONArray arrayObj) throws JSONException { - int len = arrayObj.length(); - ImsEvent[] events = new ImsEvent[len]; - for(int i=0; i models = null; - if(jsonObjCpy.has("models")) { - JSONArray modelArray = jsonObjCpy.getJSONArray("models"); - jsonObjCpy.remove("models"); - int numModels = modelArray.length(); - models = new HashSet<>(); - for(int i=0; i coordlist = new ArrayList<>(); - - for(String coordStr : coordStrs) { - if(!coordStr.isEmpty()) { - coordlist.add(getCoordinate(coordStr)); - } - } - return coordlist.toArray(new Coordinate[coordlist.size()][]); - } - - private static Coordinate[] getCoordinate(String coordsString) { -System.out.println("COORDS: "+coordsString); - String[] coords = coordsString.split(", "); - List coordlist = new ArrayList(); - for(String coord : coords) { - String[] lonLat = coord.split(" "); - double lon = Double.parseDouble(lonLat[0]); - double lat = Double.parseDouble(lonLat[1]); - coordlist.add(new Coordinate(lon, lat)); - } - return coordlist.toArray(new Coordinate[coordlist.size()]); - } - - private static String[] getObservationSites(JSONArray jsonArray) throws JSONException { - int len = jsonArray.length(); - String[] obsSites = new String[len]; - for(int i=0; i threatPeriods -// The periods of the threat - - - public ImsResponse(String id, String description, boolean isFcst, boolean isObs, String product, String location, DateTime evaluatedAt) { - this(id, description, isFcst, isObs, product, location, evaluatedAt, null, null, null, null); - } - - public ImsResponse(String id, String description, boolean isFcst, boolean isObs, String product, String location, - DateTime evaluatedAt, DateTime[] start, DateTime[] end, DateTime[] maxAt, double[] max) { - - this.id = UUID.fromString(id); - this.description = description; - this.isFcst = isFcst; - this.isObs = isObs; - this.product = product; - this.location = location; - threatPeriods = getThreadPeriods(start, end, maxAt, max); - this.thresholdExceeded = threatPeriods.length>0; - this.evaluatedAt = evaluatedAt; - } - - private ThreatPeriod[] getThreadPeriods(DateTime[] start, DateTime[] end, DateTime[] maxAt, double[] max) { - if(start==null) return new ThreatPeriod[0]; - - int len = start.length; - ThreatPeriod[] tps = new ThreatPeriod[len]; - for(int i=0; i attrMap = new HashMap<>(); - - private static final String useFcst = "useForecast"; - private static final String useObs = "useObservations"; - private static final String duration = "duration"; - private static final String arealPct = "arealPercentage"; - private static final String specModels = "specModel"; - - public ImsThresholdSet(boolean useFcst, boolean useObs, double duration, double arealPct, Set specModels, Map attrMap, ImsThreshold[] thresholds) { - this.attrMap.putAll(attrMap); - this.thresholds = Arrays.copyOf(thresholds, thresholds.length); - this.attrMap.put(ImsThresholdSet.useFcst, useFcst); - this.attrMap.put(ImsThresholdSet.useObs, useObs); - this.attrMap.put(ImsThresholdSet.duration, duration); - this.attrMap.put(ImsThresholdSet.arealPct, arealPct); - this.attrMap.put(ImsThresholdSet.specModels, specModels); - } - - public String getName() { - return attrMap.get("name").toString(); - } - public UUID getId() { - return UUID.fromString(getIdString()); - } - public String getIdString() { - return attrMap.get("id").toString(); - } - - public boolean useFcst() { - try{ - return getBool(attrMap.get(useFcst)); - } catch(Exception e) { - throw new RuntimeException("Unable to detirmine if Forecast should be used"); - } - } - - public boolean useObs() { - try{ - return getBool(attrMap.get(useObs)); - } catch(Exception e) { - throw new RuntimeException("Unable to detirmine if Observation should be used"); - } - } - - public double getDuration() { - try{ - return getDouble(attrMap.get(duration)); - } catch(Exception e) { - throw new RuntimeException("Unable to detirmine the Duration"); - } - } - - public double getArealPercentage() { - try{ - return getDouble(attrMap.get(arealPct)); - } catch(Exception e) { - throw new RuntimeException("Unable to detirmine the ArealPercentage"); - } - } - - public Set getSpecModel() { - return getModels(attrMap.get(specModels)); - } - - private boolean getBool(Object obj) { - if(obj==null) - return false; - if(obj.getClass() == Boolean.class) - return (Boolean)obj; - if(obj.getClass() == String.class) - return Boolean.parseBoolean((String)obj); - throw new IllegalArgumentException(); - } - - private double getDouble(Object obj) { - if(obj==null) - return 0.0; - if(obj.getClass() == Double.class) - return (Double)obj; - if(obj.getClass() == Integer.class) - return (Integer)obj; - throw new IllegalArgumentException(); - } - -// private String getString(Object obj) { -// if(obj==null) -// return ""; -// if(obj.getClass() == String.class) -// return (String)obj; -// throw new IllegalArgumentException(); -// } - - private Set getModels(Object obj) { - if(obj==null) - return null; -//System.out.println(obj.getClass()); -//System.out.println(Set.class.isAssignableFrom(obj.getClass())); - if(Set.class.isAssignableFrom(obj.getClass())) { - Set set = (Set)obj; - if(set.size()==0) return null; -//System.out.println(set.iterator().next().getClass()); - if(set.iterator().next().getClass() == WxModel.class) { - Set modelSet = new HashSet(); - for(Object model : set) { - switch((WxModel)model) { - case ALL: - for(WxModel m : WxModel.values()) modelSet.add(m); - break; - case ANY: - modelSet.add(WxModel.values()[0]); - break; - default: - modelSet.add((WxModel)model); - } - } -//TODO GJL remove hack to limit to only HRRR -//modelSet.clear(); -//modelSet.add(Model.HRRR); - return modelSet; - } - } - - throw new IllegalArgumentException(); - } -} diff --git a/java/src/test/java/gov/noaa/gsl/idssEngine/commons/aspect/FieldTest.java b/java/src/test/java/gov/noaa/gsl/idssEngine/commons/aspect/FieldTest.java deleted file mode 100644 index a1ece28a..00000000 --- a/java/src/test/java/gov/noaa/gsl/idssEngine/commons/aspect/FieldTest.java +++ /dev/null @@ -1,26 +0,0 @@ -/********************************************************************************* - * Copyright (c) 2022 Regents of the University of Colorado. All rights reserved. - * - * Contributors: - * Geary Layne -*********************************************************************************/ -package gov.noaa.gsl.idssEngine.commons.aspect; - -import static org.junit.jupiter.api.Assertions.*; - -import org.junit.jupiter.api.Test; - -class FieldTest { - - @Test - void shouldNotAllowInvalidType() { - assertThrows(IllegalArgumentException.class, () -> Field.get("Folsom")); - } - - @Test - void canGetSpelledOutType() { - Field field = Field.get("Dew point"); - assertEquals(Field.TD, field); - } - -} diff --git a/java/src/test/java/gov/noaa/gsl/idssEngine/commons/aspect/RelationalTest.java b/java/src/test/java/gov/noaa/gsl/idssEngine/commons/aspect/RelationalTest.java deleted file mode 100644 index 26a9e6a4..00000000 --- a/java/src/test/java/gov/noaa/gsl/idssEngine/commons/aspect/RelationalTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/********************************************************************************* - * Copyright (c) 2022 Regents of the University of Colorado. All rights reserved. - * - * Contributors: - * Geary Layne -*********************************************************************************/ -package gov.noaa.gsl.idssEngine.commons.aspect; - -import static org.junit.jupiter.api.Assertions.*; - -import org.junit.jupiter.api.Test; - -class RelationalTest { - - @Test - void shouldNotAllowInvalidType() { - assertThrows(IllegalArgumentException.class, () -> Relational.get("penultimate")); - } - - @Test - void canGetSpelledOutType() { - Relational relational = Relational.get("Greater than or equal"); - assertEquals(Relational.GREATERTHANOREQUAL, relational); - } - - @Test - void canGetValidFromShortName() { - Relational relational = Relational.get(Relational.get("BETWEEN").toShortString()); - assertEquals(Relational.BETWEEN, relational); - } -} diff --git a/java/src/test/java/gov/noaa/gsl/idssEngine/commons/aspect/UnitsTest.java b/java/src/test/java/gov/noaa/gsl/idssEngine/commons/aspect/UnitsTest.java deleted file mode 100644 index 27f8779c..00000000 --- a/java/src/test/java/gov/noaa/gsl/idssEngine/commons/aspect/UnitsTest.java +++ /dev/null @@ -1,26 +0,0 @@ -/********************************************************************************* - * Copyright (c) 2022 Regents of the University of Colorado. All rights reserved. - * - * Contributors: - * Geary Layne -*********************************************************************************/ -package gov.noaa.gsl.idssEngine.commons.aspect; - -import static org.junit.jupiter.api.Assertions.*; - -import org.junit.jupiter.api.Test; - -class UnitsTest { - - @Test - void shouldNotAllowInvalidType() { - assertThrows(IllegalArgumentException.class, () -> Units.get("1.21 gigawatts")); - } - - @Test - void canGetSpelledOutType() { - Units units = Units.get("Catagory"); - assertEquals(Units.Cat, units); - } - -} diff --git a/java/src/test/java/gov/noaa/gsl/idssEngine/commons/aspect/WxModelTest.java b/java/src/test/java/gov/noaa/gsl/idssEngine/commons/aspect/WxModelTest.java deleted file mode 100644 index f67bfa23..00000000 --- a/java/src/test/java/gov/noaa/gsl/idssEngine/commons/aspect/WxModelTest.java +++ /dev/null @@ -1,25 +0,0 @@ -/********************************************************************************* - * Copyright (c) 2022 Regents of the University of Colorado. All rights reserved. - * - * Contributors: - * Geary Layne -*********************************************************************************/ -package gov.noaa.gsl.idssEngine.commons.aspect; - -import static org.junit.jupiter.api.Assertions.*; - -import org.junit.jupiter.api.Test; - -class WxModelTest { - - @Test - void shouldNotAllowInvalidType() { - assertThrows(IllegalArgumentException.class, () -> WxModel.get("Cindy Crawford")); - } - - @Test - void canGetSpelledOutType() { - WxModel wxModel = WxModel.get("Any Model"); - assertEquals(WxModel.ANY, wxModel); - } -} diff --git a/java/src/test/java/gov/noaa/gsl/idssEngine/commons/aspect/WxTypeTest.java b/java/src/test/java/gov/noaa/gsl/idssEngine/commons/aspect/WxTypeTest.java deleted file mode 100644 index ea61de1e..00000000 --- a/java/src/test/java/gov/noaa/gsl/idssEngine/commons/aspect/WxTypeTest.java +++ /dev/null @@ -1,25 +0,0 @@ -/********************************************************************************* - * Copyright (c) 2022 Regents of the University of Colorado. All rights reserved. - * - * Contributors: - * Geary Layne -*********************************************************************************/ -package gov.noaa.gsl.idssEngine.commons.aspect; - -import static org.junit.jupiter.api.Assertions.*; - -import org.junit.jupiter.api.Test; - -class WxTypeTest { - - @Test - void shouldNotAllowInvalidType() { - assertThrows(IllegalArgumentException.class, () -> WxType.get("ice_cream")); - } - - @Test - void canGetSpelledOutType() { - WxType wxType = WxType.get("Thunderstorms"); - assertEquals(WxType.THUNDER, wxType); - } -}