Skip to main content

The flight-pipeline mechanism allows for uploading new flights to the STAC index using the ElasticSearch client. The flight-pipeline scripts push new records that are not currently in the index and can remove or archive pushed records on the local system.

Project description

flight-pipeline

Repository for python code to concatenate data sources and construct new flight records for CEDA flight-finder

Objectives:

  • Mechanism for uploading new flights to stac index
  • Use ES Client to determine array of ids that currently exists in the index
  • Push new records that are not currently in the index
  • Remove or archive pushed records on local system

Installation:

  • Clone the repository from github
  • Install requirements into a local virtual environment:
    • python -m venv local
    • source local/bin/activate
    • pip install -r requirements.txt
  • Configure dirconfig with relative paths

Running the program

1. Use stac_template to write new records

Follow the STAC template json file to create new flight records (more details further down)

2. Configure dirconfig file

Add on lines 2 and 4 the directory paths to where your new flights to push are stored, and where the pushed flights should go once they have been uploaded to the index (store them or write DELETE to remove them from the local system)

3. Push New Flights

Run with command python flight_update.py add with a filled in dirconfig file to push new records to the index

Update Existing Flights

Note: In case of repair or adjustment to existing records, the individual records can be updated in place.

Run with command python flight_update.py update <pyfile>, where pyfile is a python file containing an update function that can be applied to each record in elasticsearch.

STAC Template

From the template, the following should be filled in:

  • id (fnum/pcode * date)
  • es_id (random string of ASCII characters to generate one of 9 colours in flight finder)
  • description_path
  • collection
  • geometry.display.coordinates
  • geometry.display.type (if coordinates are not MultiLineString)
  • properties:
    • data_format
    • start_datetime
    • end_datetime
    • flight_num (if applicable)
    • pcode (if applicable)
    • aircraft
    • variables
    • location
    • platform
    • instruments
    • pi

Geometries Development

Correct Version of mapping that exists in the arsf index

"spatial" : {
  "properties" : {
    "geometries" : {
      "properties" : {
        "display" : {
          "properties" : {
            "coordinates" : {
              "type" : "double",
              "index" : false
            },
            "type" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            }
          }
        },
        "full_search" : {
          "type" : "geo_shape"
        },
        "search" : {
          "type" : "geo_shape"
        }
      }
    }
  }

Incorrect version currently in stac-flightfinder-items

"geometry" : {
  "properties" : {
    "display" : {
      "properties" : {
        "coordinates" : {
          "type" : "float"
        },
        "type" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        }
      }
    },
    "geometries" : {
      "properties" : {
        "display" : {
          "properties" : {
            "coordinates" : {
              "type" : "float"
            },
            "type" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            }
          }
        },
        "search" : {
          "properties" : {
            "coordinates" : {
              "type" : "float"
            },
            "type" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            }
          }
        }
      }
    },
    "search" : {
      "properties" : {
        "coordinates" : {
          "type" : "float"
        },
        "type" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        }
      }
    }
  }
}

Ammendments:

  • Remove geometries subfield.
  • Remove all subfields of search and just add "type":"geo_shape".
  • Add full_search sub_field with "type":"geo_shape".

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ceda_flight_pipeline-1.1.1.tar.gz (26.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ceda_flight_pipeline-1.1.1-py3-none-any.whl (28.6 kB view details)

Uploaded Python 3

File details

Details for the file ceda_flight_pipeline-1.1.1.tar.gz.

File metadata

  • Download URL: ceda_flight_pipeline-1.1.1.tar.gz
  • Upload date:
  • Size: 26.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.9.21 Linux/5.14.0-503.21.1.el9_5.x86_64

File hashes

Hashes for ceda_flight_pipeline-1.1.1.tar.gz
Algorithm Hash digest
SHA256 dd5c72b3e860394f6e107b4abfd8d1cc5331aedb2a29642c159c895a7662af3b
MD5 90f6188e31ca8c3fc27efe2e77b038bf
BLAKE2b-256 8d65b1eb68d2fef299a154e046a1003ee2a3dec334710d49b7d6762309cd26db

See more details on using hashes here.

File details

Details for the file ceda_flight_pipeline-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: ceda_flight_pipeline-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 28.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.9.21 Linux/5.14.0-503.21.1.el9_5.x86_64

File hashes

Hashes for ceda_flight_pipeline-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 047a39324d4b48321a5f9aaa378a0b64643dbd5646bfe0c2419b9d84ad262771
MD5 4ec9b1adfbcadb579ed7fc130f0189cb
BLAKE2b-256 acccef9b4cae216c77230fdffad16c48a3268c93075d1059825240a3e13edbeb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page