Changeset 2060 in lmdz_wrf


Ignore:
Timestamp:
Aug 9, 2018, 8:33:38 PM (6 years ago)
Author:
lfita
Message:

Adding reference and name of the station

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/UWyoming_snd_nc.py

    r1941 r2060  
    108108    if line[0:1] != '#' and line[0:1] != '<' and line[0:1] != '-' and len(line) > 1:
    109109        lvals = gen.values_line(line, ' ', ['\t'])
    110         lvals = gen.values_line(line, ' ', ['\t'])
    111         print lvals
    112110        newsnd = lvals.count('Observations')
    113111        # Processing a new date
     
    118116                txtvals = {}
    119117                idate = idate + 1
     118                strefn = lvals[1]
     119                idobsS = lvals.index('Observations')
     120                stnameS = ' '.join(lvals[2:idobsS])
    120121            else:
    121122                stationdateS = str(txtvals['Station number']) + '_' + txtvals['Observation time']
     
    387388# Global attributes
    388389ncvar.add_global_PyNCplot(onewnc, main, '', '0.2')
     390onewnc.setncattr('Station_ref', strefn)
     391onewnc.setncattr('Station_name', stnameS)
     392
    389393for atn in stngattrk:
    390394    atnS = atn.replace(' ','_')
Note: See TracChangeset for help on using the changeset viewer.