Skip to main content

processing of polar aircraft aerosol and turbulence data

Project description

polair

This package provides a command line tool for processing atmospheric data from the polar research aircrafts Polar 5 and 6. It can be used to process data downloaded from the DMS system, convert the values to physical quantities, calibrate, and homogenise the time stamp. Furthermore, it can be used to process the noseboom and the t-bird to obtain corrected physical variables including the wind components. As a final step, it can be used to create standardised netCDF data sets with metadata and flight information. For this, we recommend to document all information needed to process a specific campaign in a dedicated repository. To use the polair package, you need to provide a configuration file with information of the campaign and several yaml dictionaries with information on calibration, variables of interest, units, flight segments, and so on. The BACSAM II campaign repository can serve as a blueprint.

preprocessing

The preprocessing command converts all data in physical quantities. If necessary and provided, it calibrates the data. Finally, they are interpolated on common (default 100 Hz) time stamps. The command also checks for data gaps and sampling errors which are noted in the log file. The calibrated raw data will be saved as a netCDF file. The location needs to be specified in the configuration file of the campaign

polair preprocessing -f <flight number> -c <config file>

noseboom

The noseboom command determines the basic meteorological parameters from the calibrated raw data of the noseboom which can be mounted at the nose of Polar 5 and 6. Adiabatic corrections are used and the wind components are determined.

polair noseboom -f <flight number> -c <config file>

tbird

The tbird command determines the meteorological parameters from the T-Bird similar to the noseboom command.

polair tbird -f <flight number> -c <config file>

device

The device command processes data from other instruments than noseboom and t-bird.

polair device -f <flight number> -c <config file> -i <instrument>  -p <platform>

Options for instruments are mcpc, partector, partector_dms, kt19, and radiation. Platform p is optional with polar6, add if platform is tbird.

Useful code

Find corrupted lines in DMS files

When downloading the data from the DMS system, it happens that there errors in the files such as broken lines, special charachters, missing entries,... When this is the case, the polair package fails in processing these data. Thus, the corrupted lines have to be removed. Here, we provide some code examples which can be used to quickly identify the corrupted line. In most of the cases, this works:

fn = <corrupted_file>

with open(fn, "rb") as f:
    for i, line in enumerate(f, start=1):
        try:
            line.decode("utf-8")
        except UnicodeDecodeError as e:
            print(f"Unicode error in line {i}: {e}")
            print(line[:200])  # show beginning of bad line
            break

This gives the corrupted line number. However, empty lines are not counted. So, if every second line is empty, you need to double the result. If this is not working, try

fn = <corrupted_file>

df = pd.read_csv(fn, header  = 4, sep = r'\s+', names = ["date", "time", f"var"])
bad_idx = [i for i, x in enumerate(df["time"]) if len(str(x)) != 15]

bad_idx gives lines with broken timestamps. Duplicated timestamps could also cause problems:

dup_times = df.loc[df["time"].duplicated(), "time"]

After removing the corrupted lines manually, the polair commands should work.

Convert yaml to html

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

polair-1.0.0.tar.gz (22.3 kB view details)

Uploaded Source

Built Distribution

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

polair-1.0.0-py3-none-any.whl (26.9 kB view details)

Uploaded Python 3

File details

Details for the file polair-1.0.0.tar.gz.

File metadata

  • Download URL: polair-1.0.0.tar.gz
  • Upload date:
  • Size: 22.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for polair-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2bbe273ced03f04ff2b5f4320336521dc1b39444067ec0a59ad3e248f6c1c5a6
MD5 2f3c989441e42cf77cf7585c08701eaf
BLAKE2b-256 caa6e9b6b32c616bbc70ae7d7012e728b21bde4a155ba6c669939ba8e55df154

See more details on using hashes here.

Provenance

The following attestation bundles were made for polair-1.0.0.tar.gz:

Publisher: python-publish.yml on LauraKoehler/polair

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file polair-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: polair-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 26.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for polair-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c609afb0133a6dc5cadf214d4faa0f50b1a1b6017e9395c4c8f742070bcacd7c
MD5 d881ed17e954aff74f0e632072c5b7f1
BLAKE2b-256 088eea3781aafd8b76c9a8763625a46bef61d4c28eb422a3b880e34ed13b614a

See more details on using hashes here.

Provenance

The following attestation bundles were made for polair-1.0.0-py3-none-any.whl:

Publisher: python-publish.yml on LauraKoehler/polair

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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