Linc
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"
Metadata
Release files for linc 3.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| linc-3.0.6.tar.gz | 10.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| linc-3.0.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 25.4 kB
Release files / linc-3.0.6.tar.gz
| Download URL | linc-3.0.6.tar.gz |
|---|---|
| Size | 10.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
14275bb0dce2c2716599fd2461936537e32f7e6241313d48f756f9fd67db4630
|
|
BLAKE2b-256 checksum How to use checksums |
39b5f3ac626e1f452b03244376338d6c2fac792eb350fdacf9dba3f815d38e68
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.6
|
Release files / linc-3.0.6-py3-none-any.whl
| Download URL | linc-3.0.6-py3-none-any.whl |
|---|---|
| Size | 14.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5bc9b303979a3dc846b21e9b1a2b7404fca7eba629e6c81869b0c42be74a8087
|
|
BLAKE2b-256 checksum How to use checksums |
9226ecdc0a33411601f8eb23936da932fa8d715689e7a74fa417d1e4cc3bd339
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.6
|