Skip to content
Snippets Groups Projects
Commit 9cf45671 authored by lkugler's avatar lkugler
Browse files

docs

parent 4923d09d
No related branches found
No related tags found
No related merge requests found
"""Read, modify and save DART obs_seq.out/obs_seq.final files in DART format. """Read, modify and save DART obs_seq.out/obs_seq.final files in DART format.
Examples: Examples:
$ from dartwrf.obs.obsseq import ObsSeq >>> from dartwrf.obs.obsseq import ObsSeq
$ obs = ObsSeq('path/to/obs_seq.final') >>> osf = ObsSeq('path/to/obs_seq.final')
$ obs.df # pandas.DataFrame with all observations (rows) pandas.DataFrame with all observations (rows)
>>> osf.df
$ obs.df['observations'] # observation values (np.array) observations truth prior ensemble mean posterior ensemble mean ... kind metadata time variance
$ obs.df['truth'] # truth values (np.array) 0 0.292800 0.289466 0.360284 0.330799 ... 262 [ visir\n, 180.000000000000 45.00000... (50400, 148864) 0.0009
$ obs.df['prior ensemble spread'] # spread of prior ensemble (np.array) 1 0.292800 0.289466 0.398444 0.380152 ... 262 [ visir\n, 180.000000000000 45.00000... (50400, 148864) 0.0009
$ obs.df['variance'] # observation error variances (np.array) 2 0.310016 0.289466 0.355061 0.369988 ... 262 [ visir\n, 180.000000000000 45.00000... (50400, 148864) 0.0009
3 0.297182 0.289466 0.305424 0.302489 ... 262 [ visir\n, 180.000000000000 45.00000... (50400, 148864) 0.0009
$ obs.df.get_prior_Hx() # H(x_prior) for all ensemble members (np.array) 4 0.292800 0.293797 0.306238 0.303252 ... 262 [ visir\n, 180.000000000000 45.00000... (50400, 148864) 0.0009
$ obs.df.get_posterior_Hx() # H(x_posterior) for all ensemble members (np.array) .. ... ... ... ... ... ... ... ... ...
956 0.762274 0.796486 0.664451 0.833559 ... 262 [ visir\n, 180.000000000000 45.00000... (50400, 148864) 0.0009
$ obs.df.get_lon_lat() # longitude and latitude of observations (pd.DataFrame) 957 0.525743 0.500751 0.534391 0.653267 ... 262 [ visir\n, 180.000000000000 45.00000... (50400, 148864) 0.0009
958 0.341627 0.348115 0.405534 0.447314 ... 262 [ visir\n, 180.000000000000 45.00000... (50400, 148864) 0.0009
$ obs.to_dart('path/to/obs_seq.final') # write to file 959 0.826649 0.835491 0.374459 0.785951 ... 262 [ visir\n, 180.000000000000 45.00000... (50400, 148864) 0.0009
960 0.320477 0.343154 0.303468 0.325203 ... 262 [ visir\n, 180.000000000000 45.00000... (50400, 148864) 0.0009
[961 rows x 93 columns]
>>> osf.df.get_prior_Hx() # H(x_prior) for all ensemble members (np.array)
>>> osf.df.get_posterior_Hx() # H(x_posterior) for all ensemble members (np.array)
>>> osf.to_dart('path/to/obs_seq.final') # write to file
Note: Note:
Can not create obs_seq from scratch, since it does not know which metadata is necessary for each observation type Can not create obs_seq from scratch, since it does not know which metadata is necessary for each observation type
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment