Skip to main content

A package to handle LICEL Binary format

Project description

Linc

Package version Supported Python versions


Linc is a fast way to convert Licel Raw Format into netCDF4. Made for GFAT internal use but writer is highly customizable.

Examples

GFAT legacy writer

By default, the standard way to write a netCDF file is using the GFAT legacy writer. Assuming a directory with several measurement files, the conversion would be as follows.

measurements/
├─ RM2332919.194794
├─ RM2332919.184654
├─ RM2332919.204924
├─ RM2332919.215054
├─ ...
from linc import write_nc_legacy
from linc.config import get_config

meas_path = Path("measurements")
meas_files = list(meas_path.glob("RM*"))

config = get_config("config.toml")

write_nc_legacy(
    meas_files,
    output_file,
    config=config,
)

Using a custom writer

Linc have utilities to read and convert raw files data into Python objects. The simplest way to start is the linc.reader.read_file.

from linc import write_nc_legacy
from linc.config import get_config

meas_path = Path("measurements")
meas_file = list(meas_path.glob("RM*"))[0] # A single file

config = get_config("config.toml")

current_file = read_file(meas_file, config=config)

# Header information
# Such as filename, location
# Laser list, Channel list, etc
print(current_file.header)


# Returns a Pandas dataframe which columns are the channels of the measurement
# and rows are bins.
print(current_file.dataset)

Then, you can create an iterative writer with nectCDF4 utitilities.

Config file

Linc works with a configuration file that expects the following format:

# Lidar-specific parameters. Mandatory
[lidar]
bin_count = 16380
bin_width = 3.75
bins_per_microsecond = 40

# This are custom attributes that will be present in the final neCDF file. Not mandatory
[lidar.attrs]
location = "Granada"
system = "ALHAMBRA"
manufacturers = "Raymetrics"
overlap_is_corrected = "false"
BCK_MIN_ALT = 50000
BCK_MAX_ALT = 60000

Each channel has to be declared an linked to its device identificator this way:

[[lidar.channels]]
name = "signal_532xpa"
link_to = "BT0"

[[lidar.channels]]
name = "signal_532xpp"
link_to = "BC0"

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

linc-3.0.6.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

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

linc-3.0.6-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file linc-3.0.6.tar.gz.

File metadata

  • Download URL: linc-3.0.6.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.6

File hashes

Hashes for linc-3.0.6.tar.gz
Algorithm Hash digest
SHA256 14275bb0dce2c2716599fd2461936537e32f7e6241313d48f756f9fd67db4630
MD5 343a0d59d1cb43defc90a966557e606b
BLAKE2b-256 39b5f3ac626e1f452b03244376338d6c2fac792eb350fdacf9dba3f815d38e68

See more details on using hashes here.

File details

Details for the file linc-3.0.6-py3-none-any.whl.

File metadata

  • Download URL: linc-3.0.6-py3-none-any.whl
  • Upload date:
  • Size: 14.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.6

File hashes

Hashes for linc-3.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 5bc9b303979a3dc846b21e9b1a2b7404fca7eba629e6c81869b0c42be74a8087
MD5 3a1b80ff6a13f52772c6bb86862719f9
BLAKE2b-256 9226ecdc0a33411601f8eb23936da932fa8d715689e7a74fa417d1e4cc3bd339

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