Content-Length: 1069 | pFad | http://cdaweb.gsfc.nasa.gov/WS/cdasr/1/dataviews/sp_phys/datasets/C1_PP_EFW/clientLibraryExample/
# Install these prerequisites once before executing the example code: # PyPI spacepy Option: # pip install -U spacepy cdasws # PyPI xarray Option: # pip install -U xarray cdflib cdasws # conda-forge xarray Option: # conda install conda-forge::xarray conda-forge::cdflib conda-forge::cdasws from cdasws import CdasWs cdas = CdasWs() dataset = 'C1_PP_EFW' # Edit the following var_names and example_interval # variables to suit your needs. var_names = cdas.get_variable_names(dataset) print('Variable names:', var_names) example_interval = cdas.get_example_time_interval(dataset) print('Example time interval:', example_interval) status, data = cdas.get_data(dataset, var_names, example_interval) if 'spacepy' in str(type(data)): # see https://spacepy.github.io/datamodel.html print(var_names[0], '=', data[var_names[0]]) print(data[var_names[0]].attrs) else: # see https://github.com/MAVENSDC/cdflib print(var_names[0], '=', data.data_vars[var_names[0]].values) print(data.data_vars[var_names[0]].attrs) print(data) # ...Fetched URL: http://cdaweb.gsfc.nasa.gov/WS/cdasr/1/dataviews/sp_phys/datasets/C1_PP_EFW/clientLibraryExample/
Alternative Proxies: