Ejemplo n.º 1
0
observations.append(ob34)
observations.append(ob35)
observations.append(ob36)
observations.append(ob37)
observations.append(ob38)
observations.append(ob39)
observations.append(ob40)
observations.append(ob41)
observations.append(ob42)

# Put the state class object and observation objects into EnSRF object
assimilator = EnSRF(statecls, observations, loc='GC')
print(assimilator)

# Update the prior with EFA- post_state is an EnsembleState object
post_state, post_obs = assimilator.update()

state = post_state
outfile = '/home/disk/hot/stangen/Documents/GEFS/posterior/' + \
            '2017090600/2017090600_21mem_10days_42MSLP_Z500_WC_efa.nc'
tunit = 'seconds since 1970-01-01'
# Write ensemble forecast to netcdf
with Dataset(outfile, 'w') as dset:
    dset.createDimension('time', None)
    dset.createDimension('lat', state.ny())
    dset.createDimension('lon', state.nx())
    dset.createDimension('ens', state.nmems())
    dset.createVariable('time', 'i4', ('time', ))
    dset.createVariable('lat', 'f8', ('lat', ))
    dset.createVariable('lon', 'f8', ('lon'))
    dset.createVariable('ens', 'i4', ('ens', ))
Ejemplo n.º 2
0
                        observations = [observations[o_ind]]
                        print(' Only assimilating the ob at {}N {}E'.format(
                            olat, olon))

                #==== ASSIMILATE THE OBS ======================================================
                    print('\n(3) Assimilating the observations...')
                    assimilator = EnSRF(state,
                                        observations,
                                        nproc=1,
                                        verbose=True,
                                        loc=localization,
                                        inflation=inflations)
                    start = time.time()
                    if plot_covs:
                        assert one_ob
                        covs, kal, mask = assimilator.update(return_covs=True,
                                                             cov_file=cov_file)

                        plot_covariances(lons,
                                         lats,
                                         covs,
                                         kal,
                                         mask,
                                         varlist,
                                         olat,
                                         olon,
                                         ndays,
                                         cov_file=cov_file)
                    else:
                        if use_most_recent_mean_state:
                            assimilator2 = EnSRF(most_recent_state,
                                                 observations,