Project

General

Profile

Revision 850:8e96afa2665a

ID8e96afa2665a
Parent 849:8ca7f71ba559
Child 851:cc38a1ce977f

Added by Maarten Sneep almost 2 years ago

Make the north, south, sea, land subsets accessible for the histogram plots.

View differences:

src/pycama/cama_plot_time.py
173 173
                    actions = actions.append('max')
174 174
                    actions = actions.append('min')
175 175
            for k in actions:
176
                pltlabel="{0} ({1})".format(variable['meta']['title'], k)
176
                pltlabel="{0} ({1})".format(variable['meta']['title'], k.replace('_', ' '))
177 177
                plt.plot_date(time_ax,
178 178
                              variable[k], label=pltlabel,
179 179
                              linestyle=('-' if not k.startswith('q') else ':'),
......
1158 1158
                        help="Start of the time-range to plot. From start of provided data if not given.")
1159 1159
    parser.add_argument('--time-end', dest='time_end', type=timeParser, default=None,
1160 1160
                        help="End of the time-range to plot. Up to end of provided data if not given.")
1161

  
1161
    
1162
    parameter_choices = ['iqr', 'min', 'max', 'mean', 'median', 'mode', 'stddev', 'count', 'q01', 'q05', 'q10', 'q25', 'q75', 'q90', 'q95', 'q99']
1163
    
1164
    histogram_parameter_choices = []
1165
    for parameter_choice in parameter_choices:
1166
        histogram_parameter_choices.append(parameter_choice)
1167
        if parameter_choice != 'count':
1168
            for sub_choice in ('land', 'sea', 'north', 'south'):
1169
                histogram_parameter_choices.append(f"{parameter_choice}_{sub_choice}")
1170
    
1162 1171
    subparsers = parser.add_subparsers(help='Extraction class')
1163 1172

  
1164 1173
    parser_l = subparsers.add_parser('list', help='List variables')
......
1171 1180
                          help='Name of the variable to extract.')
1172 1181
    parser_a.add_argument('-R', '--set-range', type=float, nargs=2, default=None, help="Set data range for plot.")
1173 1182
    parser_a.add_argument('-P', '--parameter', help='Parameter to extract for all rows.',
1174
                          choices=('iqr', 'min', 'max', 'mean', 'median', 'mode', 'stddev', 'count', 'q01', 'q05', 'q10', 'q25', 'q75', 'q90', 'q95', 'q99'))
1183
                          choices=parameter_choices)
1175 1184
    parser_a.add_argument('-r', '--row', type=int, help="Row to display as a time-line with all parameters.")
1176 1185
    parser_a.add_argument('input_files', metavar='FILE', nargs="+",
1177 1186
                          help='The netCDF files extracted by PyCAMA')
......
1205 1214
                          help='When showing a histomap, use the equalized histogram')
1206 1215
    parser_h.add_argument('-M', '--disable_min_max', action='store_true',
1207 1216
                          help="Do not include the min/max values in the plot.")
1208
    parser_h.add_argument('-p', '--parameters', nargs="+", choices=('iqr', 'min', 'max', 'mean', 'median', 'mode', 'stddev', 'count', 'q01', 'q05', 'q10', 'q25', 'q75', 'q90', 'q95', 'q99'),
1217
    parser_h.add_argument('-p', '--parameters', nargs="+", choices=histogram_parameter_choices,
1209 1218
                          help="Select which parameter(s) to plot. ")
1210 1219
    parser_h.add_argument('input_files', metavar='FILE', nargs="+",
1211 1220
                          help='The netCDF files extracted by PyCAMA')

Also available in: Unified diff