@@ -583,7 +583,9 class WeatherParamsPlot(Plot): | |||||
583 |
|
583 | |||
584 | if self.mask: |
|
584 | if self.mask: | |
585 | mask = dataOut.data_param[:,3,:] < self.mask |
|
585 | mask = dataOut.data_param[:,3,:] < self.mask | |
586 | tmp = numpy.ma.masked_array(tmp, mask=mask) |
|
586 | tmp[mask] = numpy.nan | |
|
587 | mask = numpy.nansum((tmp, numpy.roll(tmp, 1),numpy.roll(tmp, -1)), axis=0) == tmp | |||
|
588 | tmp[mask] = numpy.nan | |||
587 |
|
589 | |||
588 | r = dataOut.heightList |
|
590 | r = dataOut.heightList | |
589 | delta_height = r[1]-r[0] |
|
591 | delta_height = r[1]-r[0] | |
@@ -717,16 +719,16 class WeatherParamsPlot(Plot): | |||||
717 | gl.ylabel_style = {'size': 8} |
|
719 | gl.ylabel_style = {'size': 8} | |
718 | gl.xlabels_top = False |
|
720 | gl.xlabels_top = False | |
719 | gl.ylabels_right = False |
|
721 | gl.ylabels_right = False | |
|
722 | shape_d = os.path.join(self.shapes,'Distritos/PER_adm3.shp') | |||
720 | shape_p = os.path.join(self.shapes,'PER_ADM2/PER_ADM2.shp') |
|
723 | shape_p = os.path.join(self.shapes,'PER_ADM2/PER_ADM2.shp') | |
721 |
|
|
724 | capitales = os.path.join(self.shapes,'CAPITALES/cap_distrito.shp') | |
722 | capitales = os.path.join(self.shapes,'CAPITALES/cap_provincia.shp') |
|
|||
723 | vias = os.path.join(self.shapes,'Carreteras/VIAS_NACIONAL_250000.shp') |
|
725 | vias = os.path.join(self.shapes,'Carreteras/VIAS_NACIONAL_250000.shp') | |
724 |
reader_d = shpreader.BasicReader(shape_ |
|
726 | reader_d = shpreader.BasicReader(shape_d, encoding='latin1') | |
725 |
reader_p = shpreader.BasicReader(shape_ |
|
727 | reader_p = shpreader.BasicReader(shape_p, encoding='latin1') | |
726 | reader_c = shpreader.BasicReader(capitales, encoding='latin1') |
|
728 | reader_c = shpreader.BasicReader(capitales, encoding='latin1') | |
727 | reader_v = shpreader.BasicReader(vias, encoding='latin1') |
|
729 | reader_v = shpreader.BasicReader(vias, encoding='latin1') | |
728 | caps = [x for x in reader_c.records() ] |
|
730 | caps = [x for x in reader_c.records() if x.attributes['DEPARTA']=='PIURA' and x.attributes['CATEGORIA']=='CIUDAD'] | |
729 | districts = [x for x in reader_d.records()] |
|
731 | districts = [x for x in reader_d.records() if x.attributes['NAME_1']=='Piura'] | |
730 | provs = [x for x in reader_p.records()] |
|
732 | provs = [x for x in reader_p.records()] | |
731 | vias = [x for x in reader_v.records()] |
|
733 | vias = [x for x in reader_v.records()] | |
732 |
|
734 | |||
@@ -738,10 +740,11 class WeatherParamsPlot(Plot): | |||||
738 | shape_feature = ShapelyFeature([x.geometry for x in vias], ccrs.PlateCarree(), facecolor="none", edgecolor='yellow', lw=1) |
|
740 | shape_feature = ShapelyFeature([x.geometry for x in vias], ccrs.PlateCarree(), facecolor="none", edgecolor='yellow', lw=1) | |
739 | ax.add_feature(shape_feature) |
|
741 | ax.add_feature(shape_feature) | |
740 |
|
742 | |||
741 |
for cap in caps: |
|
743 | for cap in caps: | |
742 | ax.text(cap.attributes['X'], cap.attributes['Y'], cap.attributes['Nombre'].title(), size=7, color='white') |
|
744 | if cap.attributes['NOMBRE'] in ('PIURA', 'SULLANA', 'PAITA', 'SECHURA', 'TALARA'): | |
743 | #ax.text(-75.052003, -11.915552, 'Huaytapallana', size=7, color='cyan') |
|
745 | ax.text(cap.attributes['X'], cap.attributes['Y'], cap.attributes['NOMBRE'], size=8, color='white', weight='bold') | |
744 | #ax.plot(-75.052003, -11.915552, '*') |
|
746 | elif cap.attributes['NOMBRE'] in ('NEGRITOS', 'SAN LUCAS', 'QUERECOTILLO', 'TAMBO GRANDE', 'CHULUCANAS', 'CATACAOS', 'LA UNION'): | |
|
747 | ax.text(cap.attributes['X'], cap.attributes['Y'], cap.attributes['NOMBRE'].title(), size=7, color='white') | |||
745 | else: |
|
748 | else: | |
746 | ax.grid(color='grey', alpha=0.5, linestyle='--', linewidth=1) |
|
749 | ax.grid(color='grey', alpha=0.5, linestyle='--', linewidth=1) | |
747 |
|
750 |
General Comments 0
You need to be logged in to leave comments.
Login now