A package for reading NASA PACE data files.
Project description
NASA-PACE-Data-Reader
This repository hosts a Python package designed to read L1C files from NASA PACE instruments, including HARP2, SPEXone, and OCI. Future development plans include the addition of readers for L2 aerosol and surface products.
Dependencies
- Python v3.10 and above
Installing the library from PyPi
To install the python library "nasa-pace-data-reader", follow these steps:
- Open the command prompt or terminal.
- Enter the command
pip install nasa-pace-data-reader. - It is recommended to run this command in a separate
piporcondaenvironment to prevent dependency conflicts.
Installing from Github source code
cdto git directory- Enter the command
pip install -e ./
Building and Uploading the Package (For package maintainers):
To build and upload the package, you can either run the sh Install.sh script (ensure to specify the correct version).
Example Usage:
See the example python notebook Examples/L1C-example.ipynb
Here is a simple example of how to use the package:
from nasa_pace_data_reader import L1, plot # library
# Location of the file
fileName = '/Users/aputhukkudy/Downloads/PACE_HARP2.20220321T101844.L1C.5.2KM.V03.SIM2.1_.nc'
# Read the file
l1c = L1.L1C()
l1c_dict = l1c.read(fileName)
# Print the keys and the shape of the data
l1c_dict.keys()
for key in l1c_dict.keys():
if key != '_units':
try:
print('{:<24}:{}'.format(key, l1c_dict[key].shape))
except:
print('Key error')
# Define the pixel
pixel = [250,300]
# Load the plot class
plt_ = plot.Plot(l1c_dict)
# set which band to plot
band = 'Blue'
plt_.setBand(band)
# Read the 'i' for a pixel
i = l1c_dict['i'][pixel[0], pixel[1], plt_.bandAngles]
print('i:', i)
print('viewing angles:', l1c_dict['view_angles'][plt_.bandAngles])
# Set the dpi
plt_.setDPI(256)
# set which band to plot
band = 'NIR'
plt_.setBand(band)
# Plot the pixel
plt_.plotPixel(pixel[0], pixel[1])
# define the wavelengths and variables to plot
plt_.setInstrument()
# plot all vars and bands
plt_.plotPixelVars(pixel[0], pixel[1])
# plot only specific bands and vars
plt_.vars2plot = ['i', 'q', 'u'] # Order in the list is the order of plotting
plt_.bands2plot = ['NIR', 'blue'] # Order in the list is the order of plotting
# plot
plt_.plotPixelVars(pixel[0], pixel[1], bands= plt_.bands2plot, alpha=0.5, linewidth=0.5) # you can pass any other arguments to the plot function
# plot RGB image
# Load the plot class
plt_ = plot.Plot(l1c_dict)
# Plot RGB
plt_.plotRGB(scale=1, returnRGB=True)
# plot RGB in default plate carree projection
plt_.projectedRGB()
# plot RGB in Orthographic projection
plt_.projectedRGB(proj='Orthographic')
# plot one variable in a specific projection at closest viewing angle to nadir
band = 'Red'
plt_.setBand(band)
plt_.projectVar('i', dpi=300)
# Plotting reflectance at closest viewing angle to -35 degrees
plt_.reflectance = True
plt_.projectVar('u', viewAngle=-35)
Change Log:
v0.0.3.23
- Multiple projection in the RGB movie
v0.0.3.22
- Added a script to plot the RGB movie
v0.0.3.20
- Added
Examples/auto-image-gen-harp2.pyto automate the L1C image plotting
v0.0.3.19
- Adjustments made to account for the accurate variable name in the L1C file.
- Implemented the option to plot L1B (HARP2).
v0.0.3.18
- Masked the black pixels in the projected RGB
v0.0.3.17
- Added the option to load
OCIL1C file and plot the spectrum
v0.0.3.16
- The bug related to plotting multiple band data has been resolved.
v0.0.3.15
- Option to project one variable to the map
- the viewing angle can be specified easily
v0.0.3.14
- Added the ability to plot projected RGB using
cartopy. - Removed
Basemaplibrary from the dependencies
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nasa_pace_data_reader-0.0.3.24.tar.gz.
File metadata
- Download URL: nasa_pace_data_reader-0.0.3.24.tar.gz
- Upload date:
- Size: 18.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
860dfc0a67d5e7a277878e2af5b2e10e36fc41de6d18c30591fefa9e582ee3e0
|
|
| MD5 |
dfffb5f62def1c19a0703917e60fbfe2
|
|
| BLAKE2b-256 |
10770245d38408656281a5a056c35716fb14ba3de1d8f6b3969a0a050f7bf955
|
File details
Details for the file nasa_pace_data_reader-0.0.3.24-py3-none-any.whl.
File metadata
- Download URL: nasa_pace_data_reader-0.0.3.24-py3-none-any.whl
- Upload date:
- Size: 17.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
840f39ae776a54d47a06d9075a05817d7ee2884ea22e393b815d7e3026b1a3e0
|
|
| MD5 |
090c45531658d961bed4c95ae318307c
|
|
| BLAKE2b-256 |
e0acdff1d5dd77981ce46aa5e355edbde1db6cc08db2103663e15af4737f0bac
|