def precip_monthly(self, *, yearmon: str, target: str, member: str) -> Vardef: _, month = dates.parse_yearmon(target) return paths.Vardef( os.path.join(self.subdir(), 'mean_prate_month_{:02d}.nc'.format(month)), 'Pr')
def p_wetdays(self, *, yearmon: str, target: str, member: str) -> Vardef: _, month = dates.parse_yearmon(target) return paths.Vardef( os.path.join(self.subdir(), 'mean_p_wetdays_month_{:02d}.nc'.format(month)), 'pWetDays')
def p_wetdays(self, *, yearmon=None, target, member=None): month = int(target[4:]) return paths.Vardef( os.path.join( self.source, 'NCEP', 'wetdays_ltmean', 'wetdays_ltmean_month_{month:02d}.nc'.format(month=month)), 'pWetDays')
def p_wetdays(self, *, yearmon: str) -> paths.Vardef: year, month = dates.parse_yearmon(yearmon) if year < 1979: return self.mean_p_wetdays(month) else: return paths.Vardef( os.path.join(self.source, 'NCEP', 'wetdays', 'wetdays_{yearmon}.nc'.format(yearmon=yearmon)), 'pWetDays')
def compute_fit_hindcast(self, varname: str, target_month: int, lead: int) -> List[Step]: assert varname in {'T', 'Pr'} inputs = [ str( paths.Vardef( self.hindcast_raw(timestamp=timestamp, target=target), varname)) for timestamp, target in self.available_hindcasts( target_month, lead) ] return [ commands.wsim_fit(distribution='gev', inputs=inputs, output=self.fit_retro(var=varname, target_month=target_month, lead_months=lead), window=1) ]
def elevation(self) -> paths.Vardef: return paths.Vardef( os.path.join(self.source, 'GMTED2010', 'gmted2010_05deg.tif'), '1')
def flowdir(self) -> paths.Vardef: return paths.Vardef( os.path.join(self.source, 'STN_30', 'g_network.asc'), '1')
def precip_monthly(self, *, yearmon: str, target: str, member: str) -> paths.Vardef: return paths.Vardef( self.forecast_corrected(yearmon=yearmon, target=target, member=member), 'Pr')
def flowdir(self): return paths.Vardef(os.path.join( self.source, 'NTSG_DRT', 'drt_flow_directions_0125deg_nldas.tif'), var='1')
def provinces(self) -> paths.Vardef: return paths.Vardef( os.path.join(self.source, 'GADM', 'gadm36_level_1.gpkg'), None)
def power_plants(self) -> paths.Vardef: return paths.Vardef( os.path.join(self.source, 'GPPD', 'gppd_inferred_cooling.nc'), None)
def dam_locations(self) -> paths.Vardef: return paths.Vardef(grand.dam_locations(self.source), None)
def basins(self) -> paths.Vardef: return paths.Vardef( os.path.join(self.source, 'HydroBASINS', 'basins_lev07.shp'), None)
def temp_monthly(self, *, yearmon: str) -> paths.Vardef: year, _ = dates.parse_yearmon(yearmon) return paths.Vardef(os.path.join(self.source, 'GHCN_CAMS', str(year), 'ghcn_cams_{yearmon}.nc'.format(yearmon=yearmon)), 'T')
def temp_monthly(self, *, yearmon, target, member): return paths.Vardef( self.forecast_corrected(yearmon=yearmon, target=target, member=member), 'T')
def mean_p_wetdays(self, month: int) -> Vardef: return paths.Vardef(os.path.join(self.source, 'NCEP', 'wetdays_ltmean', 'wetdays_ltmean_month_{month:02d}.nc'.format(month=month)), 'pWetDays')
def precip_monthly(self, *, yearmon: str) -> paths.Vardef: year, _ = dates.parse_yearmon(yearmon) return paths.Vardef(os.path.join(self.source, 'PRECL', str(year), 'precl_{yearmon}.nc'.format(yearmon=yearmon)), 'Pr')
def basin_downstream(self) -> paths.Vardef: return paths.Vardef( os.path.join(self.source, 'HydroBASINS', 'basins_lev07_downstream.nc'), 'next_down')
def precip_monthly(self, *, yearmon: str) -> paths.Vardef: return paths.Vardef(os.path.join(self.source, 'CPC_Global_Daily_Precipitation', 'monthly_sum', 'P_{}.nc'.format(yearmon)), 'Pr')
def water_stress(self) -> paths.Vardef: return paths.Vardef( os.path.join(self.source, 'Aqueduct', 'aqueduct_baseline_water_stress.tif'), '1')
def temp_monthly(self, *, yearmon: str) -> paths.Vardef: return paths.Vardef(os.path.join(self.source, 'CPC_Global_Daily_Temperature', 'monthly_mean', 'T_{}.nc'.format(yearmon)), 'tavg')
def countries(self) -> paths.Vardef: return paths.Vardef( os.path.join(self.source, 'GADM', 'gadm36_level_0.gpkg'), None)
def p_wetdays(self, *, yearmon: str) -> paths.Vardef: return paths.Vardef(os.path.join(self.source, 'CPC_Global_Daily_Precipitation', 'monthly_wetdays', 'pWetDays_{}.nc'.format(yearmon)), 'pWetDays')
def wc(self): return paths.Vardef( os.path.join(self.source, 'ISRIC', 'wise_0125deg_nldas_v1_tawc.tif'), '1')
def mean_p_wetdays(self, month: int) -> paths.Vardef: return paths.Vardef(os.path.join(self.source, 'CPC_Global_Daily_Precipitation', 'monthly_wetdays_mean', 'mean_pWetDays_month_{:02d}.nc'.format(month)), 'pWetDays')
def elevation(self): return paths.Vardef( os.path.join(self.source, 'GMTED2010', 'gmted2010_0125deg_nldas.tif'), '1')
def production(self, method: paths.Method) -> paths.Vardef: return paths.Vardef( os.path.join(self.source, spam2010.SUBDIR, 'production_{}.nc'.format(method.value)), 'production')
def wc(self) -> paths.Vardef: return paths.Vardef( os.path.join(self.source, 'ISRIC', 'wise_05deg_v1_tawc.tif'), '1')
def precip_monthly(self, *, yearmon: str) -> paths.Vardef: return paths.Vardef( os.path.join(self.source, 'NCEP', 'P', 'P_{yearmon}.nc'.format(yearmon=yearmon)), 'P')