Changeset 3868 for trunk/LMDZ.PLUTO/util/script_figures/FV3_utils.py
- Timestamp:
- Jul 28, 2025, 3:43:42 PM (9 days ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.PLUTO/util/script_figures/FV3_utils.py
r3833 r3868 60 60 return alpha,airetot 61 61 62 def switchlon(arr ):62 def switchlon(arr, lon): 63 63 # changer les longitudes pour mettre TR au centre 64 64 vec=np.shape(arr) 65 65 myvar=np.zeros(vec,dtype='f') 66 if (lon is not None and lon[0]>=0): 67 return arr 66 68 # i lat : pas de changement 67 69 # j lon : … … 1260 1262 tmp_var = find_coord_var(nc1, dim) 1261 1263 file_values = nc1.variables[tmp_var][:] 1264 if dim is LON_DIMS and file_values[0]<0: 1265 file_values+=180 # start longitudes at 0 rather than -180 1262 1266 i = getind(values, file_values) 1263 print( dim, i)1264 if len( i)==2: # range of indices1267 print("Getting",dim[0], i, file_values[i]) 1268 if len(np.atleast_1d(i))==2: # range of indices 1265 1269 slicer[dim_idx] = slice(min(i),max(i)+1) 1266 1270 else: # specific index 1267 slicer[dim_idx] = i1271 slicer[dim_idx] = slice(i,i+1) 1268 1272 except: 1269 1273 continue
Note: See TracChangeset
for help on using the changeset viewer.