Skip to main content

flight-pipeline

PyPI version

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

Documentation can be found here: https://cedadev.github.io/flight-pipeline

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:

You can either install the PyPi package through pip or clone the GitHub repository. The two options can be found below.

1. Install using pip

  • Run pip install ceda-flight-pipeline
  • Install requirements into a local virtual environment using Poetry:
    • poetry install
  • Configure dirconfig with relative paths

OR

2. Install by cloning GitHub repository

  • Clone the repository from github by running git clone https://github.com/cedadev/flight-pipeline.git
  • Install requirements into a local virtual environment using Poetry:
    • poetry install
  • Configure dirconfig with relative paths

Setting up environment variables

In order to run the flight-pipeline project, you will need the following variables in your environment.

FLIGHT_CONFIG=/path/to/your/dir/config/dirconfig
STAC_TEMPLATE=/path/to/your/dir/config/stac_template.json
FLIGHT_CONNECTION=/path/to/your/dir/config/settings.json

In bash you can run: export FLIGHT_CONFIG=/path/to/your/dir/config/dirconfig

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). Update line 6 with a directory path to a logfile.

3. Push New Flights

Run with command flight-pipeline flight-update with a filled in dirconfig file to push new records to the index.

Or run with command flight-pipeline flight-update --archive_path ../../ --new_flights_dir ../../

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".

Metadata

Release files for ceda-flight-pipeline 1.2.2

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

Source distribution (sdist)

Source distribution for ceda-flight-pipeline 1.2.2
File Size Uploaded
ceda_flight_pipeline-1.2.2.tar.gz 29.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ceda-flight-pipeline 1.2.2
File Interpreter ABI Platform
ceda_flight_pipeline-1.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 61.0 kB

Release files / ceda_flight_pipeline-1.2.2.tar.gz

Download URL ceda_flight_pipeline-1.2.2.tar.gz
Size 29.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8d8d6ed7b9b02bb0c66282d606e4d5ae0352928f3585870c9a3dca2dc0b66797
BLAKE2b-256 checksum
How to use checksums
f1748f1a1806384b98b56b552b4553bb3310878a13786693bb349ffa92e4cc11
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.2 CPython/3.9.21 Darwin/24.5.0

Release files / ceda_flight_pipeline-1.2.2-py3-none-any.whl

Download URL ceda_flight_pipeline-1.2.2-py3-none-any.whl
Size 31.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
437d1613bb6dea638322e12ca941bb52a51267482de0726934a61d087f8a198c
BLAKE2b-256 checksum
How to use checksums
3a094659092b0606e89f7c2c87b87b5d5061aeecf69c5870c96959f424debba9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.2 CPython/3.9.21 Darwin/24.5.0

Release history Release notifications | RSS feed

This release

1.2.2 This release

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.3

2 release files

1.1.1

2 release files

1.1.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