<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EstiloDeEmail17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:8.5in 11.0in;
margin:70.85pt 85.05pt 70.85pt 85.05pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=PT-BR link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Boa noite pessoal,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Estou extraindo de um arquivo ncdf os valores de latitude (lat) longitude( lon) e temperatura da superfície da agua do mar( SST), entretanto a longitude (lon) ela está na projeção 0 a 360 graus. Minha pergunta é como faço para converter ela para -180 a 180 graus? Segue o script que estou utilizando juntamente com o link dos dados.<o:p></o:p></p><p class=MsoNormal>Desde já agradeço a ajuda <o:p></o:p></p><p class=MsoNormal>Humberto <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=450 style='width:337.5pt;border-collapse:collapse'><tr style='height:15.0pt'><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal><span style='color:black;mso-fareast-language:PT-BR'> lon<o:p></o:p></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal><span style='color:black;mso-fareast-language:PT-BR'> lat<o:p></o:p></span></p></td><td width=77 nowrap valign=bottom style='width:58.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal><span style='color:black;mso-fareast-language:PT-BR'> data<o:p></o:p></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal><span style='color:black;mso-fareast-language:PT-BR'> sst<o:p></o:p></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'></td><td width=117 nowrap valign=bottom style='width:87.5pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Times New Roman",serif;mso-fareast-language:PT-BR'> Lon como deveria ser<o:p></o:p></span></p></td></tr><tr style='height:15.0pt'><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>299.5<o:p></o:p></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>10.5<o:p></o:p></span></p></td><td width=77 nowrap valign=bottom style='width:58.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>11/30/1981<o:p></o:p></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>27.85<o:p></o:p></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'><o:p> </o:p></span></p></td><td width=117 nowrap valign=bottom style='width:87.5pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>-60.000<o:p></o:p></span></p></td></tr><tr style='height:15.0pt'><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>300.5<o:p></o:p></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>10.5<o:p></o:p></span></p></td><td width=77 nowrap valign=bottom style='width:58.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>11/30/1981<o:p></o:p></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>27.96<o:p></o:p></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'><o:p> </o:p></span></p></td><td width=117 nowrap valign=bottom style='width:87.5pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>-59.500<o:p></o:p></span></p></td></tr><tr style='height:15.0pt'><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>301.5<o:p></o:p></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>10.5<o:p></o:p></span></p></td><td width=77 nowrap valign=bottom style='width:58.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>11/30/1981<o:p></o:p></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>28.02<o:p></o:p></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'><o:p> </o:p></span></p></td><td width=117 nowrap valign=bottom style='width:87.5pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>-58.500<o:p></o:p></span></p></td></tr><tr style='height:15.0pt'><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>302.5<o:p></o:p></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>10.5<o:p></o:p></span></p></td><td width=77 nowrap valign=bottom style='width:58.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>11/30/1981<o:p></o:p></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>28.02<o:p></o:p></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'><o:p> </o:p></span></p></td><td width=117 nowrap valign=bottom style='width:87.5pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>-57.500<o:p></o:p></span></p></td></tr><tr style='height:15.0pt'><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>303.5<o:p></o:p></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>10.5<o:p></o:p></span></p></td><td width=77 nowrap valign=bottom style='width:58.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>11/30/1981<o:p></o:p></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>27.97<o:p></o:p></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'><o:p> </o:p></span></p></td><td width=117 nowrap valign=bottom style='width:87.5pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>-56.500<o:p></o:p></span></p></td></tr><tr style='height:15.0pt'><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>304.5<o:p></o:p></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>10.5<o:p></o:p></span></p></td><td width=77 nowrap valign=bottom style='width:58.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>11/30/1981<o:p></o:p></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>27.84<o:p></o:p></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'><o:p> </o:p></span></p></td><td width=117 nowrap valign=bottom style='width:87.5pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>-55.500<o:p></o:p></span></p></td></tr><tr style='height:15.0pt'><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>305.5<o:p></o:p></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>10.5<o:p></o:p></span></p></td><td width=77 nowrap valign=bottom style='width:58.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>11/30/1981<o:p></o:p></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>27.81<o:p></o:p></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'><o:p> </o:p></span></p></td><td width=117 nowrap valign=bottom style='width:87.5pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>-54.500<o:p></o:p></span></p></td></tr><tr style='height:15.0pt'><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>306.5<o:p></o:p></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>10.5<o:p></o:p></span></p></td><td width=77 nowrap valign=bottom style='width:58.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>11/30/1981<o:p></o:p></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>27.78<o:p></o:p></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'><o:p> </o:p></span></p></td><td width=117 nowrap valign=bottom style='width:87.5pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>-53.500<o:p></o:p></span></p></td></tr><tr style='height:15.0pt'><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>307.5<o:p></o:p></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>10.5<o:p></o:p></span></p></td><td width=77 nowrap valign=bottom style='width:58.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>11/30/1981<o:p></o:p></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>27.75<o:p></o:p></span></p></td><td width=64 nowrap valign=bottom style='width:48.0pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'><o:p> </o:p></span></p></td><td width=117 nowrap valign=bottom style='width:87.5pt;padding:0in 3.5pt 0in 3.5pt;height:15.0pt'><p class=MsoNormal align=right style='text-align:right'><span style='color:black;mso-fareast-language:PT-BR'>-52.500<o:p></o:p></span></p></td></tr></table><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Link para acesso dos dados <a href="https://www.dropbox.com/s/xnab2g365mduykx/SST_81_14.nc?dl=0">https://www.dropbox.com/s/xnab2g365mduykx/SST_81_14.nc?dl=0</a><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Script:<o:p></o:p></p><p class=MsoNormal><span lang=EN-US>require(ncdf) #'ncdf' versao 1.6.6<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>require(reshape)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>require(chron)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>###sst<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>nc <- open.ncdf("SST_81_14.nc")<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>nc<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>lat <- get.var.ncdf(nc, "lat")<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>lon <- get.var.ncdf(nc, "lon")<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>tunits <- att.get.ncdf(nc,"time","units")<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US># print tunits<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>tunits$value<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US># criar tempo "real" Times<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>time<- get.var.ncdf(nc,"time")<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Time<-chron(time,origin=c(month=1, day=1, year=1900))<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal>## array da variavel sst<o:p></o:p></p><p class=MsoNormal>wm <- get.var.ncdf(nc, "sst")<o:p></o:p></p><p class=MsoNormal>str(wm)<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>## atribuindo dimnames conforme lon, lat e tempo<o:p></o:p></p><p class=MsoNormal><span lang=EN-US>dimnames(wm)[[1]] <- as.character(lon)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>dimnames(wm)[[2]] <- as.character(lat)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>dimnames(wm)[[3]] <- as.character(Time)<o:p></o:p></span></p><p class=MsoNormal>str(wm)<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>## melt para reestruturação dos dados<o:p></o:p></p><p class=MsoNormal>mwm <- melt(wm)<o:p></o:p></p><p class=MsoNormal>head(mwm)<o:p></o:p></p></div></body></html>