We have started this page in an attempt to give users guidance on how to read ACOS data in different software packages. We prepared relatively simple examples in IDL and Python, and hope to add MatLab soon. To remind, ACOS data are in HDF5 format.
The emphasis here as given on reading and quality screening is done on purpose. These steps are the most important to understand by novice users. Once they become confident in opening files and reading data from there, they can augment examples here with the particular usage they have in mind.
Note: All IDL examples are using functionality that comes with the standard IDL distribution. No additional libraries or modules are required.
In this section we describe how to open and read an ACOS science data field using python, in a manner similar to that of the IDL example above.
We will read the familiar "xco2" variable, from an ACOS Level 2 file archived at:
http://oco2.gesdisc.eosdis.nasa.gov/data/
To read the "xco2" variable, given node definition, variable name, and file name, we can use following script
Vars = {} #Init dictionary
node_name = "/RetrievalResults" #Node definition
v_n = "xco2" #Variable name
# Assign to dictionary
Vars['xco2'] = retrieve_hdf5_var(input_fileh5, v_n, node_name)
where retrieve_hdf5_var function defined as
def retrieve_hdf5_var(input_fileh5, v_n, node_name):
h5file = tb.openFile(input_fileh5, "r")
hdf5_object = h5file.getNode(node_name, v_n)
array = hdf5_object.read()
h5file.close()
return array
To be able to use the above functions, python module requirements are as follows:
python 2.7, numpy, and tables module
You can import them using following lines:
import numpy as np
import tables as tb # From pytables
Plot in the left is created in Robinson projection from average of the 2 months of data (March, April-2010). Data can be downloded from http://oco2.gesdisc.eosdis.nasa.gov/data/ |