##// END OF EJS Templates
Add filter noise in wetherplot and more detailed shapefiles
jespinoza -
r1724:c765803841ff
parent child
Show More
@@ -583,7 +583,9 class WeatherParamsPlot(Plot):
583 583
584 584 if self.mask:
585 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 590 r = dataOut.heightList
589 591 delta_height = r[1]-r[0]
@@ -717,16 +719,16 class WeatherParamsPlot(Plot):
717 719 gl.ylabel_style = {'size': 8}
718 720 gl.xlabels_top = False
719 721 gl.ylabels_right = False
722 shape_d = os.path.join(self.shapes,'Distritos/PER_adm3.shp')
720 723 shape_p = os.path.join(self.shapes,'PER_ADM2/PER_ADM2.shp')
721 shape_d = os.path.join(self.shapes,'PER_ADM1/PER_ADM1.shp')
722 capitales = os.path.join(self.shapes,'CAPITALES/cap_provincia.shp')
724 capitales = os.path.join(self.shapes,'CAPITALES/cap_distrito.shp')
723 725 vias = os.path.join(self.shapes,'Carreteras/VIAS_NACIONAL_250000.shp')
724 reader_d = shpreader.BasicReader(shape_p, encoding='latin1')
725 reader_p = shpreader.BasicReader(shape_d, encoding='latin1')
726 reader_d = shpreader.BasicReader(shape_d, encoding='latin1')
727 reader_p = shpreader.BasicReader(shape_p, encoding='latin1')
726 728 reader_c = shpreader.BasicReader(capitales, encoding='latin1')
727 729 reader_v = shpreader.BasicReader(vias, encoding='latin1')
728 caps = [x for x in reader_c.records() ]
729 districts = [x for x in reader_d.records()]
730 caps = [x for x in reader_c.records() if x.attributes['DEPARTA']=='PIURA' and x.attributes['CATEGORIA']=='CIUDAD']
731 districts = [x for x in reader_d.records() if x.attributes['NAME_1']=='Piura']
730 732 provs = [x for x in reader_p.records()]
731 733 vias = [x for x in reader_v.records()]
732 734
@@ -738,10 +740,11 class WeatherParamsPlot(Plot):
738 740 shape_feature = ShapelyFeature([x.geometry for x in vias], ccrs.PlateCarree(), facecolor="none", edgecolor='yellow', lw=1)
739 741 ax.add_feature(shape_feature)
740 742
741 for cap in caps:
742 ax.text(cap.attributes['X'], cap.attributes['Y'], cap.attributes['Nombre'].title(), size=7, color='white')
743 #ax.text(-75.052003, -11.915552, 'Huaytapallana', size=7, color='cyan')
744 #ax.plot(-75.052003, -11.915552, '*')
743 for cap in caps:
744 if cap.attributes['NOMBRE'] in ('PIURA', 'SULLANA', 'PAITA', 'SECHURA', 'TALARA'):
745 ax.text(cap.attributes['X'], cap.attributes['Y'], cap.attributes['NOMBRE'], size=8, color='white', weight='bold')
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 748 else:
746 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