spymicmac.declass

spymicmac.declass#

spymicmac.declass is a module designed for handling metadata related to USGS declassified images.

spymicmac.declass.get_declass_camera(fn_img)[source]#

Given a USGS Entity ID for a declassified image, returns the camera the image corresponds to, based on the mission number extracted from the Entity ID.

Examples (Entity ID -> Mission Num -> Camera):
  • DS1022-2075DA023 -> 1022 -> KH4A

  • DS1105-1122DA131 -> 1105 -> KH4B

  • DZB1214-500252L001001 -> 1214 -> KH9

Parameters:

fn_img (str) – the image filename or USGS Entity ID

Returns:

the mission/camera designation for the given Entity ID, or None if the mission number does not match

Return type:

str | None

spymicmac.declass.match_scan_angle(frame_width)[source]#

Estimate the scan angle (and therefore scan time) for a KH-9 PC image based on the frame width (in cm), using the following scan angles / frame widths:

30° -> 79.8 cm 60° -> 159.7 cm 90° -> 249.5 cm

120° -> 319.4 cm

Parameters:

frame_width (float) – the frame width in cm, calculated by multiplying the image width in px by the scanning resolution.

Returns:

the scan time (in s) and scan angle (in degrees)

Return type:

tuple[float, int]