pyASDReader 1.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyASDReader/__init__.py +41 -0
- pyASDReader/_version.py +12 -0
- pyASDReader/asd_file_reader.py +940 -0
- pyASDReader/constant.py +138 -0
- pyASDReader/file_attributes.py +113 -0
- pyASDReader/logger_setup.py +35 -0
- pyasdreader-1.2.0.dist-info/METADATA +497 -0
- pyasdreader-1.2.0.dist-info/RECORD +11 -0
- pyasdreader-1.2.0.dist-info/WHEEL +5 -0
- pyasdreader-1.2.0.dist-info/licenses/LICENSE +21 -0
- pyasdreader-1.2.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,497 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pyASDReader
|
|
3
|
+
Version: 1.2.0
|
|
4
|
+
Summary: A Python library for reading and parsing all versions of ASD binary spectral files
|
|
5
|
+
Author-email: Kai Cao <caokai_cgs@163.com>
|
|
6
|
+
Maintainer-email: Kai Cao <caokai_cgs@163.com>
|
|
7
|
+
License: MIT License
|
|
8
|
+
|
|
9
|
+
Copyright (c) 2025 Kai Cao
|
|
10
|
+
|
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
in the Software without restriction, including without limitation the rights
|
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
furnished to do so, subject to the following conditions:
|
|
17
|
+
|
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|
|
28
|
+
|
|
29
|
+
Project-URL: Homepage, https://github.com/KaiTastic/pyASDReader
|
|
30
|
+
Project-URL: Documentation, https://github.com/KaiTastic/pyASDReader#readme
|
|
31
|
+
Project-URL: Repository, https://github.com/KaiTastic/pyASDReader
|
|
32
|
+
Project-URL: Source, https://github.com/KaiTastic/pyASDReader
|
|
33
|
+
Project-URL: Issues, https://github.com/KaiTastic/pyASDReader/issues
|
|
34
|
+
Project-URL: Bug Reports, https://github.com/KaiTastic/pyASDReader/issues
|
|
35
|
+
Project-URL: Changelog, https://github.com/KaiTastic/pyASDReader/blob/main/CHANGELOG.md
|
|
36
|
+
Project-URL: PyPI, https://pypi.org/project/pyASDReader/
|
|
37
|
+
Keywords: ASD,spectral files,spectroradiometer,remote sensing
|
|
38
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
39
|
+
Classifier: Intended Audience :: Science/Research
|
|
40
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
41
|
+
Classifier: Programming Language :: Python :: 3
|
|
42
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
43
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
44
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
45
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
46
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
47
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
48
|
+
Classifier: Operating System :: OS Independent
|
|
49
|
+
Requires-Python: >=3.8
|
|
50
|
+
Description-Content-Type: text/markdown
|
|
51
|
+
License-File: LICENSE
|
|
52
|
+
Requires-Dist: numpy>=1.20.0
|
|
53
|
+
Provides-Extra: dev
|
|
54
|
+
Requires-Dist: pytest>=6.0.0; extra == "dev"
|
|
55
|
+
Requires-Dist: pytest-cov>=2.10.0; extra == "dev"
|
|
56
|
+
Requires-Dist: pytest-html>=3.0.0; extra == "dev"
|
|
57
|
+
Requires-Dist: coverage>=5.0.0; extra == "dev"
|
|
58
|
+
Requires-Dist: flake8>=3.8.0; extra == "dev"
|
|
59
|
+
Requires-Dist: black>=21.0.0; extra == "dev"
|
|
60
|
+
Requires-Dist: isort>=5.0.0; extra == "dev"
|
|
61
|
+
Requires-Dist: build>=0.7.0; extra == "dev"
|
|
62
|
+
Requires-Dist: twine>=3.0.0; extra == "dev"
|
|
63
|
+
Requires-Dist: pre-commit>=2.15.0; extra == "dev"
|
|
64
|
+
Requires-Dist: tox>=3.20.0; extra == "dev"
|
|
65
|
+
Provides-Extra: docs
|
|
66
|
+
Requires-Dist: sphinx>=4.0.0; extra == "docs"
|
|
67
|
+
Requires-Dist: sphinx-rtd-theme>=1.0.0; extra == "docs"
|
|
68
|
+
Provides-Extra: all
|
|
69
|
+
Requires-Dist: pytest>=6.0.0; extra == "all"
|
|
70
|
+
Requires-Dist: pytest-cov>=2.10.0; extra == "all"
|
|
71
|
+
Requires-Dist: pytest-html>=3.0.0; extra == "all"
|
|
72
|
+
Requires-Dist: coverage>=5.0.0; extra == "all"
|
|
73
|
+
Requires-Dist: flake8>=3.8.0; extra == "all"
|
|
74
|
+
Requires-Dist: black>=21.0.0; extra == "all"
|
|
75
|
+
Requires-Dist: isort>=5.0.0; extra == "all"
|
|
76
|
+
Requires-Dist: build>=0.7.0; extra == "all"
|
|
77
|
+
Requires-Dist: twine>=3.0.0; extra == "all"
|
|
78
|
+
Requires-Dist: pre-commit>=2.15.0; extra == "all"
|
|
79
|
+
Requires-Dist: tox>=3.20.0; extra == "all"
|
|
80
|
+
Requires-Dist: sphinx>=4.0.0; extra == "all"
|
|
81
|
+
Requires-Dist: sphinx-rtd-theme>=1.0.0; extra == "all"
|
|
82
|
+
Dynamic: license-file
|
|
83
|
+
|
|
84
|
+
### pyASDReader - Python ASD Spectral File Reader
|
|
85
|
+
|
|
86
|
+
[](https://pypi.org/project/pyASDReader/)
|
|
87
|
+
[](https://pypi.org/project/pyASDReader/)
|
|
88
|
+
[](https://github.com/KaiTastic/pyASDReader/blob/main/LICENSE)
|
|
89
|
+
[](https://github.com/KaiTastic/pyASDReader/actions)
|
|
90
|
+
[](https://codecov.io/gh/KaiTastic/pyASDReader)
|
|
91
|
+
|
|
92
|
+
pyASDReader is a robust Python library designed to read and parse all versions (v1-v8) of ASD (Analytical Spectral Devices) binary spectral files. It provides seamless access to spectral data, metadata, and calibration information from various ASD instruments including FieldSpec, LabSpec, TerraSpec, and more.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## 🚀 Key Features
|
|
97
|
+
|
|
98
|
+
- **Universal Compatibility**: Supports all ASD file versions (v1-v8) and instruments
|
|
99
|
+
- FieldSpec series (4 Hi-Res NG, 4 Hi-Res, 4 Standard-Res, 4 Wide-Res)
|
|
100
|
+
- LabSpec series (4 Bench, 4 Hi-Res, 4 Standard-Res)
|
|
101
|
+
- TerraSpec series (4 Hi-Res, 4 Standard-Res)
|
|
102
|
+
- HandHeld series (2 Pro, 2), AgriSpec, and more
|
|
103
|
+
|
|
104
|
+
- **Comprehensive Data Access**: Extract all spectral information
|
|
105
|
+
- Spectral data (reflectance, radiance, irradiance)
|
|
106
|
+
- Wavelength arrays and derivative calculations
|
|
107
|
+
- Complete metadata and instrument parameters
|
|
108
|
+
- Calibration data and reference measurements
|
|
109
|
+
|
|
110
|
+
- **Advanced Processing**: Built-in spectral analysis tools
|
|
111
|
+
- First and second derivative calculations
|
|
112
|
+
- Log(1/R) transformations
|
|
113
|
+
- Type-safe enum constants for file attributes
|
|
114
|
+
- Robust error handling and validation
|
|
115
|
+
|
|
116
|
+
## Requirements
|
|
117
|
+
|
|
118
|
+
- Python >=3.8
|
|
119
|
+
- numpy >=1.20.0
|
|
120
|
+
|
|
121
|
+
## Installation
|
|
122
|
+
|
|
123
|
+
### Stable Release (Recommended)
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
pip install pyASDReader
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Development Installation
|
|
130
|
+
|
|
131
|
+
For contributors and advanced users:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
# Clone the repository
|
|
135
|
+
git clone https://github.com/KaiTastic/pyASDReader.git
|
|
136
|
+
cd pyASDReader
|
|
137
|
+
|
|
138
|
+
# Install in editable mode with development dependencies
|
|
139
|
+
pip install -e ".[dev]"
|
|
140
|
+
|
|
141
|
+
# Install with all dependencies (dev + docs + testing)
|
|
142
|
+
pip install -e ".[all]"
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Quick Start
|
|
146
|
+
|
|
147
|
+
```python
|
|
148
|
+
from pyASDReader import ASDFile
|
|
149
|
+
|
|
150
|
+
# Method 1: Load file during initialization
|
|
151
|
+
asd_file = ASDFile("path/to/your/spectrum.asd")
|
|
152
|
+
|
|
153
|
+
# Method 2: Create instance first, then load
|
|
154
|
+
asd_file = ASDFile()
|
|
155
|
+
asd_file.read("path/to/your/spectrum.asd")
|
|
156
|
+
|
|
157
|
+
# Access basic data
|
|
158
|
+
wavelengths = asd_file.wavelengths # Wavelength array
|
|
159
|
+
reflectance = asd_file.reflectance # Reflectance values
|
|
160
|
+
metadata = asd_file.metadata # File metadata
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## Usage Examples
|
|
164
|
+
|
|
165
|
+
### Basic Spectral Data Access
|
|
166
|
+
|
|
167
|
+
```python
|
|
168
|
+
import numpy as np
|
|
169
|
+
import matplotlib.pyplot as plt
|
|
170
|
+
from pyASDReader import ASDFile
|
|
171
|
+
|
|
172
|
+
# Load ASD file
|
|
173
|
+
asd = ASDFile("sample_spectrum.asd")
|
|
174
|
+
|
|
175
|
+
# Basic information
|
|
176
|
+
print(f"File version: {asd.asdFileVersion}")
|
|
177
|
+
print(f"Instrument: {asd.metadata.instrumentModel}")
|
|
178
|
+
print(f"Number of channels: {len(asd.wavelengths)}")
|
|
179
|
+
print(f"Spectral range: {asd.wavelengths[0]:.1f} - {asd.wavelengths[-1]:.1f} nm")
|
|
180
|
+
|
|
181
|
+
# Plot spectrum
|
|
182
|
+
plt.figure(figsize=(10, 6))
|
|
183
|
+
plt.plot(asd.wavelengths, asd.reflectance)
|
|
184
|
+
plt.xlabel('Wavelength (nm)')
|
|
185
|
+
plt.ylabel('Reflectance')
|
|
186
|
+
plt.title('ASD Spectrum')
|
|
187
|
+
plt.grid(True)
|
|
188
|
+
plt.show()
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Advanced Spectral Analysis
|
|
192
|
+
|
|
193
|
+
```python
|
|
194
|
+
# Access different spectral measurements
|
|
195
|
+
reflectance = asd.reflectance # Raw reflectance
|
|
196
|
+
abs_reflectance = asd.absoluteReflectance # Absolute reflectance
|
|
197
|
+
radiance = asd.radiance # Radiance data
|
|
198
|
+
irradiance = asd.irradiance # Irradiance data
|
|
199
|
+
|
|
200
|
+
# Derivative calculations
|
|
201
|
+
refl_1st_deriv = asd.reflectance1stDeriv # First derivative
|
|
202
|
+
refl_2nd_deriv = asd.reflectance2ndDeriv # Second derivative
|
|
203
|
+
|
|
204
|
+
# Log(1/R) transformations
|
|
205
|
+
log1r = asd.log1R # Log(1/R)
|
|
206
|
+
log1r_1st_deriv = asd.log1R1stDeriv # Log(1/R) first derivative
|
|
207
|
+
log1r_2nd_deriv = asd.log1R2ndDeriv # Log(1/R) second derivative
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### Error Handling and Validation
|
|
211
|
+
|
|
212
|
+
```python
|
|
213
|
+
from pyASDReader import ASDFile
|
|
214
|
+
import os
|
|
215
|
+
|
|
216
|
+
def safe_read_asd(file_path):
|
|
217
|
+
"""Safely read ASD file with error handling."""
|
|
218
|
+
try:
|
|
219
|
+
# Check if file exists
|
|
220
|
+
if not os.path.exists(file_path):
|
|
221
|
+
raise FileNotFoundError(f"ASD file not found: {file_path}")
|
|
222
|
+
|
|
223
|
+
# Load the file
|
|
224
|
+
asd = ASDFile(file_path)
|
|
225
|
+
|
|
226
|
+
# Validate data
|
|
227
|
+
if asd.wavelengths is None or len(asd.wavelengths) == 0:
|
|
228
|
+
raise ValueError("Invalid or empty wavelength data")
|
|
229
|
+
|
|
230
|
+
if asd.reflectance is None or len(asd.reflectance) == 0:
|
|
231
|
+
raise ValueError("Invalid or empty reflectance data")
|
|
232
|
+
|
|
233
|
+
print(f"✓ Successfully loaded: {os.path.basename(file_path)}")
|
|
234
|
+
print(f" Channels: {len(asd.wavelengths)}")
|
|
235
|
+
print(f" Range: {asd.wavelengths[0]:.1f}-{asd.wavelengths[-1]:.1f} nm")
|
|
236
|
+
|
|
237
|
+
return asd
|
|
238
|
+
|
|
239
|
+
except Exception as e:
|
|
240
|
+
print(f"✗ Error loading {file_path}: {str(e)}")
|
|
241
|
+
return None
|
|
242
|
+
|
|
243
|
+
# Usage
|
|
244
|
+
asd_file = safe_read_asd("spectrum.asd")
|
|
245
|
+
if asd_file is not None:
|
|
246
|
+
# Process the file
|
|
247
|
+
pass
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
### Batch Processing
|
|
251
|
+
|
|
252
|
+
```python
|
|
253
|
+
import glob
|
|
254
|
+
from pathlib import Path
|
|
255
|
+
|
|
256
|
+
def process_asd_directory(directory_path, output_format='csv'):
|
|
257
|
+
"""Process all ASD files in a directory."""
|
|
258
|
+
asd_files = glob.glob(os.path.join(directory_path, "*.asd"))
|
|
259
|
+
|
|
260
|
+
print(f"Found {len(asd_files)} ASD files")
|
|
261
|
+
|
|
262
|
+
for file_path in asd_files:
|
|
263
|
+
try:
|
|
264
|
+
asd = ASDFile(file_path)
|
|
265
|
+
|
|
266
|
+
# Extract filename without extension
|
|
267
|
+
base_name = Path(file_path).stem
|
|
268
|
+
|
|
269
|
+
if output_format == 'csv':
|
|
270
|
+
# Save as CSV
|
|
271
|
+
output_path = f"{base_name}_spectrum.csv"
|
|
272
|
+
data = np.column_stack([asd.wavelengths, asd.reflectance])
|
|
273
|
+
np.savetxt(output_path, data, delimiter=',',
|
|
274
|
+
header='Wavelength(nm),Reflectance', comments='')
|
|
275
|
+
print(f"✓ Saved: {output_path}")
|
|
276
|
+
|
|
277
|
+
except Exception as e:
|
|
278
|
+
print(f"✗ Error processing {file_path}: {str(e)}")
|
|
279
|
+
|
|
280
|
+
# Usage
|
|
281
|
+
process_asd_directory("./asd_data/", output_format='csv')
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
## API Reference
|
|
285
|
+
|
|
286
|
+
### Core Classes
|
|
287
|
+
|
|
288
|
+
#### `ASDFile`
|
|
289
|
+
|
|
290
|
+
The main class for reading and parsing ASD files.
|
|
291
|
+
|
|
292
|
+
**Constructor:**
|
|
293
|
+
```python
|
|
294
|
+
ASDFile(file_path: str = None)
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
**Key Properties:**
|
|
298
|
+
| Property | Type | Description |
|
|
299
|
+
|----------|------|-------------|
|
|
300
|
+
| `wavelengths` | `numpy.ndarray` | Wavelength array (nm) |
|
|
301
|
+
| `reflectance` | `numpy.ndarray` | Reflectance values |
|
|
302
|
+
| `absoluteReflectance` | `numpy.ndarray` | Absolute reflectance |
|
|
303
|
+
| `radiance` | `numpy.ndarray` | Radiance data |
|
|
304
|
+
| `irradiance` | `numpy.ndarray` | Irradiance data |
|
|
305
|
+
| `reflectance1stDeriv` | `numpy.ndarray` | First derivative of reflectance |
|
|
306
|
+
| `reflectance2ndDeriv` | `numpy.ndarray` | Second derivative of reflectance |
|
|
307
|
+
| `log1R` | `numpy.ndarray` | Log(1/R) transformation |
|
|
308
|
+
| `log1R1stDeriv` | `numpy.ndarray` | First derivative of Log(1/R) |
|
|
309
|
+
| `log1R2ndDeriv` | `numpy.ndarray` | Second derivative of Log(1/R) |
|
|
310
|
+
| `metadata` | `object` | File metadata and instrument info |
|
|
311
|
+
| `asdFileVersion` | `int` | ASD file format version |
|
|
312
|
+
|
|
313
|
+
**Methods:**
|
|
314
|
+
```python
|
|
315
|
+
read(file_path: str) -> None
|
|
316
|
+
"""Load and parse an ASD file."""
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
## Technical Documentation
|
|
320
|
+
|
|
321
|
+
### ASD File Format Support
|
|
322
|
+
|
|
323
|
+
pyASDReader supports all ASD file format versions and instrument models:
|
|
324
|
+
|
|
325
|
+
#### Supported Instruments
|
|
326
|
+
|
|
327
|
+
| **FieldSpec Series** | **LabSpec Series** | **TerraSpec Series** |
|
|
328
|
+
|---------------------|-------------------|---------------------|
|
|
329
|
+
| FieldSpec 4 Hi-Res NG | LabSpec 4 Bench | TerraSpec 4 Hi-Res |
|
|
330
|
+
| FieldSpec 4 Hi-Res | LabSpec 4 Hi-Res | TerraSpec 4 Standard-Res |
|
|
331
|
+
| FieldSpec 4 Standard-Res | LabSpec 4 Standard-Res | |
|
|
332
|
+
| FieldSpec 4 Wide-Res | LabSpec range | |
|
|
333
|
+
|
|
334
|
+
| **HandHeld Series** | **Other Models** |
|
|
335
|
+
|-------------------|------------------|
|
|
336
|
+
| HandHeld 2 Pro | AgriSpec |
|
|
337
|
+
| HandHeld 2 | |
|
|
338
|
+
|
|
339
|
+
#### File Structure Mapping
|
|
340
|
+
|
|
341
|
+
| **ASD File Component** | **pyASDReader Property** |
|
|
342
|
+
|----------------------|-------------------------|
|
|
343
|
+
| Spectrum File Header | `asdFileVersion`, `metadata` |
|
|
344
|
+
| Spectrum Data | `spectrumData` |
|
|
345
|
+
| Reference File Header | `referenceFileHeader` |
|
|
346
|
+
| Reference Data | `referenceData` |
|
|
347
|
+
| Classifier Data | `classifierData` |
|
|
348
|
+
| Dependent Variables | `dependants` |
|
|
349
|
+
| Calibration Header | `calibrationHeader` |
|
|
350
|
+
| Absolute/Base Calibration | `calibrationSeriesABS`, `calibrationSeriesBSE` |
|
|
351
|
+
| Lamp Calibration Data | `calibrationSeriesLMP` |
|
|
352
|
+
| Fiber Optic Data | `calibrationSeriesFO` |
|
|
353
|
+
| Audit Log | `auditLog` |
|
|
354
|
+
| Digital Signature | `signature` |
|
|
355
|
+
|
|
356
|
+
### Validation and Testing
|
|
357
|
+
|
|
358
|
+
pyASDReader has been extensively tested against **ASD ViewSpecPro 6.2.0** to ensure accuracy:
|
|
359
|
+
|
|
360
|
+
#### ✅ **Validated Features**
|
|
361
|
+
- Digital Number (DN) values
|
|
362
|
+
- Reflectance calculations (raw, 1st derivative, 2nd derivative)
|
|
363
|
+
- Absolute reflectance computations
|
|
364
|
+
- Log(1/R) transformations (raw, 1st derivative, 2nd derivative)
|
|
365
|
+
- Wavelength accuracy and calibration
|
|
366
|
+
|
|
367
|
+
#### 🔄 **In Development**
|
|
368
|
+
- Radiance calculations
|
|
369
|
+
- Irradiance processing
|
|
370
|
+
- Parabolic jump correction algorithms
|
|
371
|
+
|
|
372
|
+
### Upcoming Features
|
|
373
|
+
|
|
374
|
+
#### Spectral Discontinuities Correction
|
|
375
|
+
|
|
376
|
+
Advanced correction algorithms for spectral jumps at detector boundaries:
|
|
377
|
+
|
|
378
|
+
- **Hueni Method**: Temperature-based correction using empirical formulas
|
|
379
|
+
- **ASD Parabolic Method**: Parabolic interpolation for jump correction
|
|
380
|
+
- Support for both automated and manual correction parameters
|
|
381
|
+
|
|
382
|
+
#### Enhanced File Format Conversion
|
|
383
|
+
|
|
384
|
+
Comprehensive export capabilities beyond the standard ASCII format:
|
|
385
|
+
- Multiple output formats (CSV, JSON, HDF5, NetCDF)
|
|
386
|
+
- Customizable data selection and filtering
|
|
387
|
+
- Batch processing with parallel execution
|
|
388
|
+
- Integration with popular spectral analysis libraries
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
## Contributing
|
|
393
|
+
|
|
394
|
+
### Development Setup
|
|
395
|
+
|
|
396
|
+
1. **Fork and Clone**:
|
|
397
|
+
```bash
|
|
398
|
+
git clone https://github.com/yourusername/pyASDReader.git
|
|
399
|
+
cd pyASDReader
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
2. **Create Development Environment**:
|
|
403
|
+
```bash
|
|
404
|
+
python -m venv venv
|
|
405
|
+
source venv/bin/activate # On Windows: venv\Scripts\activate
|
|
406
|
+
pip install -e ".[dev]"
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
3. **Run Tests**:
|
|
410
|
+
```bash
|
|
411
|
+
pytest tests/
|
|
412
|
+
python -m pytest --cov=src --cov-report=html
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
### Contribution Guidelines
|
|
416
|
+
|
|
417
|
+
- **Bug Reports**: Use GitHub Issues with detailed reproduction steps
|
|
418
|
+
- **Feature Requests**: Open an issue to discuss before implementing
|
|
419
|
+
- **Code Style**: Follow PEP 8 and use provided pre-commit hooks
|
|
420
|
+
- **Testing**: Add tests for new features and ensure all tests pass
|
|
421
|
+
- **Documentation**: Update README and docstrings for any API changes
|
|
422
|
+
|
|
423
|
+
### Development Workflow
|
|
424
|
+
|
|
425
|
+
1. Create a feature branch: `git checkout -b feature/amazing-feature`
|
|
426
|
+
2. Make your changes with appropriate tests
|
|
427
|
+
3. Run the test suite: `pytest`
|
|
428
|
+
4. Commit your changes: `git commit -m 'Add amazing feature'`
|
|
429
|
+
5. Push to your fork: `git push origin feature/amazing-feature`
|
|
430
|
+
6. Submit a Pull Request
|
|
431
|
+
|
|
432
|
+
## � Support & Community
|
|
433
|
+
|
|
434
|
+
### Getting Help
|
|
435
|
+
|
|
436
|
+
- 📋 **GitHub Issues**: [Report bugs or request features](https://github.com/KaiTastic/pyASDReader/issues)
|
|
437
|
+
- 📧 **Email**: `caokai_cgs@163.com` for direct support
|
|
438
|
+
- 🔒 **Security**: Report vulnerabilities via our [Security Policy](SECURITY.md)
|
|
439
|
+
|
|
440
|
+
### Community Guidelines
|
|
441
|
+
|
|
442
|
+
- Be respectful and inclusive
|
|
443
|
+
- Help others learn and grow
|
|
444
|
+
- Share knowledge and experiences
|
|
445
|
+
- Provide constructive feedback
|
|
446
|
+
|
|
447
|
+
## Citation
|
|
448
|
+
|
|
449
|
+
If you use pyASDReader in your research, please cite:
|
|
450
|
+
|
|
451
|
+
```bibtex
|
|
452
|
+
@software{cao2025pyasdreader,
|
|
453
|
+
author = {Cao, Kai},
|
|
454
|
+
title = {pyASDReader: A Python Library for ASD Spectral File Reading},
|
|
455
|
+
year = {2025},
|
|
456
|
+
url = {https://github.com/KaiTastic/pyASDReader},
|
|
457
|
+
version = {1.0.0}
|
|
458
|
+
}
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
**Plain text citation**:
|
|
462
|
+
> Cao, Kai. (2025). pyASDReader: A Python Library for ASD Spectral File Reading. https://github.com/KaiTastic/pyASDReader
|
|
463
|
+
|
|
464
|
+
## 📖 References
|
|
465
|
+
|
|
466
|
+
### Official Documentation
|
|
467
|
+
- [ASD Inc. (2017). ASD File Format: Version 8 (Revision): 1-10](https://www.malvernpanalytical.com/en/learn/knowledge-center/user-manuals/asd-file-format-v8)
|
|
468
|
+
- ASD Inc. Indico Version 7 File Format: 1-9
|
|
469
|
+
- ASD Inc. (2008). ViewSpec Pro User Manual: 1-24
|
|
470
|
+
- ASD Inc. (2015). FieldSpec 4 User Manual: 1-10
|
|
471
|
+
|
|
472
|
+
### Scientific References
|
|
473
|
+
- [Hueni, A. and A. Bialek (2017). "Cause, Effect, and Correction of Field Spectroradiometer Interchannel Radiometric Steps." IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing 10(4): 1542-1551](https://ieeexplore.ieee.org/document/7819458)
|
|
474
|
+
|
|
475
|
+
## License
|
|
476
|
+
|
|
477
|
+
This project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for complete details.
|
|
478
|
+
|
|
479
|
+
### Built With
|
|
480
|
+
|
|
481
|
+
- [NumPy](https://numpy.org/) - Numerical computing library
|
|
482
|
+
- [Python](https://python.org/) - Programming language
|
|
483
|
+
- [pytest](https://pytest.org/) - Testing framework
|
|
484
|
+
|
|
485
|
+
---
|
|
486
|
+
|
|
487
|
+
<div align="center">
|
|
488
|
+
|
|
489
|
+
**[⬆ Back to Top](#pyasdreader)**
|
|
490
|
+
|
|
491
|
+
Made with ❤️ for the spectroscopy community
|
|
492
|
+
|
|
493
|
+
[](https://github.com/KaiTastic/pyASDReader/stargazers)
|
|
494
|
+
[](https://github.com/KaiTastic/pyASDReader/network/members)
|
|
495
|
+
|
|
496
|
+
</div>
|
|
497
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
pyASDReader/__init__.py,sha256=GJmksBkXsqptqJnT7PbspAEBUoU_lGvcwVd3fP8w__o,898
|
|
2
|
+
pyASDReader/_version.py,sha256=Qoi-6vXsM2WM_PWcvneOkmz3YUHkQaYZutSOd6zFpmg,484
|
|
3
|
+
pyASDReader/asd_file_reader.py,sha256=vPZP2VDRMqgj8kSTx0E8jN_OcsQhcA3Zy8QOeUkGkjc,49007
|
|
4
|
+
pyASDReader/constant.py,sha256=Nb6KxsWOZun-SpMaackSHu_7WyImEWMzYbMZ0wsc5fI,4043
|
|
5
|
+
pyASDReader/file_attributes.py,sha256=HFM2k_c2e7P_D9NdjYJcKrzm3jvy1R9H4cCM68WDVMA,4638
|
|
6
|
+
pyASDReader/logger_setup.py,sha256=dq2pB3bsiSPnBSmY9vxpcq6O1HAe-aavRsjcxAXRJKU,1074
|
|
7
|
+
pyasdreader-1.2.0.dist-info/licenses/LICENSE,sha256=oVMZWDdVKo3SjIabnhMqfhYrpC03xfcvwdwOn9jKObI,1085
|
|
8
|
+
pyasdreader-1.2.0.dist-info/METADATA,sha256=OuSrJx3UDKFO0pWYJoOEwFu4HdBv4RFSFfS2ZBh6peM,17576
|
|
9
|
+
pyasdreader-1.2.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
10
|
+
pyasdreader-1.2.0.dist-info/top_level.txt,sha256=ccFFeWZniznS8X6KVjgGSlfoMBac2ZHg5k56UKXJX4o,12
|
|
11
|
+
pyasdreader-1.2.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Kai Cao
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pyASDReader
|