Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timeseries data #23

Open
allibco opened this issue Jun 29, 2021 · 0 comments
Open

timeseries data #23

allibco opened this issue Jun 29, 2021 · 0 comments
Assignees

Comments

@allibco
Copy link
Collaborator

allibco commented Jun 29, 2021

Modify code such that the "new" data to compare can be timeseries or history file. The time series is useful when comparing older data where history files may have been deleted.

Here is what I did for POP to make a history file from timeseries files:

Use xarray to make multiple timeseries into history file for ECT:
(see ~/python/pinatubo.ipynb on glade)

import xarray as xr
import numpy as np

ds_yellow = xr.open_mfdataset("/glade/work/abaker/pinatubo/ocn_ens_out/lens001/orig_yellow/b.*.nc")
ds_yellow_mo12 = ds_yellow.isel(time=[11])

ds_yellow_ssh = ds_yellow_mo12["SSH"]
ds_yellow_salt = ds_yellow_mo12["SALT"]
ds_yellow_temp = ds_yellow_mo12["TEMP"]
ds_yellow_uvel = ds_yellow_mo12["UVEL"]
ds_yellow_vvel = ds_yellow_mo12["VVEL"]
ds_yellow_rm = ds_yellow_mo12["REGION_MASK"]

yellow_ds = xr.merge([ds_yellow_ssh, ds_yellow_temp, ds_yellow_salt, ds_yellow_uvel, ds_yellow_vvel, ds_yellow_rm])
yellow_ds
yellow_ds.to_netcdf("yellow_mask.nc")

@allibco allibco self-assigned this Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant