def test_multiple_jpy_create_destroy_jvm(self):
   self.assertFalse(jpy.has_jvm())
   jpy.create_jvm([])
   self.assertTrue(jpy.has_jvm())
   jpy.destroy_jvm()
   self.assertFalse(jpy.has_jvm())
   jpy.create_jvm([])
   self.assertTrue(jpy.has_jvm())
   jpy.destroy_jvm()
   self.assertFalse(jpy.has_jvm())
예제 #2
0
    Product = jpy.get_type('org.esa.snap.framework.datamodel.Product')
    ProductData = jpy.get_type('org.esa.snap.framework.datamodel.ProductData')
    RasterDataNode = jpy.get_type(
        'org.esa.snap.framework.datamodel.RasterDataNode')
    AbstractBand = jpy.get_type(
        'org.esa.snap.framework.datamodel.AbstractBand')
    Band = jpy.get_type('org.esa.snap.framework.datamodel.Band')
    VirtualBand = jpy.get_type('org.esa.snap.framework.datamodel.VirtualBand')
    GeoCoding = jpy.get_type('org.esa.snap.framework.datamodel.GeoCoding')
    GeoPos = jpy.get_type('org.esa.snap.framework.datamodel.GeoPos')
    PixelPos = jpy.get_type('org.esa.snap.framework.datamodel.PixelPos')
    FlagCoding = jpy.get_type('org.esa.snap.framework.datamodel.FlagCoding')
    ProductNodeGroup = jpy.get_type(
        'org.esa.snap.framework.datamodel.ProductNodeGroup')

    ProductUtils = jpy.get_type('org.esa.snap.util.ProductUtils')

    GPF = jpy.get_type('org.esa.snap.framework.gpf.GPF')
    Operator = jpy.get_type('org.esa.snap.framework.gpf.Operator')
    Tile = jpy.get_type('org.esa.snap.framework.gpf.Tile')

except Exception:
    jpy.destroy_jvm()
    raise

# Note: use the following code to initialise SNAP's 3rd party libraries, JAI and GeoTools.
# Only needed, if SNAP Python API is not called from Java (e.g. from SNAP gpt or SNAP desktop).
if not called_from_java:
    SystemUtils.init3rdPartyLibs(None)
예제 #3
0
    SystemUtils = jpy.get_type('org.esa.snap.util.SystemUtils')
    ProductIO = jpy.get_type('org.esa.snap.framework.dataio.ProductIO')

    Product = jpy.get_type('org.esa.snap.framework.datamodel.Product')
    ProductData = jpy.get_type('org.esa.snap.framework.datamodel.ProductData')
    RasterDataNode = jpy.get_type('org.esa.snap.framework.datamodel.RasterDataNode')
    AbstractBand = jpy.get_type('org.esa.snap.framework.datamodel.AbstractBand')
    Band = jpy.get_type('org.esa.snap.framework.datamodel.Band')
    VirtualBand = jpy.get_type('org.esa.snap.framework.datamodel.VirtualBand')
    GeoCoding = jpy.get_type('org.esa.snap.framework.datamodel.GeoCoding')
    GeoPos = jpy.get_type('org.esa.snap.framework.datamodel.GeoPos')
    PixelPos = jpy.get_type('org.esa.snap.framework.datamodel.PixelPos')
    FlagCoding = jpy.get_type('org.esa.snap.framework.datamodel.FlagCoding')
    ProductNodeGroup = jpy.get_type('org.esa.snap.framework.datamodel.ProductNodeGroup')

    ProductUtils = jpy.get_type('org.esa.snap.util.ProductUtils')

    GPF = jpy.get_type('org.esa.snap.framework.gpf.GPF')
    Operator = jpy.get_type('org.esa.snap.framework.gpf.Operator')
    Tile = jpy.get_type('org.esa.snap.framework.gpf.Tile')

except Exception:
    jpy.destroy_jvm()
    raise


# Note: use the following code to initialise SNAP's 3rd party libraries, JAI and GeoTools.
# Only needed, if SNAP Python API is not called from Java (e.g. from SNAP gpt or SNAP desktop).
if not called_from_java:
    SystemUtils.init3rdPartyLibs(None)
예제 #4
0
 def tearDownClass(cls):
   jpy.destroy_jvm()