Skip to main content

This package is meant to help you run models on Ellipsis Drive content. It should be used in combination with the ellipsis package.

Install

pip install ellipsisAI

Example

import ellipsisAI as ai
import ellipsis as el

pathId = '170aadad-8eaa-4509-9c0e-c1536d58a1fe'
timestampId = "633b4b9f-d939-4c4a-8d90-0e9fceb64b83"
targetPathId = "066458f4-f018-4f49-a1f0-dedfa71b3368"
tempFolder = 'YOUR_PATH'

#login to get a authentication token
token = el.account.logIn('YOUR_USERNAME','YOUR_PASSWORD')

#retrieve the zoom and bounds of the capture you wish to classify
classificationZoom = ai.getReccomendedClassificationZoom(pathId = pathId, timestampId = timestampId, token = token)
bounds = el.path.raster.timestamp.getBounds(pathId, timestampId, token)


#we create a dummy model. We use the identity function mapping an image to itself. We use the getTleData function to retirve the image for the given input tile ofthe model.
def model(tile):
    result = ai.getTileData(pathId = pathId, timestampId = timestampId, tile = tile, token  = token)
    if result['status'] == 204:
        output =  np.zeros((1,256,256))
    else:
        r = result['result']

        output = r[0:1,:,:] * 2
    return(output)


#apply the model on the given bounds on the given zoomlevel
ai.applyModel(model, bounds, targetPathId, classificationZoom, token, tempFolder)

Functions

applyModel

applyModel(model, bounds, targetPathId, classificationZoom, token, modelNoDataValue = -1, targetFromDate = None, targetToDate = None)

This function applies the given model on all tiles of zoomlevel classificationZoom withing the specified bounds. The results will be written in a new capture of the specified target block.

Name Description
model A function mapping given bounds to a 3D numpy array.
bounds A shapely polygon or multipolygon indicating the region you wish to classify
targetPathId The id of the path to write the result to
classificationZoom The zoomlevel of the tiles you wish to use for the model input as integer.
token Your token
tempFolder A path where temporary files can be written
modelNoDataValue Which number of the model output to interpret as transparent
targetDate Dictionary with keys from and to, both must be of type datetime. Defaults to current date

getTiles

getTiles(bounds, classificationZoom)

This function covers a given bounds with tiles of the given zoomlevel. You can use the result to get tile arguments for the getTileData function

Name Description
bounds A shapely polygon or multipolygon
classificationZoom The zoomlevel of the tiles to cover with as int

getTileData

getTileData(pathId, timestampId, tile, token = None )

This function retrieves raster data for a certain tile.

Name Description
PathId Id of the layer to retrieve the raster for
timestampId Id of the timestamp to retrieve the raster for
tile A dictionary with tileX, tileY and zoom as integers
token Your token (optional)

getReccomendedClassificationZoom

getReccomendedClassificationZoom(pathId, timestampId, token = None)

This function retrieves raster data for a certain tile.

Name Description
PathId Id of the layer to retrieve the raster for
timestampId Id of the timestamp to retrieve the raster for
token Your token (optional)

Metadata

Release files for ellipsisAI 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ellipsisAI 0.1.3
File Size Uploaded
ellipsisAI-0.1.3.tar.gz 6.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ellipsisAI 0.1.3
File Interpreter ABI Platform
ellipsisAI-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 13.4 kB

Release files / ellipsisAI-0.1.3.tar.gz

Download URL ellipsisAI-0.1.3.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
aa5a780d32b48b82d26127e40774e30d7656aa5cf7fa69ba20f191d6a0128de7
BLAKE2b-256 checksum
How to use checksums
a1c7a10f0d826af3c288fee662bf69bfe132867dc4a7b7a5a6ed248c26609507
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 colorama/0.4.4 importlib-metadata/6.8.0 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.31.0 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12

Release files / ellipsisAI-0.1.3-py3-none-any.whl

Download URL ellipsisAI-0.1.3-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d5027ee2dc0b093c3999e4f81ec565cf19b10d8e2e1397391864f264f550c873
BLAKE2b-256 checksum
How to use checksums
11bc4843b3d3c4b65edd6274bfe63cc5d0c7b60fe2ce0f23970144bc8b47dc61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 colorama/0.4.4 importlib-metadata/6.8.0 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.31.0 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.2

2 release files

0.0.1

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page