mzamyatina / phd_ukca Goto Github PK
View Code? Open in Web Editor NEWJupyter notebooks used to process UM-UKCA data for my PhD
Jupyter notebooks used to process UM-UKCA data for my PhD
Refactored code for plt_atom_xojn_vps.ipynb
# Read ATom geo coords
DEFAULT_GROUP = "WAS"
species_deps_groups = {
"ch4": {"deps": ["CH4_NOAA"], "group": "NOAA-Picarro"},
"c2h6": {
"deps": ["Ethane_WAS", "Ethene_WAS", "Ethyne_WAS"],
},
"c3h8": {
"deps": ["Propane_WAS", "Propene_WAS"],
},
"no": {"deps": ["NO_CL"], "group": "NOyO3-NO"},
"o3": {"deps": ["O3_CL"], "group": "NOyO3-O3"},
"oh": {"deps": ["OH_pptv"], "group": "ATHOS-HOx"},
"meono2": {
"deps": ["MeONO2_WAS"],
},
"etono2": {
"deps": ["EtONO2_WAS"],
},
"nprono2": {
"deps": ["n-PrONO2_WAS"],
},
"iprono2": {
"deps": ["i-PrONO2_WAS"],
},
}
sample_lons, sample_lats = {}, {} # for easy access of lon, lat
atom_data = {} # Yay, another dictionary!
for season in SEASONS:
# Deal with lon, lat separately
ds = xr.open_mfdataset(sorted(path_to_atom.glob(f'MER-WAS_DC8_20{season}*.nc')), group='MMS', decode_cf=True)
sample_lons[season] = ds.G_LONG.values
sample_lats[season] = ds.G_LAT.values
# Create an empty dict for each season to store data for each of the groups
atom_data[season] = {}
for key in ['ch4', 'o3', 'oh']:
# Loop over selected groups
atom_data[season][key] = xr.open_mfdataset(sorted(path_to_atom.glob(f'MER-WAS_DC8_20{season}*.nc')), group=species_deps_groups[key].get(group, DEFAULT_GROUP), decode_cf=True)
_lon_lat = np.logical_or(*[np.isnan(atom_data[season][key][i].values) for i in atom_data[season][key][species_deps[the_species]]])
# Mask out coordinates of missing data
sample_lons[season][_lon_lat] = np.nan
sample_lats[season][_lon_lat] = np.nan
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.