<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi Mary,<div> Sorry to bother you with another question about masked array.</div><div> </div><div> 1) I am also looking at some other data in the globe (swath data on irregular grids). The original data was in netcdf format and I imported them by using netcdf4. They are masked array with filled value -32768. Then I do further selection by choosing only data over ocean. Then I plot out the 2D figure for ocean data. The python code ran without error, but I got nothing on my figure, except the map and grids ! </div><div> If I type tbwater on python terminal, it shows:</div><div>Out[2]:</div><div>masked_array(data = [135.11 135.11 137.95 ..., 137.56 138.49 132.27],</div><div> mask = [False False False ..., False False False],</div><div> fill_value = -32768)</div><div><br></div><div><br></div><div>I do not understand. The part of code is shown below.</div><div><br></div><div> 2) Similarly , I can also get data over coasts by applying some selection. I have also downloaded a coastal database as suggested in your website. I export <span style="background-color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; font-size: medium;">PYNGL_RANGS with the right path in .bashrc. </span>I also add mpDataBaseVersion = « HighRes in python code. But on my figure, I have results everywhere, not just on coast. Apparently, I met the same problem as I mentioned in the last email. </div><div><br></div><div><br></div><div> Many thanks again if you can give some clue !</div><div><br></div><div><br></div><div>Xiaoni</div><div><br></div><div><br></div><div><br></div><div><br></div><div>-----------------------------------------------------------------------------</div><div># select only ocean data from the whole data. a masked array.</div><div><div>tbwater = tb_lo_clean[(sft_lo_clean == 0 )]</div><div>latwater = lat_lo_clean[(sft_lo_clean == 0 )]</div><div>lonwater = lat_lo_clean[(sft_lo_clean == 0 )]</div></div><div><br></div><div># select only data over coasts</div><div><div>tbcoast = tb_lo_clean[(sft_lo_clean == 2 )]</div><div>latcoast = lat_lo_clean[(sft_lo_clean == 2 )]</div><div>loncoast = lon_lo_clean[(sft_lo_clean == 2 )]</div></div><div><br></div><div># preparing to plot</div><div>fill_value = -32768</div><div><br></div><div><div>wks_type = "png"</div><div>wks = Ngl.open_wks(wks_type,’data_on_ocean')</div><div>ws_id = Ngl.get_workspace_id()</div></div><div><br></div><div><div>resources = Ngl.Resources()</div><div><br></div><div>resources.sfXArray = lonwater</div><div>resources.sfYArray = latwater</div><div><br></div><div>resources.sfMissingValueV = fill_value</div><div>resources.nglSpreadColorStart = 176</div><div>resources.nglSpreadColorEnd = 2</div><div>resources.mpDataBaseVersion = "MediumRes"</div><div>#resources.mpGridMaskMode = "MaskLand"</div><div>resources.cnFillOn = True</div><div>resources.cnFillMode = "RasterFill" </div><div>resources.cnFillPalette = "BlAqGrYeOrReVi200"</div><div>resources.cnLinesOn = False</div><div>resources.cnLineLabelsOn = False</div><div>resources.lbBoxLinesOn = False</div><div>resources.lbLabelFontHeightF = 0.005</div><div>resources.cnLevelSelectionMode = "ManualLevels"</div><div>resources.cnMinLevelValF = 120</div><div>resources.cnMaxLevelValF = 250</div><div>resources.cnLevelSpacingF = 10</div><div>resources.vpXF = 0.1 # Change the size and location of the</div><div>resources.vpYF = 0.9 # plot on the viewport.</div><div>resources.vpWidthF = 0.4</div><div>resources.vpHeightF = 0.8</div><div><br></div><div># create plot for data over ocean</div><div>resources.tiMainString = "data over ocean on 20030701"</div><div>map = Ngl.contour_map(wks,tbwater,resources)</div></div><div><br></div><div># plot data on coasts</div><div><div>resources.sfXArray = loncoast</div><div>resources.sfYArray = latcoast</div><div>resources.cnMinLevelValF = 200</div><div>resources.cnMaxLevelValF = 300</div><div>resources.cnLevelSpacingF = 10</div><div>mpDataBaseVersion = "HighRes"</div><div>resources.tiMainString = "data over coasts on 20030701"</div><div>map = Ngl.contour_map(wks,tbcoast,resources)</div></div><div><br></div></body></html>