[gradsusr] How to save netcdf data without the outlines of the continents?
Carlos Batista
krlosbatist at gmail.com
Sun Jul 13 11:56:10 EDT 2014
Arlindo,
The scripts to Torrence and Compo are designed to data serial just compress
matrix 1D (...)
But, I development an script that read each point lon and lat (time)
separated. This makes me have to make wavelet series ... The problem is
that data to the contours of the continents are hindering reviews ...
Even so, thanks!
Carlos
2014-07-12 19:14 GMT-03:00 Arlindo da Silva <dasilva at alum.mit.edu>:
> Carlos,
>
> In Matlab, just compress the 2D array into a 1D array, perform the
> wavelet analysis on the 1D array, and map the results back into 2D arrays.
> For example,
>
> I = isnan(sst)==false
>
> sst1 = sst(I) # remove undefs
>
> %% do calc with sst1, save result is 1D array r1, then
>
> r = NaN*zeros(size(sst))
> r(I) = r1 # this is a 2D array with NaN for undefs
>
> In retrospect, this is a matlab question, not a grads question.
>
> Arlindo
>
>
>
> On Sat, Jul 12, 2014 at 8:45 AM, Carlos Batista <krlosbatist at gmail.com>
> wrote:
>
>> Olá Arlindo (...)
>>
>> Arlindo, meu problema é o seguinte (...)
>>
>> Estou tentando fazer umas análises de wavelets no Matlab usando dados
>> netcdf de TSM. O problema é que o Matlab entende todas as informações como
>> matrizes, inclusive os valores de undef e os que representam os contornos
>> dos continentes.
>> Esses valores de contornos dos continentes, por distoarem muito e por
>> interferir nos calculos de wavelets, não podem estar na minha série de
>> dados. Então, pensei se eu conseguisse tirar os dados referentes aos
>> contornos dos continentes no GrADS e depois exportar apenas os dados das
>> TSM poderia funcionar a matemática das wavelets
>>
>> Ontem eu consegui nomear todos esses valores de contornos com NaN com uma
>> manobra dentro do próprio Matlab. Porém, mesmo esses NaN ainda estão
>> atrapalhando no momento de fazer os calculos das wavelets (...) Fiz um
>> teste pegando pontos de latitudes e longitudes com apenas os dados de TSM e
>> o Matlab fez bem os calculos das wavelets.
>>
>> Penso que entrando apenas com os dados de TSM o matlab possa fazer as
>> minhas wavelets!
>>
>> ****************************************************
>> For Andrew
>>
>> I'm trying to do some analysis of wavelets in Matlab using netcdf SST
>> data. The problem is that Matlab understands all information as matrix,
>> including the values undef and the representing the contours of the
>> continents.
>> These values of contours of continents for changer and interfere in my
>> calculations of wavelets... Like this these can not be in my dataset.
>>
>> So I thought if I could get the data to the contours of the continents in
>> GrADS and then export only data from TSM could work the mathematics of
>> wavelets
>>
>> Yesterday I managed to name all these contours with NaN values with a
>> maneuver within Matlab itself. But even these are still messing NaN when
>> you do the calculations of wavelets (...) I did a test taking points of
>> latitude and longitude with only the SST data and Matlab did well the
>> calculations of wavelets.
>>
>> I think just coming with SST matlab can make my wavelets!
>>
>> Thanks!!!
>>
>> Carlos
>>
>>
>>
>>
>> 2014-07-12 2:09 GMT-03:00 Andrew Friedman <andfried at berkeley.edu>:
>>
>> I’ve also found that ‘sdfwrite’ is useful for exporting to Matlab, since
>>> Matlab can open netcdf files.
>>>
>>> On Jul 11, 2014, at 8:14 PM, Arlindo da Silva <dasilva at alum.mit.edu>
>>> wrote:
>>>
>>> > On Fri, Jul 11, 2014 at 1:11 PM, Carlos Batista <krlosbatist at gmail.com>
>>> wrote:
>>> >
>>> > Dear Users
>>> >
>>> > I need to save the data SST file without contours of continents.
>>> >
>>> > I need to open this data in Matlab. The Matlab understands the
>>> contours as values and I don't know 'say' for the Matlab that data of
>>> contours is not for "him" to read.
>>> >
>>> > Does anyone know?
>>> >
>>> >
>>> > I really do not understand what you are trying to do. Which?
>>> >
>>> > 1) You are trying to import in matlab an image that you created in
>>> grads, or
>>> >
>>> > 2) You would like to open a binary SST file (that grads can read) in
>>> matlab for further analysis,
>>> >
>>> > Here is a very simple example of how to export ASCII data and
>>> import it into Matlab,
>>> >
>>> >
>>> http://cookbooks.opengrads.org/index.php?title=Recipe-002:_Saving_GrADS_variable_data_to_a_text_file
>>> >
>>> > Here is a more sophisticated way of sharing data between grads and
>>> matlab using Java:
>>> >
>>> >
>>> http://opengrads.org/wiki/index.php?title=JyGrADS:_Java_and_Matlab_interface_to_GrADS_through_Jython
>>> >
>>> > I never really released jygrads, but a working release can be found
>>> here:
>>> >
>>> > http://opengrads.org/devel/jygrads/
>>> >
>>> > I hope this helps.
>>> >
>>> > Arlindo
>>> >
>>> > --
>>> > Arlindo da Silva
>>> > dasilva at alum.mit.edu
>>> > _______________________________________________
>>> > gradsusr mailing list
>>> > gradsusr at gradsusr.org
>>> > http://gradsusr.org/mailman/listinfo/gradsusr
>>>
>>>
>>> _______________________________________________
>>> gradsusr mailing list
>>> gradsusr at gradsusr.org
>>> http://gradsusr.org/mailman/listinfo/gradsusr
>>>
>>
>>
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>>
>>
>
>
> --
> Arlindo da Silva
> *dasilva at alum.mit.edu <dasilva at alum.mit.edu>*
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20140713/d7c2a800/attachment-0001.html
More information about the gradsusr
mailing list