Ragnar API (Search Imagery)

Ragnar API is a system that can be used for searching and ordering satellite imagery.

Note

Although we commonly use provider dataset pair to identify datasets, the dataset names are unique by themselves.

Available Satellite Imagery Providers

At SpaceKnow we can download imagery three different ways:

  • Scened datasets download data as whole scenes.

  • Tile datasets download data in predefined tiles. Tiles are defined from the top left corner of the image. Thus each tile is dependent on the scene geometry.

  • Clipped datasets download only a requested extent as clipped part of a whole scene to save costs. This will generate new geometry cached ID. Footprint of the clipped imagery can not be directly extended and needs to be fully re-downloaded if required with different extent. However it’s possible to run any subset extent on already ingested clipped scene by re-running search only for downloaded imagery.

The way we download the imagery depends mainly on the capabilities of Provider API.

Ragnar API is an entry point for images from several satellite providers. Use List Datasets to get providers and datasets available to you, including their resolution, imagery type and description.

Notes to specific datasets:

  • COPERNICUS/S1_GRD – backscatter is represented by 16 bit unsigned integers. Use this formula to get backscatter coefficient \(c = d \cdot 2^{-15}\) where \(d\) represents digital value.

  • COPERNICUS/S2_HARMONIZED and COPERNICUS/S2_SR_HARMONIZED – we use HARMONIZED versions of S2 datasets to ensure compatibility of the data before and after 2022-01, when ESA changed processing method of S2 data.

  • Satellogic – footprint of the archive imagery is only approximate and real footprint is slightly smaller.

  • generic – used for ad-hoc and testing imagery uploaded as GeoTIFF. Scene date is taken from filename suffix after underscore in valid ISO format, e.g. generic_scene_20240120T172839.tiff or generic_scene_2024-01-20T17:28:39.tiff.

Image Metadata

Image metadata is a JSON object returned as part of replies of Search Scenes endpoint. Some of the attributes are guaranteed to be always present, some may appear only after some imagery from a given scene is requested, some may be totally unavailable for a given scene.

Image Metadata Object:

  • sceneId - ID of a scene

  • foreignId - ID of a scene on imagery provider side

  • provider - provider identifier

  • dataset - dataset identifier

  • satellite - satellite (sensor) name

  • datetime - scene acquisition date and time in YYYY-MM-DD HH:MM:SS format and UTC timezone

  • crsEpsg - EPSG code of coordinate reference system

  • footprint - geo-footprint of the photographed scene

  • offNadir - satellite off nadir angle in degrees; optional

  • sunElevation, sunAzimuth - sun positioning angles in degrees. Sun elevation is negative for night time images; optional

  • localTime - local time of the scene acquisition; optional

  • cloudCover - Ratio of scene area covered by clouds. Values 0 to 1; optional

  • satelliteAzimuth - satellite position angle in degrees; optional

  • anomalousRatio - Ratio of pixels that have image quality issues. Values 0 to 1; optional

  • mode - satellite acquisition mode; optional

  • orbitPass - this has value ascending if the satellite was moving northwards, descending otherwise; optional

  • sensorQualityFlag - boolean flag, true if the scene passed sensor quality checks defined by the provider; optional

  • groundControlFlag - boolean flag, true if the scene has proper ground control; optional

  • lookSide - look side of the satellite, either left or right; SAR specific; optional

  • relativeOrbitNumberStart - relative orbit number at the start of the scene; SAR specific; optional

  • sliceNumber - slice number of the scene; SAR specific; optional

  • relativeOrbitNumberStop - relative orbit number at the end of the scene; SAR specific; optional

  • looks - number of looks used for SAR processing; SAR specific; optional

  • bands - list of captured bands

    • bands[i].names - array of name aliases of the given band

    • bands[i].bitDepth - band bit depth

    • bands[i].gsd - ground sampling distance in meters

    • bands[i].pixelSizeX, bands[i].pixelSizeY - amount of CRS units per band pixel, \(s_x\) and \(s_y\) in (1); If scaling is requested this value corresponds to scaled image and will be different from the value returned by Search Scenes endpoint

    • bands[i].crsOriginX, bands[i].crsOriginY - coordinates referring to the top-left pixel of i-th band in its CRS, \(o_x\) and \(o_y\) in (1)

    • bands[i].approximateResolutionX, bands[i].approximateResolutionY - approximate pixel sizes in meters (width and height respectively) of the given band. If scaling is requested these values correspond to scaled image

    • bands[i].radianceMult, bands[i].radianceAdd are radiance parameters for the band; optional

    • bands[i].reflectanceMult, bands[i].reflectanceAdd are reflectance parameters for the band; optional

CRS EPSG:

EPSG is a code of a coordinate system for all bands from a scene. Following equations apply for each band from the scene:

(1)\[ \begin{align}\begin{aligned}x_p = \frac{x_c - o_x}{s_x},\\y_p = \frac{y_c - o_y}{s_y},\end{aligned}\end{align} \]

where \(x_p\) and \(y_p\) are pixel coordinates within a band (e.g. 5, 10 is 6th pixel from the left and 11th pixel from the top), \(x_c\) and \(y_c\) are coordinates in the CRS given by the EPSG, \(s_x\) and \(s_y\) is pixel width and pixel height of a band (the size may differ from band to band), \(o_x\), \(o_y\) are coordinates of the top-left corner referring to the top-left pixel of a band image.

Gotchas:

  • All pixels from a single band are rectangles of equal size.

  • Bands from a single scene don’t necessarily have equal pixel sizes.

  • Pixel width or height may be negative (coordinates of an image pixel go in the opposite direction from coordinates of the CRS).

  • Pixels don’t have to be squares, but they are always rectangles.

  • An approximate pixel size in meters can be calculated but the size of each pixel within a band may ~vary~ depending on the CRS.

  • Two pixels from the same location and from two scenes with a different CRS but with equal pixel sizes (in units of CRS) may have different physical sizes (in meters).

Footprint:

Footprint is a GeoJSON MultiPolygon in WGS84 coordinates that encloses an area on Earth, which is photographed in the scene.

Sun Elevation and Sun Azimuth:

Frame of reference for sun elevation and sun azimuth is the location and time of the image.

Sun elevation (solar elevation angle) is the “altitude” of the sun, the angle between the horizon and the centre of the sun’s disc.

Sun azimuth angle defines direction of the sun.

../_images/sun.png

Off Nadir, Satellite Elevation and Satellite Azimuth:

Off Nadir is the angle between Nadir and the direction of the satellite sensor. Satellite elevation is complementary to off Nadir angle, their sum is 90°.

Satellite azimuth is the direction of the satellite from the location of the image. It is the angle between north-heading meridian and surface projection of the line crossing satellite and the image.

../_images/satellite.png

Radiance and Reflectance:

Use this equation to calculate spectral radiance of a pixel

\[L_{\lambda} = M_{radiance} \cdot P_{int} + A_{radiance},\]

where \(M_{radiance}\) is radiance multiplicative correction factor (radianceMult), \(P_{int}\) is pixel value (see below) and \(A_{radiance}\) is radiance additive correction factor (radianceAdd). Value of \(L_{\lambda}\) represents the flux power per unit of solid angle, projected area and wavelength. Units are \(W \cdot sr^{-1} \cdot m^{-2} \cdot \mu m^{-1}\).

This is formula to calculate TOA (top-of-atmosphere) reflectance of area in a pixel

\[\rho^\prime_{\lambda} = M_{reflectance} \cdot P_{int} + A_{reflectance},\]

where \(M_{reflectance}\) is reflectance multiplicative correction factor (reflectanceMult), \(P_{int}\) is pixel value (see below) and \(A_{reflectance}\) is reflectance additive correction factor (reflectanceAdd). \(\rho^\prime_{\lambda}\) is not corrected with solar angle. It is unitless.

Reflectance is defined by the following formula:

\[\rho^\prime_{\lambda} = \frac{\pi \cdot L_{\lambda} \cdot d^2}{ESUN_{\lambda}},\]

where \(L_{\lambda}\) is pixel radiance, \(d^2\) is square of distance between Earth and Sun in AU and \(ESUN_{\lambda}\) is mean solar exoatmospheric irradiance in \(W \cdot m^{-2} \cdot \mu m^{-1}\) (on the band frequency).

The following formula can be used to correct reflectance by solar angle:

\[\rho_{\lambda} = \frac{\rho^\prime_{\lambda}}{sin(\theta_s)},\]

where \(\theta_s\) corresponds to sun elevation angle (sunElevation).

Pixel value (\(P_{int}\)) used in above formulas is a value between 0 and \(2^n\) where \(n\) is bit dept.

Note

Correction factors for radiance and reflectance may differ for each band.

Search Scenes

Ragnar API search returns all scenes that intersect with a requested extent and have an intersection ratio greater than or equal to a given threshold.

An intersection ratio is a fraction of the intersection area of the extent with scene and the total area of the extent. An extent area is a union of all area-based (Polygon and MultiPolygon) extent geometries.

\[r = \frac{area(E \cap S)}{area(E)},\]

where r is the intersection ratio, E is the area covered by the extent and S is the area covered by the scene.

Scenes search API is asynchronous and paginated.

See Ragnar Search Initiate and Ragnar Search Retrieve.

Scene Info

See Ragnar Scene Info API reference.

Imagery Providers

See List Datasets API reference.