Documentation

Project description

The CEDA Flight Finder tool allows searching for flights within the CEDA flights index using based on different paramenter parameters. Search for specific flights by Collection, Flight Code, Instrument or Keyword Search, or filter specific flights by temporal geospatial parameters. Flights from FAAM, NERC-ARSF, SAFIRE, AWI-Polar5, Kit-Enduro, and INTA-CASA aircraft and the APEX instrument flown on the DLR aircraft are now included. Up to the first 1000 flights will be plotted on the map with most recent on top. The default view is the 100 most recent flights.

The CEDA Flight Finder tool can be accessed here

Flight Update

Elastic Search Flight Client

— Elastic Client —
  • Extract all items from flight finder index by organisation

  • Save flight numbers to array - return array

class flight_client.ESFlightClient(index, es_config: str, stac_template: str = None)

Bases: SimpleClient

Connects to an elasticsearch instance and exports the documents to elasticsearch.

addFlights(archive, rootdir, repush=False, move_files=False)

Function for adding flights

add_field(id, data, fieldname)
check_ptcode(ptcode)
check_set(paths)
obtain_field(id, fieldnames)
preprocess_records(file_list)

Blank preprocessor method - override with preprocessing steps for specific client use-cases.

push_flights(file_list)
refresh(refresh_level: int)

Refresh the catalogue links for specific or all records.

reindex(new_index)
sort_codes()
updateFlights(update)

Update flights using resolve_link() from flightpipe/flight_client module.

flight_client.moveOldFiles(rootdir, archive, files)

Move the written files from the root directory given in the config file to the archive

If keyword DELETE given instead of archive then the flight records will be deleted after being pushed

Flight Client Wrapper

exception simple_client.ResponseException(keys=None)

Bases: Exception

Response Exception - Elasticsearch did not return an object with any ‘hits’. This indicates an error, as even with 0 hits returned there should still be an empty ‘hits’ list here.

class simple_client.SimpleClient(index: str, es_config: dict | str)

Bases: object

Simple Elasticsearch-Python client for bulk operations

get_size()
preprocess_records(records)

Blank preprocessor method - override with preprocessing steps for specific client use-cases.

process_records(records)

Final processing step to add ids to new records if they are not already present.

pull_records()

Pull all records up to 10,000 and return all hits.

push_records(records)

Push records using bulk helper tool.

simple_client.create_settings(es_config='es_settings.json')
simple_client.gen_id()

Write Flights

— Get Archive Metadata —
  • Extract data from archive files

  • Copied from elastic_scrapers/scraper_code

class write_flights.FlightConverter(rootdir)

Bases: object

convert()
convertFile(filename, fileout)
createCatalog()
createCollections()
findFilesRecursive(directory, r)
write_flights.addList(item, id)

Get Moles

moles.update_moles(client, thorough=False, cache=True)