Changeset 6123 for TOOLS


Ignore:
Timestamp:
04/25/22 16:14:24 (2 years ago)
Author:
snguyen
Message:

added .data to define nav_lon, nav_lat in bathymetry. added exception if no user login can be found

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TOOLS/MOSAIX/Build_coordinates_mask.py

    r5951 r6123  
    104104except :  
    105105    print ('Bathymetry file: Exception') 
    106     nav_lon_grid_T = f_bathy ['nav_lon'] 
    107     nav_lat_grid_T = f_bathy ['nav_lat'] 
     106    nav_lon_grid_T = f_bathy ['nav_lon'].data 
     107    nav_lat_grid_T = f_bathy ['nav_lat'].data 
    108108    Bathymetry = xr.DataArray (Bathymetry, coords = { "nav_lat_grid_T": (["y", "x"], nav_lat_grid_T), 
    109109                                                      "nav_lon_grid_T": (["y", "x"], nav_lon_grid_T) } ) 
     
    437437ds.attrs['history']      = 'Build from ' + n_coord + ' and ' + n_bathy 
    438438ds.attrs['directory']    = os.getcwd     () 
    439 ds.attrs['user']         = os.getlogin   () 
     439try: 
     440    ds.attrs['user']         = os.getlogin   () 
     441except: 
     442    ds.attrs['user']         = 'NoUser' 
    440443ds.attrs['HOSTNAME']     = platform.node () 
    441444ds.attrs['Python']       = 'Python version: ' +  platform.python_version () 
Note: See TracChangeset for help on using the changeset viewer.