Package: nasa-pace-data-reader
NASA-PACE-Data-ReaderThis 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.DependenciesPython v3.10 and aboveInstalling the library from PyPiTo install the python library "nasa-pace-data-reader", follow these steps:Open the command prompt or terminal.Enter the commandpip install nasa-pace-data-reader.It is recommended to run this command in a separatepiporcondaenvironment to prevent dependency conflicts.Installing from Github source codecdto git directoryEnter the commandpip install -e ./Building and Uploading the Package (For package maintainers):To build and upload the package, you can either run thesh Install.shscript (ensure to specify the correct version).Example Usage:See the example python notebookExamples/L1C-example.ipynbHere is a simple example of how to use the package:fromnasa_pace_data_readerimportL1,plot# library# Location of the filefileName='/Users/aputhukkudy/Downloads/PACE_HARP2.20220321T101844.L1C.5.2KM.V03.SIM2.1_.nc'# Read the filel1c=L1.L1C()l1c_dict=l1c.read(fileName)# Print the keys and the shape of the datal1c_dict.keys()forkeyinl1c_dict.keys():ifkey!='_units':try:print('{:<24}:{}'.format(key,l1c_dict[key].shape))except:print('Key error')# Define the pixelpixel=[250,300]# Load the plot classplt_=plot.Plot(l1c_dict)# set which band to plotband='Blue'plt_.setBand(band)# Read the 'i' for a pixeli=l1c_dict['i'][pixel[0],pixel[1],plt_.bandAngles]print('i:',i)print('viewing angles:',l1c_dict['view_angles'][plt_.bandAngles])# Set the dpiplt_.setDPI(256)# set which band to plotband='NIR'plt_.setBand(band)# Plot the pixelplt_.plotPixel(pixel[0],pixel[1])# define the wavelengths and variables to plotplt_.setInstrument()# plot all vars and bandsplt_.plotPixelVars(pixel[0],pixel[1])# plot only specific bands and varsplt_.vars2plot=['i','q','u']# Order in the list is the order of plottingplt_.bands2plot=['NIR','blue']# Order in the list is the order of plotting# plotplt_.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 classplt_=plot.Plot(l1c_dict)# Plot RGBplt_.plotRGB(scale=1,returnRGB=True)# plot RGB in default plate carree projectionplt_.projectedRGB()# plot RGB in Orthographic projectionplt_.projectedRGB(proj='Orthographic')# plot one variable in a specific projection at closest viewing angle to nadirband='Red'plt_.setBand(band)plt_.projectVar('i',dpi=300)# Plotting reflectance at closest viewing angle to -35 degreesplt_.reflectance=Trueplt_.projectVar('u',viewAngle=-35)Change Log:v0.0.3.23Multiple projection in the RGB moviev0.0.3.22Added a script to plot the RGB moviev0.0.3.20AddedExamples/auto-image-gen-harp2.pyto automate the L1C image plottingv0.0.3.19Adjustments made to account for the accurate variable name in the L1C file.Implemented the option to plot L1B (HARP2).v0.0.3.18Masked the black pixels in the projected RGBv0.0.3.17Added the option to loadOCIL1C file and plot the spectrumv0.0.3.16The bug related to plotting multiple band data has been resolved.v0.0.3.15Option to project one variable to the mapthe viewing angle can be specified easilyv0.0.3.14Added the ability to plot projected RGB usingcartopy.RemovedBasemaplibrary from the dependencies