Ignore:
Timestamp:
Jul 16, 2025, 3:25:48 PM (9 days ago)
Author:
jbclement
Message:

PEM:

  • Making the computation of CO2 mass balance more robust, especially regarding 'CO2cond_ps'.
  • Small correction about the dust tendency management for the layering algorithm.
  • Small improvement of the visualization in "visu_evol_layering.py".
  • File "log_launchPEM.txt" renamed into "launchPEM.log".

JBC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/util/display_netcdf.py

    r3849 r3851  
    8484
    8585# Attempt to load MOLA topography
    86 try:
    87     MOLA = np.load('MOLA_1px_per_deg.npy') # shape (nlat, nlon) at 1° per pixel: lat from -90 to 90, lon from 0 to 360
     86if os.path.isfile(MOLA_NPY): # shape (nlat, nlon) at 1° per pixel: lat from -90 to 90, lon from 0 to 360
     87    MOLA = np.load(MOLA_NPY)
    8888    nlat, nlon = MOLA.shape
    8989    topo_lats = np.linspace(90 - 0.5, -90 + 0.5, nlat)
     
    9191    topo_lon2d, topo_lat2d = np.meshgrid(topo_lons, topo_lats)
    9292    topo_loaded = True
    93 except Exception as e:
    94     print(f"Warning: '{MOLA_NPY}' not found: {e}")
     93else:
     94    print(f"Warning: '{MOLA_NPY}' not found! Topography contours disabled.")
    9595    topo_loaded = False
    9696
     
    101101    csv_loaded = True
    102102else:
    103     print(f"Warning: '{MOLA_CSV}' not found. 3D view colors disabled.")
     103    print(f"Warning: '{MOLA_CSV}' not found! 3D view colors disabled.")
    104104    csv_loaded = False
    105105
     
    585585        ax.set_ylabel(f"Latitude ({getattr(dataset.variables[latv], 'units', 'deg')})")
    586586        # Prompt for polar-stereo views if interactive
    587         if input("Display polar-stereo views? [y/n]: ").strip().lower() == "y":
     587        if input("Display polar-stereo views? [y = yes, anything else = no]: ").strip().lower() == "y":
    588588            units = getattr(var, 'units', None)
    589589            plot_polar_views(lon2d, lat2d, grid, colormap, varname, units)
    590590        # Prompt for 3D globe view if interactive
    591         if input("Display 3D globe view? [y/n]: ").strip().lower() == "y":
     591        if input("Display 3D globe view? [y = yes, anything else = no]: ").strip().lower() == "y":
    592592            units = getattr(var, 'units', None)
    593593            plot_3D_globe(lon2d, lat2d, grid, colormap, varname, units)
     
    659659        ax.grid(True)
    660660        # Prompt for polar-stereo views if interactive
    661         if sys.stdin.isatty() and input("Display polar-stereo views? [y/n]: ").strip().lower() == "y":
     661        if sys.stdin.isatty() and input("Display polar-stereo views? [y = yes, anything else = no]: ").strip().lower() == "y":
    662662            units = getattr(dataset.variables[varname], "units", None)
    663663            plot_polar_views(x_coords, y_coords, plot_data, colormap, varname, units)
    664664        # Prompt for 3D globe view if interactive
    665         if sys.stdin.isatty() and input("Display 3D globe view? [y/n]: ").strip().lower() == "y":
     665        if sys.stdin.isatty() and input("Display 3D globe view? [y = yes, anything else = no]: ").strip().lower() == "y":
    666666            units = getattr(dataset.variables[varname], "units", None)
    667667            plot_3D_globe(x_coords, y_coords, plot_data, colormap, varname, units)
Note: See TracChangeset for help on using the changeset viewer.