Loading py/cso_constants.py +2 −5 Original line number Diff line number Diff line # # CSO constants. # # Changes # # 2023-08, Arjo Segers # Reformatted using 'black'. # ######################################################################## ### ### help ### ######################################################################## """ .. _cso-constants: Loading py/cso_mapping.py +1 −1 Original line number Diff line number Diff line Loading @@ -84,7 +84,7 @@ def LonLatDistance(lon1, lat1, lon2, lat2): # # modules: import math import numpy # tools: from cso_constants import EarthRadius Loading py/cso_plot.py +4 −6 Original line number Diff line number Diff line Loading @@ -754,9 +754,8 @@ class ColorbarFigure(Figure): # endif # get red/green/blue arrays for extensions: red_under, green_under, blue_under = matplotlib.colors.colorConverter.to_rgb( color_under ) (red_under, green_under, blue_under) = \ matplotlib.colors.colorConverter.to_rgb(color_under) red_over, green_over, blue_over = matplotlib.colors.colorConverter.to_rgb(color_over) # initialise color dictionary: Loading Loading @@ -1702,9 +1701,8 @@ def mid2corners(xx): # * def GetGrid( shp, xx=None, yy=None, x=None, y=None, xm=None, ym=None, xxm=None, yym=None, domain=None ): def GetGrid( shp, xx=None, yy=None, x=None, y=None, xm=None, ym=None, xxm=None, yym=None, domain=None): """ Return 2D grid arrays with corner points. Loading py/cso_regions.py +17 −10 Original line number Diff line number Diff line Loading @@ -1800,8 +1800,9 @@ class CSO_Catalogue_RegionsMaps(cso_catalogue.CSO_CatalogueBase): continue # store: if (len(reg_used) == 0) or (reg_code not in reg_used["code"].values): reg_used = reg_used.append( {"code": reg_code, "name": reg_name}, ignore_index=True reg_used = pandas.concat( [reg_used, pandas.DataFrame({"code": reg_code, "name": reg_name}),], ignore_index=True, ) # endif Loading Loading @@ -2116,8 +2117,10 @@ class CSO_Catalogue_RegionsTimeSeries(cso_catalogue.CSO_CatalogueBase): continue # store: if (len(reg_used) == 0) or (reg_code not in reg_used["code"].values): reg_used = reg_used.append( {"code": reg_code, "name": reg_name}, ignore_index=True reg_used = pandas.concat( [ reg_used, pandas.DataFrame({"code": reg_code, "name": reg_name}), ], ignore_index=True, ) # endif Loading Loading @@ -2225,6 +2228,12 @@ class CSO_Catalogue_RegionsTimeSeries(cso_catalogue.CSO_CatalogueBase): attrs={"units": units, "long_name": long_name}, ) # endfor # create directory? dname = os.path.dirname(regts_file) if len(dname) > 0: if not os.path.isdir(dname): os.makedirs(dname) # endif # save: dst.to_netcdf(regts_file) Loading Loading @@ -2453,18 +2462,16 @@ class CSO_Statistics_RegionsTables(utopya.UtopyaRc): rbias = (sim - obs) / obs rbias_label = "(sim-obs)/obs" # add record: df = df.append( pandas.DataFrame( { df = pandas.concat( [ df, pandas.DataFrame( { "iso2": [reg_code2], "iso3": [reg_code], "name": [reg_name], "time": [tlab], obs_label: [obs], sim_label: [sim], rbias_label: [rbias], } ), rbias_label: [rbias], } ), ], ignore_index=True, ) Loading Loading
py/cso_constants.py +2 −5 Original line number Diff line number Diff line # # CSO constants. # # Changes # # 2023-08, Arjo Segers # Reformatted using 'black'. # ######################################################################## ### ### help ### ######################################################################## """ .. _cso-constants: Loading
py/cso_mapping.py +1 −1 Original line number Diff line number Diff line Loading @@ -84,7 +84,7 @@ def LonLatDistance(lon1, lat1, lon2, lat2): # # modules: import math import numpy # tools: from cso_constants import EarthRadius Loading
py/cso_plot.py +4 −6 Original line number Diff line number Diff line Loading @@ -754,9 +754,8 @@ class ColorbarFigure(Figure): # endif # get red/green/blue arrays for extensions: red_under, green_under, blue_under = matplotlib.colors.colorConverter.to_rgb( color_under ) (red_under, green_under, blue_under) = \ matplotlib.colors.colorConverter.to_rgb(color_under) red_over, green_over, blue_over = matplotlib.colors.colorConverter.to_rgb(color_over) # initialise color dictionary: Loading Loading @@ -1702,9 +1701,8 @@ def mid2corners(xx): # * def GetGrid( shp, xx=None, yy=None, x=None, y=None, xm=None, ym=None, xxm=None, yym=None, domain=None ): def GetGrid( shp, xx=None, yy=None, x=None, y=None, xm=None, ym=None, xxm=None, yym=None, domain=None): """ Return 2D grid arrays with corner points. Loading
py/cso_regions.py +17 −10 Original line number Diff line number Diff line Loading @@ -1800,8 +1800,9 @@ class CSO_Catalogue_RegionsMaps(cso_catalogue.CSO_CatalogueBase): continue # store: if (len(reg_used) == 0) or (reg_code not in reg_used["code"].values): reg_used = reg_used.append( {"code": reg_code, "name": reg_name}, ignore_index=True reg_used = pandas.concat( [reg_used, pandas.DataFrame({"code": reg_code, "name": reg_name}),], ignore_index=True, ) # endif Loading Loading @@ -2116,8 +2117,10 @@ class CSO_Catalogue_RegionsTimeSeries(cso_catalogue.CSO_CatalogueBase): continue # store: if (len(reg_used) == 0) or (reg_code not in reg_used["code"].values): reg_used = reg_used.append( {"code": reg_code, "name": reg_name}, ignore_index=True reg_used = pandas.concat( [ reg_used, pandas.DataFrame({"code": reg_code, "name": reg_name}), ], ignore_index=True, ) # endif Loading Loading @@ -2225,6 +2228,12 @@ class CSO_Catalogue_RegionsTimeSeries(cso_catalogue.CSO_CatalogueBase): attrs={"units": units, "long_name": long_name}, ) # endfor # create directory? dname = os.path.dirname(regts_file) if len(dname) > 0: if not os.path.isdir(dname): os.makedirs(dname) # endif # save: dst.to_netcdf(regts_file) Loading Loading @@ -2453,18 +2462,16 @@ class CSO_Statistics_RegionsTables(utopya.UtopyaRc): rbias = (sim - obs) / obs rbias_label = "(sim-obs)/obs" # add record: df = df.append( pandas.DataFrame( { df = pandas.concat( [ df, pandas.DataFrame( { "iso2": [reg_code2], "iso3": [reg_code], "name": [reg_name], "time": [tlab], obs_label: [obs], sim_label: [sim], rbias_label: [rbias], } ), rbias_label: [rbias], } ), ], ignore_index=True, ) Loading