Changeset 4078


Ignore:
Timestamp:
Dec 14, 2006, 11:49:49 AM (18 years ago)
Author:
sexton
Message:

modified sww2timeseries so that when elevation is positive, will plot depth rather than stage

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/abstract_2d_finite_volumes/util.py

    r4076 r4078  
    10531053                    units = 'm'
    10541054                if which_quantity == 'stage':
    1055                     plot(model_time[0:n[j]-1,k,j], stages[0:n[j]-1,k,j], '-', c = cstr[j])
     1055                    if elevations[0:n[j]-1,k,j] < 0:
     1056                        plot(model_time[0:n[j]-1,k,j], stages[0:n[j]-1,k,j], '-', c = cstr[j])
     1057                    else:
     1058                        plot(model_time[0:n[j]-1,k,j], depths[0:n[j]-1,k,j], '-', c = cstr[j])
    10561059                    #axis(stage_axis)
    10571060                    units = 'm'
     
    10831086
    10841087                xlabel('time (mins)')
    1085                 ylabel('%s (%s)' %(which_quantity, units))
     1088                if which_quantity == 'stage' and elevations[0:n[j]-1,k,j] > 0:
     1089                    ylabel('%s (%s)' %('depth', units))
     1090                else:
     1091                    ylabel('%s (%s)' %(which_quantity, units))
    10861092                if len(label_id) > 1: legend((leg_label),loc='upper right')
    10871093
     
    11301136                for i in range(nn-1):
    11311137                    if nn > 2:
    1132                         word_quantity += plot_quantity[i] + ', '
     1138                        if plot_quantity[i] == 'stage' and elevations[0,k,j] > 0:
     1139                            word_quantity += 'depth' + ', '
     1140                        else:
     1141                            word_quantity += plot_quantity[i] + ', '
    11331142                    else:
    1134                         word_quantity += plot_quantity[i]
     1143                        if plot_quantity[i] == 'stage' and elevations[0,k,j] > 0:
     1144                            word_quantity += 'depth' + ', '
     1145                        else:
     1146                            word_quantity += plot_quantity[i]
    11351147                   
    1136                 word_quantity += ' and ' + plot_quantity[nn-1]
     1148                if plot_quantity[nn-1] == 'stage' and elevations[0,k,j] > 0:
     1149                    word_quantity += ' and ' + 'depth'
     1150                else:
     1151                    word_quantity += ' and ' + plot_quantity[nn-1]
    11371152                caption = 'Time series for %s at %s location (elevation %.2fm)' %(word_quantity, locations[k], elev[k]) #gaugeloc.replace('_',' '))
    11381153                if elev[k] == 0.0:
     
    11511166            for i in range(nn-1):
    11521167                if nn > 2:
    1153                     word_quantity += plot_quantity[i] + ', '
     1168                    if plot_quantity[i] == 'stage' and elevations[0,k,j] > 0:
     1169                        word_quantity += 'depth' + ','
     1170                    else:
     1171                        word_quantity += plot_quantity[i] + ', '
    11541172                else:
    1155                     word_quantity += plot_quantity[i]
     1173                    if plot_quantity[i] == 'stage' and elevations[0,k,j] > 0:
     1174                        word_quantity += 'depth'
     1175                    else:
     1176                        word_quantity += plot_quantity[i]
     1177                print 'hello', elevations[0,k,j]
    11561178                where1 = 0
    11571179                count1 += 1
Note: See TracChangeset for help on using the changeset viewer.