Beispiel #1
0
def read_ERS_ssm(gpi,
                 args=['sm', 'sm_noise', 'proc_flag', 'orbit_dir'],
                 plot=False,
                 start=None,
                 end=None):

    ers_folder = os.path.join(root.r, 'Datapool_processed', 'WARP', 'WARP5.5',
                              'ERS_AMI_WS_WARP5.5_R1.1', '070_ssm', 'netcdf')

    ers_grid_folder = os.path.join(root.r, 'Datapool_processed', 'WARP',
                                   'ancillary', 'warp5_grid')

    ers_SSM_reader = ers.ERS_SSM(ers_folder,
                                 ers_grid_folder,
                                 include_in_df=args)

    ers_df = ers_SSM_reader.read_ssm(gpi)
    ers_df = ers_df.data['sm']

    if start is not None and end is not None:
        ers_ts = ers_df[start:end]
    elif start is not None:
        ers_ts = ers_df[start:]
    elif end is not None:
        ers_ts = ers_df[:end]
    else:
        ers_ts = ers_df

    if plot == True:
        ers_ts.plot()
        plt.show()

    return ers_ts
Beispiel #2
0
    def setUp(self):
        self.ers_folder = os.path.join(os.path.dirname(__file__), '..',
                                       'test-data', 'sat', 'ers', '55R11')

        self.ers_grid_folder = os.path.join(os.path.dirname(__file__), '..',
                                            'test-data', 'sat', 'ascat',
                                            'netcdf', 'grid')

        # init the ERS_SSM reader with the paths
        self.ers_SSM_reader = ers.ERS_SSM(self.ers_folder,
                                          self.ers_grid_folder)