Changeset 2734 in lmdz_wrf


Ignore:
Timestamp:
Oct 25, 2019, 6:44:45 PM (5 years ago)
Author:
lfita
Message:

Adding:

  • `stations_values.csv' on 'lin_essentials.bash'
  • error management on `stations_values'
Location:
trunk/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/generic_tools.py

    r2733 r2734  
    1726717267    return newlist
    1726817268
    17269 def stations_values(stcrit,stval,Nexpctst='all'):
     17269def stations_values(stcrit,stval,Nexpctst='all',Notfound=True):
    1727017270    """ Function to provide information from a given station from one of its values
    1727117271      from ASCII file 'OBStations.csv'
     
    1729517295          'all': all matching entries. It will return a dictionary
    1729617296          'one': only one entry. It will return a list
     17297        [Notfound]: should call quit if no station is found? Otherwise returns None
    1729717298        return: [station_name], [WMOid], [longitude], [lon_deg], [lon_min], [lon_sec],
    1729817299          [latitude], [lat_deg], [lat_min], [lat_sec], [height], [prov], [country],
     
    1735317354
    1735417355            stvalues = list_listKs(values, stKs)
    17355             print stvalues[icrit], stv, stvalues[icrit] == stv
    1735617356            if stvalues[icrit] == stv:
    1735717357                stations[Nst] = stvalues
     
    1736317363          "' not found !!!"
    1736417364        ncf.close()
    17365         quit(-1)
     17365        if Notfound:
     17366            print '    STOP program'
     17367            quit(-1)
     17368        else: return None
    1736617369
    1736717370    if Nexpctst == 'all': return stations
     
    1737217375            print '    ', Nst, 'stations found _______'
    1737317376            printing_dictionary(stations)
     17377            if Notfound:
     17378                print '    STOP program'
     17379                quit(-1)
     17380            else: return None
    1737417381        else:
    1737517382            stfound = stations[0]
    1737617383            return stfound
    17377 
    1737817384
    1737917385    return stations
  • trunk/tools/link_essentials.bash

    r2719 r2734  
    1616  ln -s ${pyHOME}/*.so ./
    1717  ln -s ${pyHOME}/variables_values.dat ./
     18  ln -s ${pyHOME}/OBSstations.csv ./
    1819fi
Note: See TracChangeset for help on using the changeset viewer.