Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mathause/cesm
list CESM history files
https://github.com/mathause/cesm
cesm netcdf
Last synced: 29 days ago
JSON representation
list CESM history files
- Host: GitHub
- URL: https://github.com/mathause/cesm
- Owner: mathause
- License: mit
- Created: 2016-07-18T16:47:44.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2022-08-15T18:05:17.000Z (over 2 years ago)
- Last Synced: 2024-10-14T09:41:15.126Z (2 months ago)
- Topics: cesm, netcdf
- Language: Python
- Size: 51.8 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# cesm - list simulation files and retrieve data
## Usage
Define one or more simulations in `~/cesm_cases.yaml`:
```yaml
SMX2000:
folder: /net/exo/landclim/mathause/cesm_data/
name: f.e121.FC5.f19_g16.SMM2010_2000-io384.001
```List / select files:
```python
import cesmcase = cesm.case('SMX2000')
print(case.lnd.h0.filename)print(case.lnd.h1.sel(year=50))
```Output
```
['f.e121.FC5.f19_g16.SMM2010_2000-io384.001.clm2.h0.0001-01.nc',
'f.e121.FC5.f19_g16.SMM2010_2000-io384.001.clm2.h0.0001-02.nc',
'f.e121.FC5.f19_g16.SMM2010_2000-io384.001.clm2.h0.0001-03.nc'
...]'/net/.../f.e121.FC5.f19_g16.SMM2010_2000-io384.001.clm2.h1.0050-01-01-00000.nc'
```Load data:
```python
TREFHT = cesm.load.var(case.atm.h0, 'TREFHT', year=50)
print(TREFHT)
```Output
```
1 years require saving
writing variable: 50 in 50..50Dimensions: (lat: 96, lon: 144, time: 12)
Coordinates:
* lat (lat) float64 -90.0 -88.11 -86.21 -84.32 -82.42 -80.53 -78.63 ...
* lon (lon) float64 0.0 2.5 5.0 7.5 10.0 12.5 15.0 17.5 20.0 22.5 ...
* time (time) datetime64[ns] 2000-01-16T12:00:00 2000-02-15 ...
Data variables:
TREFHT (time, lat, lon) float32 242.634 243.037 242.642 242.609 ...```
## Note
With version 0.2.0 I disentangled this package with the changes I added on top of xarray (which was a very bad idea) by adding the `xarray_utils`. It should now work with the original version of xarray (but this is currenly untested).