@@ -94,7 +94,7 @@ def GridAspectRatio(ratios, src=GetActiveSource()):
94
94
return calc
95
95
96
96
# transform coordinates: logarithmic, aspect ratio
97
- def TransformCoords (src = GetActiveSource (), aspectRatios = [1 ,1 ,1 ], logCoords = [2 ], basis = 1e3 ):
97
+ def TransformCoords (src = GetActiveSource (), aspectRatios = [1 ,1 ,1 ], logCoords = [2 ], basis = [ 1e3 ] ):
98
98
"""Transform the coordinates depending on whether or not there are logarithmic coordinates"""
99
99
if len (logCoords )> 0 :
100
100
transCoor = Cart2Log (src = src ,ratios = aspectRatios ,logCoords = logCoords ,basis = basis )
@@ -111,7 +111,7 @@ def MakeSelectable(src=GetActiveSource()):
111
111
112
112
######### read in data, redefine pressure coordinates and change aspect ratio ###############
113
113
114
- def LoadData ( fileName , ncDims = ['lon' ,'lat' ,'pfull' ], aspectRatios = [1 ,1 ,1 ], logCoords = [2 ], basis = [1e3 ] ):
114
+ def LoadData ( fileName , ncDims = ['lon' ,'lat' ,'pfull' ], aspectRatios = [1 ,1 ,1 ], logCoords = [2 ], basis = [1e3 ], replaceNaN = True ):
115
115
"""Load netCDF file, convert coordinates into useful aspect ratio.
116
116
117
117
Adds file output_nc, and Calculator LogP or Calculator AspRat to the pipeline
@@ -122,6 +122,7 @@ def LoadData( fileName, ncDims=['lon','lat','pfull'], aspectRatios=[1,1,1], logC
122
122
aspectRatios -- how to scale coordinates [xscale,yscale,zscale]. Z coordinate is scaled after applying log10 for logarithmic axes
123
123
logCoords -- index/indices of dimension(s) to be logarithmic
124
124
basis -- basis to normalize argument to logarithm (ie defines origin). List of same length as logCoords
125
+ replaceNaN -- whether or not to replace the FillValue with NaNs
125
126
OUTPUTS:
126
127
output_nc -- netCDF reader object with the file data as read
127
128
transCoor -- Calculator filter corresponding to the transformed coordinates
@@ -139,7 +140,7 @@ def LoadData( fileName, ncDims=['lon','lat','pfull'], aspectRatios=[1,1,1], logC
139
140
140
141
output_nc .SphericalCoordinates = 0
141
142
output_nc .OutputType = 'Unstructured'
142
- output_nc .ReplaceFillValueWithNan = 0
143
+ output_nc .ReplaceFillValueWithNan = replaceNaN
143
144
MakeSelectable ()
144
145
RenameSource (fileName ,output_nc )
145
146
0 commit comments