Skip to main content

Library to read .tsg file package

Project description

pytsg

Rationale

The spectral geologist (TSG) is an industry standard software for hyperspectral data analysis https://research.csiro.au/thespectralgeologist/

pytsg is an open source one function utility that imports the spectral geologist file package into a simple object.

Installation

Installation is via pip pip install pytsg

Usage

If using the top level importer the data is assumed to follow this structure

\HOLENAME
         \HOLEMAME_tsg.bip
         \HOLENAME_tsg.tsg
         \HOLENAME_tsg_tir.bip
         \HOLENAME_tsg_tir.tsg
         \HOLENAME_tsg_hires.dat
         \HOLENAME_tsg_cras.bip

from matplotlib import pyplot as plt
from pytsg import parse_tsg

data = parse_tsg.read_package('example_data/ETG0187')

plt.plot(data.nir.wavelength, data.nir.spectra[0, 0:10, :].T)
plt.plot(data.tir.wavelength, data.tir.spectra[0, 0:10, :].T)
plt.xlabel('Wavelength nm')
plt.ylabel('Reflectance')
plt.title('pytsg reads tsg files')
plt.show()

If you would prefer to have full control over importing individual files the following syntax is what you need

# bip files
nir = parse_tsg.read_tsg_bip_pair('ETG0187_tsg.tsg','ETG0187_tsg.bip','nir')
tir = parse_tsg.read_tsg_bip_pair('ETG0187_tsg_tir.tsg','ETG0187_tsg_tir.bip','tir')

# cras file
cras = parse_tsg.read_cras('ETG0187_tsg_cras.bip')

# hires dat file
lidar = parse_tsg.read_lidar('ETG0187_tsg_hires.dat')

For convienience

Thanks

Thanks to CSIRO and in particular Andrew Rodger for his assistance in decoding the file structures.

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

pytsg-0.5.0.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

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

pytsg-0.5.0-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file pytsg-0.5.0.tar.gz.

File metadata

  • Download URL: pytsg-0.5.0.tar.gz
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.24

File hashes

Hashes for pytsg-0.5.0.tar.gz
Algorithm Hash digest
SHA256 0814539f685ca3a437a3a9b2db674dd58dd307c8f8e2accd87593215c46e3bb7
MD5 dab6d7fdbe958002b3db160ca46864ed
BLAKE2b-256 8da282530310748d2c8c91513f2799e97ac15de0e0e257c38aac411ddd436dd6

See more details on using hashes here.

File details

Details for the file pytsg-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: pytsg-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.24

File hashes

Hashes for pytsg-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ad176eff9bb2d085aedc7d886ae80e21e600aaa530b1799d31e33f64b2d9b25d
MD5 85dbc5b16bbfdcd684909c17d1b09a33
BLAKE2b-256 873927fe46b75dd0025a66ae6e1b6ee72a8ef997a1093d33ed161ff0289f4c42

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