Choosing Models and Variables¶
You may run the notebook as is if you have the sample data file, but you must change the 'file_dir' variable in block 5 to have the correct file path. Try changing the model, variable type, variable names, plotting values, and so on to interact with the data. All of the model readers have identical syntax and function, so you can choose any model reader and expect the same results. Execution time varies between datasets. Sample datasets may be obtained from https://ccmc.gsfc.nasa.gov/RoR_WWW/output_files/KAMODO_DEMO/. For examples of other functions, such as the flythrough, see the other notebooks in this directory.
Show a list of models currently available¶
In [1]:
Copied!
import kamodo_ccmc.flythrough.model_wrapper as MW
MW.Choose_Model('')
import kamodo_ccmc.flythrough.model_wrapper as MW
MW.Choose_Model('')
Possible models are: ADELPHI: AMPERE-Derived ELectrodynamic Properties of the High-latitude Ionosphere https://doi.org/10.1029/2020SW002677 AMGeO: Assimilative Mapping of Geospace Observations https://doi.org/10.5281/zenodo.3564914 CTIPe: Coupled Thermosphere Ionosphere Plasmasphere Electrodynamics Model https://doi.org/10.1029/2007SW000364 DTM: The Drag Temperature Model https://doi.org/10.1051/swsc/2015001 GAMERA_GM: Grid Agnostic MHD for Extended Research Applications - Global Magnetosphere outputs https://doi.org/10.3847/1538-4365/ab3a4c (coming soon) GITM: Global Ionosphere Thermosphere Model https://doi.org/10.1016/j.jastp.2006.01.008 IRI: International Reference Ionosphere Model https://doi.org/10.5194/ars-16-1-2018 OpenGGCM_GM: The Open Geospace General Circulation Model - Global Magnetosphere outputs only https://doi.org/10.1023/A:1014228230714 SuperDARN_uni: SuperDARN uniform grid output https://doi.org/10.1029/2010JA016017 SuperDARN_equ: SuperDARN equal area grid output https://doi.org/10.1029/2010JA016017 SWMF_IE: Space Weather Modeling Framework - Ionosphere and Electrodynamics outputs https://doi.org/10.1029/2006SW000272 SWMF_GM: Space Weather Modeling Framework - Global Magnetosphere outputs https://doi.org/10.1029/2006SW000272 TIEGCM: Thermosphere Ionosphere Electrodynamics General Circulation Model https://doi.org/10.1029/2012GM001297 WACCMX: Whole Atmosphere Community Climate Model With Thermosphere and Ionosphere Extension https://doi.org/10.1002/2017MS001232 WAMIPE: The coupled Whole Atmosphere Model - Ionosphere Plasmasphere Model https://doi.org/10.1002/2015GL067312 and https://doi.org/10.1029/2022SW003193 Weimer: Weimer Ionosphere model https://doi.org/10.1029/2005JA011270
Access documentation¶
In [2]:
Copied!
help(MW.Variable_Search)
help(MW.Variable_Search)
Help on function Variable_Search in module kamodo_ccmc.flythrough.model_wrapper: Variable_Search(search_string='', model='', file_dir='', return_dict=False) Search variable descriptions for the given string. If the model string is set, the chosen model will be searched. If file_dir is set to the directory where some model data is stored, the files available in that model data will be searched. If neither is set, then all model variables will be searched. Searching all of the model variables will take additional time as the model library grows. All searches are performed using lower case text (e.g. "temperature" not "Temperature"). Returns a dictionary with information that varies per call type if return_dict is True. Default is to print the information to the screen and return nothing (return_dict=False). - if the search_string is left blank, then nothing will be returned. Only the chosen information will be printed to the screen. - if neither model nor file_dir is set, the dictionary will have the model names as keys and the value will be a dictionary with the variable names as keys and the variable description, coordinate dependencies, and variable units as the value. - if only the model value is set, then the dictionary will have the variable names as keys and the variable description, coordinate dependencies, and variable units as the value. - if the model and file_dir values are set, then the dictionary will have the file names (or prefixes) as keys and the value will be a dictionary with the variable names as keys and the variable description, coordinate dependencies, and variable units as the value.
Show all the possible variables¶
In [3]:
Copied!
# The command below outputs well over 500 lines of output.
# Click the link in the next cell to view all the output.
# MW.Variable_Search()
# The command below outputs well over 500 lines of output.
# Click the link in the next cell to view all the output.
# MW.Variable_Search()
In [4]:
Copied!
%%html
<a href="Files/MW.Variable_Search.txt">MW.Variable_Search</a>
%%html
MW.Variable_Search
Choosing a model¶
In [5]:
Copied!
MW.Variable_Search('temperature')
MW.Variable_Search('temperature')
ADELPHI: No temperature variables found. AMGeO: No temperature variables found. CTIPe: T_ilev1: ['temperature', 'GDZ-sph', ['time', 'lon', 'lat', 'ilev1'], 'K'] T: ['temperature', 'GDZ-sph', ['time', 'lon', 'lat', 'height'], 'K'] T_e: ['electron temperature', 'GDZ-sph', ['time', 'lon', 'lat', 'height'], 'K'] T_i: ['ion temperature', 'GDZ-sph', ['time', 'lon', 'lat', 'height'], 'K'] T_n_ilev: ['neutral temperature', 'GDZ-sph', ['time', 'lon', 'lat', 'ilev'], 'K'] T_n: ['neutral temperature', 'GDZ-sph', ['time', 'lon', 'lat', 'height'], 'K'] DTM: T_exo: ['Exospheric temperature', 'GDZ-sph', ['time', 'lon', 'lat'], 'K'] T: ['temperature', 'GDZ-sph', ['time', 'lon', 'lat', 'height'], 'K'] GAMERA_GM: No temperature variables found. GITM: T_n: ['neutral temperature', 'GDZ-sph', ['time', 'lon', 'lat', 'height'], 'K'] T_e: ['electron temperature', 'GDZ-sph', ['time', 'lon', 'lat', 'height'], 'K'] T_i: ['ion temperature', 'GDZ-sph', ['time', 'lon', 'lat', 'height'], 'K'] IRI: T_e: ['electron temperature', 'GDZ-sph', ['time', 'lon', 'lat', 'height'], 'K'] T_i: ['ion temperature', 'GDZ-sph', ['time', 'lon', 'lat', 'height'], 'K'] T_n: ['neutral temperature', 'GDZ-sph', ['time', 'lon', 'lat', 'height'], 'K'] OpenGGCM_GM: No temperature variables found. SuperDARN_uni: No temperature variables found. SuperDARN_equ: No temperature variables found. SWMF_IE: No temperature variables found. SWMF_GM: No temperature variables found. TIEGCM: T_n_ilev: ['neutral temperature', 'GDZ-sph', ['time', 'lon', 'lat', 'ilev'], 'K'] T_n: ['neutral temperature', 'GDZ-sph', ['time', 'lon', 'lat', 'height'], 'K'] T_e_ilev: ['electron temperature', 'GDZ-sph', ['time', 'lon', 'lat', 'ilev'], 'K'] T_e: ['electron temperature', 'GDZ-sph', ['time', 'lon', 'lat', 'height'], 'K'] T_i_ilev: ['ion temperature', 'GDZ-sph', ['time', 'lon', 'lat', 'ilev'], 'K'] T_i: ['ion temperature', 'GDZ-sph', ['time', 'lon', 'lat', 'height'], 'K'] WACCMX: T_ilev: ['Temperature', 'GDZ-sph', ['time', 'lon', 'lat', 'ilev'], 'K'] T: ['Temperature', 'GDZ-sph', ['time', 'lon', 'lat', 'height'], 'K'] T_e_ilev: ['Electron Temperature', 'GDZ-sph', ['time', 'lon', 'lat', 'ilev'], 'K'] T_e: ['Electron Temperature', 'GDZ-sph', ['time', 'lon', 'lat', 'height'], 'K'] T_i_ilev: ['Ion Temperature', 'GDZ-sph', ['time', 'lon', 'lat', 'ilev'], 'K'] T_i: ['Ion Temperature', 'GDZ-sph', ['time', 'lon', 'lat', 'height'], 'K'] T_08_COS_ilev: ['Temperature 8hr. cos coeff.', 'GDZ-sph', ['time', 'lon', 'lat', 'ilev'], 'K'] T_08_COS: ['Temperature 8hr. cos coeff.', 'GDZ-sph', ['time', 'lon', 'lat', 'height'], 'K'] T_08_SIN_ilev: ['Temperature 8hr. sin coeff.', 'GDZ-sph', ['time', 'lon', 'lat', 'ilev'], 'K'] T_08_SIN: ['Temperature 8hr. sin coeff.', 'GDZ-sph', ['time', 'lon', 'lat', 'height'], 'K'] T_12_COS_ilev: ['Temperature 12hr. cos coeff.', 'GDZ-sph', ['time', 'lon', 'lat', 'ilev'], 'K'] T_12_COS: ['Temperature 12hr. cos coeff.', 'GDZ-sph', ['time', 'lon', 'lat', 'height'], 'K'] T_12_SIN_ilev: ['Temperature 12hr. sin coeff.', 'GDZ-sph', ['time', 'lon', 'lat', 'ilev'], 'K'] T_12_SIN: ['Temperature 12hr. sin coeff.', 'GDZ-sph', ['time', 'lon', 'lat', 'height'], 'K'] T_24_COS_ilev: ['Temperature 24hr. cos coeff.', 'GDZ-sph', ['time', 'lon', 'lat', 'ilev'], 'K'] T_24_COS: ['Temperature 24hr. cos coeff.', 'GDZ-sph', ['time', 'lon', 'lat', 'height'], 'K'] T_24_SIN_ilev: ['Temperature 24hr. sin coeff.', 'GDZ-sph', ['time', 'lon', 'lat', 'ilev'], 'K'] T_24_SIN: ['Temperature 24hr. sin coeff.', 'GDZ-sph', ['time', 'lon', 'lat', 'height'], 'K'] WAMIPE: T_n_ilev: ['neutral temperature', 'GDZ-sph', ['time', 'lon', 'lat', 'ilev'], 'K'] T_n: ['neutral temperature', 'GDZ-sph', ['time', 'lon', 'lat', 'height'], 'K'] T_i: ['Ion temperature', 'GDZ-sph', ['time', 'lon', 'lat', 'height'], 'K'] T_e: ['Electron temperature', 'GDZ-sph', ['time', 'lon', 'lat', 'height'], 'K'] Weimer: No temperature variables found.
Choosing a variable¶
In [6]:
Copied!
# Temperature variables
MW.Variable_Search('temperature', model='DTM')
# Temperature variables
MW.Variable_Search('temperature', model='DTM')
T_exo: ['Exospheric temperature', 'GDZ-sph', ['time', 'lon', 'lat'], 'K'] T: ['temperature', 'GDZ-sph', ['time', 'lon', 'lat', 'height'], 'K']
In [7]:
Copied!
# All variables
MW.Variable_Search('', model='DTM')
# All variables
MW.Variable_Search('', model='DTM')
The DTM model accepts the standardized variable names listed below. ----------------------------------------------------------------------------------- N_H : '['Atomic hydrogen partial density', 0, 'GDZ', 'sph', ['time', 'lon', 'lat', 'height'], 'g/cm**3']' N_He : '['Atomic helium partial density', 0, 'GDZ', 'sph', ['time', 'lon', 'lat', 'height'], 'g/cm**3']' N_N2 : '['Molecular nitrogen partial density', 0, 'GDZ', 'sph', ['time', 'lon', 'lat', 'height'], 'g/cm**3']' N_O : '['Atomic oxygen partial density', 0, 'GDZ', 'sph', ['time', 'lon', 'lat', 'height'], 'g/cm**3']' N_O2 : '['Molecular oxygen partial density', 0, 'GDZ', 'sph', ['time', 'lon', 'lat', 'height'], 'g/cm**3']' T : '['temperature', 0, 'GDZ', 'sph', ['time', 'lon', 'lat', 'height'], 'K']' T_exo : '['Exospheric temperature', 0, 'GDZ', 'sph', ['time', 'lon', 'lat'], 'K']' m_avgmol : '['Mean molecular mass', 0, 'GDZ', 'sph', ['time', 'lon', 'lat', 'height'], 'g']' rho : '['Total mass density', 0, 'GDZ', 'sph', ['time', 'lon', 'lat', 'height'], 'g/cm**3']'
Choosing a dataset¶
Notes:
- Change the file_dir variable in the next cell to be the file path to the chosen dataset before running.
- This command and any call to MW.Variable_Search that includes the file_dir also performs any file conversion or pre-processing necessary.
In [12]:
Copied!
# All variables available in the chosen data
file_dir = '/Users/ddezeeuw/KAMODO_DEMO/DTM/Joshua_Anumolu_101722_IT_1/'
MW.Variable_Search('', model='DTM', file_dir=file_dir)
# All variables available in the chosen data
file_dir = '/Users/ddezeeuw/KAMODO_DEMO/DTM/Joshua_Anumolu_101722_IT_1/'
MW.Variable_Search('', model='DTM', file_dir=file_dir)
The file directory contains the following standardized variable names: ----------------------------------------------------------------------------------- T_exo : '['Exospheric temperature', 0, 'GDZ', 'sph', ['time', 'lon', 'lat'], 'K']' T : '['temperature', 0, 'GDZ', 'sph', ['time', 'lon', 'lat', 'height'], 'K']' rho : '['Total mass density', 0, 'GDZ', 'sph', ['time', 'lon', 'lat', 'height'], 'g/cm**3']' m_avgmol : '['Mean molecular mass', 0, 'GDZ', 'sph', ['time', 'lon', 'lat', 'height'], 'g']' N_H : '['Atomic hydrogen partial density', 0, 'GDZ', 'sph', ['time', 'lon', 'lat', 'height'], 'g/cm**3']' N_He : '['Atomic helium partial density', 0, 'GDZ', 'sph', ['time', 'lon', 'lat', 'height'], 'g/cm**3']' N_O : '['Atomic oxygen partial density', 0, 'GDZ', 'sph', ['time', 'lon', 'lat', 'height'], 'g/cm**3']' N_N2 : '['Molecular nitrogen partial density', 0, 'GDZ', 'sph', ['time', 'lon', 'lat', 'height'], 'g/cm**3']' N_O2 : '['Molecular oxygen partial density', 0, 'GDZ', 'sph', ['time', 'lon', 'lat', 'height'], 'g/cm**3']'
In [13]:
Copied!
# Temperature variables in the chosen data.
MW.Variable_Search('temperature', model='DTM', file_dir=file_dir)
# Temperature variables in the chosen data.
MW.Variable_Search('temperature', model='DTM', file_dir=file_dir)
T_exo: ['Exospheric temperature', 'GDZ-sph', ['time', 'lon', 'lat'], 'K'] T: ['temperature', 'GDZ-sph', ['time', 'lon', 'lat', 'height'], 'K']
Querying a dataset¶
In [14]:
Copied!
MW.File_Times('DTM', file_dir)
MW.File_Times('DTM', file_dir)
UTC time ranges ------------------------------------------ Start Date: 2003-11-19 Time: 00:00:00 End Date: 2003-11-22 Time: 23:45:00
Out[14]:
(datetime.datetime(2003, 11, 19, 0, 0, tzinfo=datetime.timezone.utc), datetime.datetime(2003, 11, 22, 23, 45, tzinfo=datetime.timezone.utc))