Re: [julia-users] Re: unable to connect to FTP using IP address

2016-09-02 Thread Yared Melese
Thanks for your help.

On Aug 31, 2016 8:37 AM, "Samuel Massinon" <samuel.massi...@gmail.com>
wrote:

> Hi Yared,
>
> Hopefully my last reply worked for you.
>
> If you have anymore questions about how to use FTPClient.jl or find other
> issues, you are more than welcome to make an issue here
> https://github.com/invenia/FTPClient.jl/issues
> I'll be more likely to see your problem there.
>
> Cheers,
> Sam
>
> On Wednesday, August 17, 2016 at 10:03:50 AM UTC-5, Samuel Massinon wrote:
>>
>> Hi Yared,
>>
>> Okay, since it worked with you and not me I won't be able to tests my
>> solutions.
>>
>> You don't specify that you want to download in binary when you make the
>> connection. I'm not sure what version of FTPClient.jl you are using, but
>> binary downloads did not work on the first version of FTPClient.jl.
>>
>> If you have a correct version, you can do the following.
>> using FTPClient
>> ftp_init()
>> ftp = FTP(host="192.168.251.200")
>> file = download(ftp, "dataOnFTP.bin", "C:\Users\xyz\test.bin")
>> close(ftp)
>> ftp_cleanup()
>>
>> Binary is longer a function in the latest version of FTPClient.jl and it
>> is currently assumes that downloads are in binary. So there's no need to
>> specify it.
>>
>> Let me know if this does or doesn't work.
>>
>> On Wednesday, August 17, 2016 at 9:22:53 AM UTC-5, Yared Melese wrote:
>>>
>>> Hi Samuel,
>>>
>>> Thanks
>>>
>>> The following worked
>>> ftp = FTP(host="192.168.255.69")
>>> However, if I want the transfer to be in binary mode then it won't work
>>>
>>>
>>> Thanks
>>> Yared
>>> On Tuesday, August 9, 2016 at 2:26:30 PM UTC-5, Samuel Massinon wrote:
>>>
>>>> Hi Yared
>>>>
>>>> Sorry, I got side tracked by other things and forgot about this.
>>>>
>>>> Can you show what's in "host", "username", and "password"? Is it
>>>> just "192.168.251.200","anonymous", and "" respectively?
>>>>
>>>> I tried
>>>> ftp('192.168.251.200', 'anonymous', '')
>>>> But got an error saying that I was unable to reach it. But that might
>>>> make sense if I don't have access to it, is that the case here?
>>>>
>>>> Other things that might help is that are you sure your ftp connection
>>>> is over ssl? Is it implicit? Maybe playing around with `implt=true,
>>>> ssl=true` in
>>>> ftp = FTP(host="192.168.251.200", implt=true, ssl=true, user=
>>>> "anonymous", pswd="")
>>>> might work.
>>>>
>>>> Sam
>>>>
>>>> On Friday, August 5, 2016 at 9:22:15 AM UTC-5, Yared Melese wrote:
>>>>>
>>>>> Hi Samuel,
>>>>>
>>>>> Would you please let me know if the information I provided is enough?
>>>>>
>>>>> Thanks
>>>>> Yared
>>>>>
>>>>> On Wednesday, July 27, 2016 at 12:23:56 PM UTC-5, Yared Melese wrote:
>>>>>>
>>>>>> Hi Samuel,
>>>>>>
>>>>>> Here is how it is done in matlab
>>>>>> % connect to ftp
>>>>>> f = ftp(host, username, password)
>>>>>> mget(f,'dataOnFTP.bin')
>>>>>>
>>>>>> % read data from file
>>>>>> readData = fopen('dataOnFTP.bin', 'r', 'ieee-le')
>>>>>>
>>>>>> %delete file from server
>>>>>> delete(f, 'dataOnFTP.bin');
>>>>>>
>>>>>>  Here one thing not included is I would like to find the latest file
>>>>>> from FTP server because there might be similar names with different 
>>>>>> suffix.
>>>>>>
>>>>>> Thanks
>>>>>> Yared
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Tuesday, July 26, 2016 at 1:29:36 PM UTC-5, Samuel Massinon wrote:
>>>>>>
>>>>>>> No worries, can you show me how you get the file with another
>>>>>>> program?
>>>>>>>
>>>>>>> On Tuesday, July 26, 2016 at 10:09:06 AM UTC-5, Yared Melese wrote:
>>>>>>>>
>>>>>>>>

[julia-users] Re: unable to connect to FTP using IP address

2016-08-17 Thread Yared Melese
Hi Samuel, 

Thanks 

The following worked
ftp = FTP(host="192.168.255.69")
However, if I want the transfer to be in binary mode then it won't work 


Thanks 
Yared
On Tuesday, August 9, 2016 at 2:26:30 PM UTC-5, Samuel Massinon wrote:

> Hi Yared
>
> Sorry, I got side tracked by other things and forgot about this. 
>
> Can you show what's in "host", "username", and "password"? Is it 
> just "192.168.251.200","anonymous", and "" respectively?
>
> I tried 
> ftp('192.168.251.200', 'anonymous', '')
> But got an error saying that I was unable to reach it. But that might make 
> sense if I don't have access to it, is that the case here?
>
> Other things that might help is that are you sure your ftp connection is 
> over ssl? Is it implicit? Maybe playing around with `implt=true, ssl=true` 
> in 
> ftp = FTP(host="192.168.251.200", implt=true, ssl=true, user="anonymous", 
> pswd="")
> might work.
>
> Sam
>
> On Friday, August 5, 2016 at 9:22:15 AM UTC-5, Yared Melese wrote:
>>
>> Hi Samuel, 
>>
>> Would you please let me know if the information I provided is enough? 
>>
>> Thanks 
>> Yared
>>
>> On Wednesday, July 27, 2016 at 12:23:56 PM UTC-5, Yared Melese wrote:
>>>
>>> Hi Samuel, 
>>>
>>> Here is how it is done in matlab
>>> % connect to ftp 
>>> f = ftp(host, username, password)
>>> mget(f,'dataOnFTP.bin')
>>>
>>> % read data from file 
>>> readData = fopen('dataOnFTP.bin', 'r', 'ieee-le') 
>>>
>>> %delete file from server 
>>> delete(f, 'dataOnFTP.bin');
>>>
>>>  Here one thing not included is I would like to find the latest file 
>>> from FTP server because there might be similar names with different suffix. 
>>>
>>> Thanks 
>>> Yared
>>>
>>>
>>>
>>>
>>> On Tuesday, July 26, 2016 at 1:29:36 PM UTC-5, Samuel Massinon wrote:
>>>
>>>> No worries, can you show me how you get the file with another program?
>>>>
>>>> On Tuesday, July 26, 2016 at 10:09:06 AM UTC-5, Yared Melese wrote:
>>>>>
>>>>> Hi Samuel, 
>>>>>
>>>>> Thanks for your inputs 
>>>>>
>>>>> I am trying to connect to a file server with IP address and get the 
>>>>> latest file with certain extension then process the data and save it on 
>>>>> local drive, then delete the file from the server. 
>>>>>
>>>>> Sorry, I don't know how to get files from Curl, it seems it is mainly 
>>>>> designed for Http 
>>>>>
>>>>> Thanks 
>>>>> Yared
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Thursday, July 21, 2016 at 1:56:01 PM UTC-5, Samuel Massinon wrote:
>>>>>
>>>>>> Hi Yared,
>>>>>>
>>>>>> The error you are getting is something LibCURL is erring on, as 
>>>>>> described here. https://curl.haxx.se/libcurl/c/libcurl-errors.html
>>>>>>
>>>>>> If I try using curl with your settings, I get
>>>>>> ~ $ curl -u anonymous '192.168.251.200/dataOnFTP.bin 
>>>>>> <http://www.google.com/url?q=http%3A%2F%2F192.168.251.200%2FdataOnFTP.bin=D=1=AFQjCNFtV1_YpJULt7jEW8s_Ou3Yg22HiQ>
>>>>>> '
>>>>>> Enter host password for user 'anonymous':
>>>>>> curl: (7) Failed to connect to 192.168.251.200 port 80: Network is 
>>>>>> unreachable
>>>>>>
>>>>>> The FTPClient.jl uses the same library as curl and if you could post 
>>>>>> how to get the file with curl, I might be able to better serve you.
>>>>>>
>>>>>> On Wednesday, July 20, 2016 at 4:17:29 PM UTC-5, Yared Melese wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Hello 
>>>>>>>
>>>>>>> Would you please let me know if I missed anything, I am using 
>>>>>>> FTPClient and using IP address as a host but not able to connect 
>>>>>>> Here are my commands 
>>>>>>>
>>>>>>> using FTPClient
>>>>>>> ftp_init()
>>>>>>> ftp = FTP(host="192.168.251.200", implt=true, ssl=true, 
>>>>>>> user="anonymous", pswd="")
>>>>>>> binary(ftp)
>>>>>>> file = download(ftp, "dataOnFTP.bin", "C:\Users\xyz\test.bin")
>>>>>>> close(ftp)
>>>>>>> ftp_cleanup()
>>>>>>>
>>>>>>> when sending  " using FTPClient" there are bunch of warnings as 
>>>>>>> shown below partially
>>>>>>> WARNING: Base.String is deprecated, use AbstractString instead.
>>>>>>>   likely near C:\Users\melese\.julia\v0.4\FTPClient\src\FTPC.jl:35
>>>>>>> WARNING: Base.String is deprecated, use AbstractString instead.
>>>>>>>   likely near C:\Users\melese\.julia\v0.4\FTPClient\src\FTPC.jl:67
>>>>>>> WARNING: Base.Uint8 is deprecated, use UInt8 instead.
>>>>>>>   likely near C:\Users\melese\.julia\v0.4\FTPClient\src\FTPC.jl:81
>>>>>>> ..
>>>>>>> .
>>>>>>> .and at the end I am getting the following error 
>>>>>>>
>>>>>>> ERROR: Failed to connect. :: LibCURL error #7
>>>>>>>  [inlined code] from 
>>>>>>> C:\Users\melese\.julia\v0.4\FTPClient\src\FTPC.jl:138
>>>>>>>  in ftp_command at 
>>>>>>> C:\Users\melese\.julia\v0.4\FTPClient\src\FTPC.jl:454
>>>>>>>  in ftp_connect at 
>>>>>>> C:\Users\melese\.julia\v0.4\FTPClient\src\FTPC.jl:493
>>>>>>>  in call at C:\Users\melese\.julia\v0.4\FTPClient\src\FTPObject.jl:23
>>>>>>>
>>>>>>> Thanks 
>>>>>>> Yared
>>>>>>>
>>>>>>

[julia-users] Re: unable to connect to FTP using IP address

2016-08-05 Thread Yared Melese
Hi Samuel, 

Would you please let me know if the information I provided is enough? 

Thanks 
Yared

On Wednesday, July 27, 2016 at 12:23:56 PM UTC-5, Yared Melese wrote:
>
> Hi Samuel, 
>
> Here is how it is done in matlab
> % connect to ftp 
> f = ftp(host, username, password)
> mget(f,'dataOnFTP.bin')
>
> % read data from file 
> readData = fopen('dataOnFTP.bin', 'r', 'ieee-le') 
>
> %delete file from server 
> delete(f, 'dataOnFTP.bin');
>
>  Here one thing not included is I would like to find the latest file from 
> FTP server because there might be similar names with different suffix. 
>
> Thanks 
> Yared
>
>
>
>
> On Tuesday, July 26, 2016 at 1:29:36 PM UTC-5, Samuel Massinon wrote:
>
>> No worries, can you show me how you get the file with another program?
>>
>> On Tuesday, July 26, 2016 at 10:09:06 AM UTC-5, Yared Melese wrote:
>>>
>>> Hi Samuel, 
>>>
>>> Thanks for your inputs 
>>>
>>> I am trying to connect to a file server with IP address and get the 
>>> latest file with certain extension then process the data and save it on 
>>> local drive, then delete the file from the server. 
>>>
>>> Sorry, I don't know how to get files from Curl, it seems it is mainly 
>>> designed for Http 
>>>
>>> Thanks 
>>> Yared
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Thursday, July 21, 2016 at 1:56:01 PM UTC-5, Samuel Massinon wrote:
>>>
>>>> Hi Yared,
>>>>
>>>> The error you are getting is something LibCURL is erring on, as 
>>>> described here. https://curl.haxx.se/libcurl/c/libcurl-errors.html
>>>>
>>>> If I try using curl with your settings, I get
>>>> ~ $ curl -u anonymous '192.168.251.200/dataOnFTP.bin 
>>>> <http://www.google.com/url?q=http%3A%2F%2F192.168.251.200%2FdataOnFTP.bin=D=1=AFQjCNFtV1_YpJULt7jEW8s_Ou3Yg22HiQ>
>>>> '
>>>> Enter host password for user 'anonymous':
>>>> curl: (7) Failed to connect to 192.168.251.200 port 80: Network is 
>>>> unreachable
>>>>
>>>> The FTPClient.jl uses the same library as curl and if you could post 
>>>> how to get the file with curl, I might be able to better serve you.
>>>>
>>>> On Wednesday, July 20, 2016 at 4:17:29 PM UTC-5, Yared Melese wrote:
>>>>>
>>>>>
>>>>>
>>>>> Hello 
>>>>>
>>>>> Would you please let me know if I missed anything, I am using 
>>>>> FTPClient and using IP address as a host but not able to connect 
>>>>> Here are my commands 
>>>>>
>>>>> using FTPClient
>>>>> ftp_init()
>>>>> ftp = FTP(host="192.168.251.200", implt=true, ssl=true, 
>>>>> user="anonymous", pswd="")
>>>>> binary(ftp)
>>>>> file = download(ftp, "dataOnFTP.bin", "C:\Users\xyz\test.bin")
>>>>> close(ftp)
>>>>> ftp_cleanup()
>>>>>
>>>>> when sending  " using FTPClient" there are bunch of warnings as shown 
>>>>> below partially
>>>>> WARNING: Base.String is deprecated, use AbstractString instead.
>>>>>   likely near C:\Users\melese\.julia\v0.4\FTPClient\src\FTPC.jl:35
>>>>> WARNING: Base.String is deprecated, use AbstractString instead.
>>>>>   likely near C:\Users\melese\.julia\v0.4\FTPClient\src\FTPC.jl:67
>>>>> WARNING: Base.Uint8 is deprecated, use UInt8 instead.
>>>>>   likely near C:\Users\melese\.julia\v0.4\FTPClient\src\FTPC.jl:81
>>>>> ..
>>>>> .
>>>>> .and at the end I am getting the following error 
>>>>>
>>>>> ERROR: Failed to connect. :: LibCURL error #7
>>>>>  [inlined code] from 
>>>>> C:\Users\melese\.julia\v0.4\FTPClient\src\FTPC.jl:138
>>>>>  in ftp_command at 
>>>>> C:\Users\melese\.julia\v0.4\FTPClient\src\FTPC.jl:454
>>>>>  in ftp_connect at 
>>>>> C:\Users\melese\.julia\v0.4\FTPClient\src\FTPC.jl:493
>>>>>  in call at C:\Users\melese\.julia\v0.4\FTPClient\src\FTPObject.jl:23
>>>>>
>>>>> Thanks 
>>>>> Yared
>>>>>
>>>>

[julia-users] Re: unable to connect to FTP using IP address

2016-07-27 Thread Yared Melese
Hi Samuel, 

Here is how it is done in matlab
% connect to ftp 
f = ftp(host, username, password)
mget(f,'dataOnFTP.bin')

% read data from file 
readData = fopen('dataOnFTP.bin', 'r', 'ieee-le') 

%delete file from server 
delete(f, 'dataOnFTP.bin');

 Here one thing not included is I would like to find the latest file from 
FTP server because there might be similar names with different suffix. 

Thanks 
Yared




On Tuesday, July 26, 2016 at 1:29:36 PM UTC-5, Samuel Massinon wrote:

> No worries, can you show me how you get the file with another program?
>
> On Tuesday, July 26, 2016 at 10:09:06 AM UTC-5, Yared Melese wrote:
>>
>> Hi Samuel, 
>>
>> Thanks for your inputs 
>>
>> I am trying to connect to a file server with IP address and get the 
>> latest file with certain extension then process the data and save it on 
>> local drive, then delete the file from the server. 
>>
>> Sorry, I don't know how to get files from Curl, it seems it is mainly 
>> designed for Http 
>>
>> Thanks 
>> Yared
>>
>>
>>
>>
>>
>>
>> On Thursday, July 21, 2016 at 1:56:01 PM UTC-5, Samuel Massinon wrote:
>>
>>> Hi Yared,
>>>
>>> The error you are getting is something LibCURL is erring on, as 
>>> described here. https://curl.haxx.se/libcurl/c/libcurl-errors.html
>>>
>>> If I try using curl with your settings, I get
>>> ~ $ curl -u anonymous '192.168.251.200/dataOnFTP.bin 
>>> <http://www.google.com/url?q=http%3A%2F%2F192.168.251.200%2FdataOnFTP.bin=D=1=AFQjCNFtV1_YpJULt7jEW8s_Ou3Yg22HiQ>
>>> '
>>> Enter host password for user 'anonymous':
>>> curl: (7) Failed to connect to 192.168.251.200 port 80: Network is 
>>> unreachable
>>>
>>> The FTPClient.jl uses the same library as curl and if you could post how 
>>> to get the file with curl, I might be able to better serve you.
>>>
>>> On Wednesday, July 20, 2016 at 4:17:29 PM UTC-5, Yared Melese wrote:
>>>>
>>>>
>>>>
>>>> Hello 
>>>>
>>>> Would you please let me know if I missed anything, I am using FTPClient 
>>>> and using IP address as a host but not able to connect 
>>>> Here are my commands 
>>>>
>>>> using FTPClient
>>>> ftp_init()
>>>> ftp = FTP(host="192.168.251.200", implt=true, ssl=true, 
>>>> user="anonymous", pswd="")
>>>> binary(ftp)
>>>> file = download(ftp, "dataOnFTP.bin", "C:\Users\xyz\test.bin")
>>>> close(ftp)
>>>> ftp_cleanup()
>>>>
>>>> when sending  " using FTPClient" there are bunch of warnings as shown 
>>>> below partially
>>>> WARNING: Base.String is deprecated, use AbstractString instead.
>>>>   likely near C:\Users\melese\.julia\v0.4\FTPClient\src\FTPC.jl:35
>>>> WARNING: Base.String is deprecated, use AbstractString instead.
>>>>   likely near C:\Users\melese\.julia\v0.4\FTPClient\src\FTPC.jl:67
>>>> WARNING: Base.Uint8 is deprecated, use UInt8 instead.
>>>>   likely near C:\Users\melese\.julia\v0.4\FTPClient\src\FTPC.jl:81
>>>> ..
>>>> .
>>>> .and at the end I am getting the following error 
>>>>
>>>> ERROR: Failed to connect. :: LibCURL error #7
>>>>  [inlined code] from 
>>>> C:\Users\melese\.julia\v0.4\FTPClient\src\FTPC.jl:138
>>>>  in ftp_command at C:\Users\melese\.julia\v0.4\FTPClient\src\FTPC.jl:454
>>>>  in ftp_connect at C:\Users\melese\.julia\v0.4\FTPClient\src\FTPC.jl:493
>>>>  in call at C:\Users\melese\.julia\v0.4\FTPClient\src\FTPObject.jl:23
>>>>
>>>> Thanks 
>>>> Yared
>>>>
>>>

[julia-users] Re: unable to connect to FTP using IP address

2016-07-26 Thread Yared Melese
Hi Samuel, 

Thanks for your inputs 

I am trying to connect to a file server with IP address and get the latest 
file with certain extension then process the data and save it on local 
drive, then delete the file from the server. 

Sorry, I don't know how to get files from Curl, it seems it is mainly 
designed for Http 

Thanks 
Yared






On Thursday, July 21, 2016 at 1:56:01 PM UTC-5, Samuel Massinon wrote:

> Hi Yared,
>
> The error you are getting is something LibCURL is erring on, as described 
> here. https://curl.haxx.se/libcurl/c/libcurl-errors.html
>
> If I try using curl with your settings, I get
> ~ $ curl -u anonymous '192.168.251.200/dataOnFTP.bin'
> Enter host password for user 'anonymous':
> curl: (7) Failed to connect to 192.168.251.200 port 80: Network is 
> unreachable
>
> The FTPClient.jl uses the same library as curl and if you could post how 
> to get the file with curl, I might be able to better serve you.
>
> On Wednesday, July 20, 2016 at 4:17:29 PM UTC-5, Yared Melese wrote:
>>
>>
>>
>> Hello 
>>
>> Would you please let me know if I missed anything, I am using FTPClient 
>> and using IP address as a host but not able to connect 
>> Here are my commands 
>>
>> using FTPClient
>> ftp_init()
>> ftp = FTP(host="192.168.251.200", implt=true, ssl=true, user="anonymous", 
>> pswd="")
>> binary(ftp)
>> file = download(ftp, "dataOnFTP.bin", "C:\Users\xyz\test.bin")
>> close(ftp)
>> ftp_cleanup()
>>
>> when sending  " using FTPClient" there are bunch of warnings as shown 
>> below partially
>> WARNING: Base.String is deprecated, use AbstractString instead.
>>   likely near C:\Users\melese\.julia\v0.4\FTPClient\src\FTPC.jl:35
>> WARNING: Base.String is deprecated, use AbstractString instead.
>>   likely near C:\Users\melese\.julia\v0.4\FTPClient\src\FTPC.jl:67
>> WARNING: Base.Uint8 is deprecated, use UInt8 instead.
>>   likely near C:\Users\melese\.julia\v0.4\FTPClient\src\FTPC.jl:81
>> ..
>> .
>> .and at the end I am getting the following error 
>>
>> ERROR: Failed to connect. :: LibCURL error #7
>>  [inlined code] from C:\Users\melese\.julia\v0.4\FTPClient\src\FTPC.jl:138
>>  in ftp_command at C:\Users\melese\.julia\v0.4\FTPClient\src\FTPC.jl:454
>>  in ftp_connect at C:\Users\melese\.julia\v0.4\FTPClient\src\FTPC.jl:493
>>  in call at C:\Users\melese\.julia\v0.4\FTPClient\src\FTPObject.jl:23
>>
>> Thanks 
>> Yared
>>
>

[julia-users] Re: FFT, PSD and Windowing functions

2016-07-26 Thread Yared Melese
Hi Islam, 

Thanks again for your inputs, 

the first method worked, as  you mentioned it was missing dot to do element 
wise multiplication. 

Here is what it looks like 
pow_fs = (((2^(adc_bits-1))-1))^2 / 2
fb= fb.*hanning(length(fb))

When I tried the weltch function, it actually has two sets of data as shown 
below, how do you split data to plot and manipulate the array? 
Here is the command I used,  periodogram(fb*; onesided=eltype(fb)<:Real*, 
*nfft=nextfastfft(length(fb)*, *fs=150*, *window=hanning*)*ΒΆ* 
<http://dspjl.readthedocs.io/en/latest/periodograms.html#periodogram> 

data collected 


 Thanks 
Yared 

On Friday, July 22, 2016 at 10:33:36 AM UTC-5, Islam Badreldin wrote:

> Hi Yared,
>
> Please see below,,
>
> On Thursday, July 21, 2016 at 11:19:44 AM UTC-4, Yared Melese wrote:
>
>> Hi Islam, 
>>
>> Thanks for your input 
>>
>>  I was able to find all windowing functions; however, there is nothing 
>> about PSD ( power spectral density). In python and matlab, there is 
>> function pwelch which does both windowing and FFT and wondering if there is 
>> the same function in Julia.
>>
>
> Did you take a look at `welch_pgram` function?
> http://dspjl.readthedocs.io/en/latest/periodograms.html#welch_pgram 
> <http://www.google.com/url?q=http%3A%2F%2Fdspjl.readthedocs.io%2Fen%2Flatest%2Fperiodograms.html%23welch_pgram=D=1=AFQjCNE7sBPIu91hvriuZufu3K4EOv1Mkg>
>  
>
>
>> Here is simple trial I had but it is complaining about type mismatch
>>
>> fb= fb[:]*hamming(length(fb))
>> fb = fft(fb) # take FFT of signal 
>>
>> LoadError: MethodError: `*` has no method matching 
>> *(::Array{Complex{Float64},1}, ::Array{Float64,1})
>> Closest candidates are:
>>   *(::Any, ::Any, !Matched::Any, !Matched::Any...)
>>   
>> *{T<:Union{Complex{Float32},Complex{Float64},Float32,Float64},S}(!Matched::Union{DenseArray{T<:Union{Complex{Float32},Complex{Float64},Float32,Float64},2},SubArray{T<:Union{Complex{Float32},Complex{Float64},Float32,Float64},2,A<:DenseArray{T,N},I<:Tuple{Vararg{Union{Colon,Int64,Range{Int64,LD}},
>>  
>> ::Union{DenseArray{S,1},SubArray{S,1,A<:DenseArray{T,N},I<:Tuple{Vararg{Union{Colon,Int64,Range{Int64,LD}})
>>   
>> *{TA,TB}(!Matched::Base.LinAlg.AbstractTriangular{TA,S<:AbstractArray{T,2}}, 
>> ::Union{DenseArray{TB,1},DenseArray{TB,2},SubArray{TB,1,A<:DenseArray{T,N},I<:Tuple{Vararg{Union{Colon,Int64,Range{Int64,LD},SubArray{TB,2,A<:DenseArray{T,N},I<:Tuple{Vararg{Union{Colon,Int64,Range{Int64,LD}})
>>   ...
>> in include_string at loading.jl:282
>> in include_string at C:\Users\melese\.julia\v0.4\CodeTools\src\eval.jl:32
>> in anonymous at C:\Users\melese\.julia\v0.4\Atom\src\eval.jl:84
>> in withpath at C:\Users\melese\.julia\v0.4\Requires\src\require.jl:37
>> in withpath at C:\Users\melese\.julia\v0.4\Atom\src\eval.jl:53
>> [inlined code] from C:\Users\melese\.julia\v0.4\Atom\src\eval.jl:83
>> in anonymous at task.jl:58
>> while loading D:\userdata\melese\Desktop\fft.jl, in expression starting 
>> on line 23
>>
>>
> This particular error seems to be occurring at the `fb= 
> fb[:]*hamming(length(fb))` line. It looks like you are multiplying an 
> _vector_ of complex doubles with a _vector_ of doubles, which is not 
> mathematically defined because of the dimension mismatch, since both 
> vectors are of dimension Nx1. Instead, my guess is that you meant 
> element-wise multiplication using `.*`. But again, I think the 
> `welch_pgram` function should meet your needs.
>
>   -Islam
>  
>
>>
>> On Wednesday, July 20, 2016 at 9:15:40 AM UTC-5, Yared Melese wrote:
>>
>>> Hello 
>>>
>>> Would you please let me know the package available to do windowing, FFT 
>>> and PSD? 
>>>
>>> Currently, I have bin file that I have processed in Julia and need to 
>>> window it and take preferably PSD but FFT work as well
>>>
>>> Thanks 
>>> Yared
>>>
>>>  
>>>
>>>

[julia-users] Re: FFT, PSD and Windowing functions

2016-07-21 Thread Yared Melese
Hi Islam, 

Thanks for your input 

 I was able to find all windowing functions; however, there is nothing 
about PSD ( power spectral density). In python and matlab, there is 
function pwelch which does both windowing and FFT and wondering if there is 
the same function in Julia.

Here is simple trial I had but it is complaining about type mismatch

fb= fb[:]*hamming(length(fb))
fb = fft(fb) # take FFT of signal 

LoadError: MethodError: `*` has no method matching 
*(::Array{Complex{Float64},1}, ::Array{Float64,1})
Closest candidates are:
  *(::Any, ::Any, !Matched::Any, !Matched::Any...)
  
*{T<:Union{Complex{Float32},Complex{Float64},Float32,Float64},S}(!Matched::Union{DenseArray{T<:Union{Complex{Float32},Complex{Float64},Float32,Float64},2},SubArray{T<:Union{Complex{Float32},Complex{Float64},Float32,Float64},2,A<:DenseArray{T,N},I<:Tuple{Vararg{Union{Colon,Int64,Range{Int64,LD}},
 
::Union{DenseArray{S,1},SubArray{S,1,A<:DenseArray{T,N},I<:Tuple{Vararg{Union{Colon,Int64,Range{Int64,LD}})
  
*{TA,TB}(!Matched::Base.LinAlg.AbstractTriangular{TA,S<:AbstractArray{T,2}}, 
::Union{DenseArray{TB,1},DenseArray{TB,2},SubArray{TB,1,A<:DenseArray{T,N},I<:Tuple{Vararg{Union{Colon,Int64,Range{Int64,LD},SubArray{TB,2,A<:DenseArray{T,N},I<:Tuple{Vararg{Union{Colon,Int64,Range{Int64,LD}})
  ...
in include_string at loading.jl:282
in include_string at C:\Users\melese\.julia\v0.4\CodeTools\src\eval.jl:32
in anonymous at C:\Users\melese\.julia\v0.4\Atom\src\eval.jl:84
in withpath at C:\Users\melese\.julia\v0.4\Requires\src\require.jl:37
in withpath at C:\Users\melese\.julia\v0.4\Atom\src\eval.jl:53
[inlined code] from C:\Users\melese\.julia\v0.4\Atom\src\eval.jl:83
in anonymous at task.jl:58
while loading D:\userdata\melese\Desktop\fft.jl, in expression starting on 
line 23


On Wednesday, July 20, 2016 at 9:15:40 AM UTC-5, Yared Melese wrote:

> Hello 
>
> Would you please let me know the package available to do windowing, FFT 
> and PSD? 
>
> Currently, I have bin file that I have processed in Julia and need to 
> window it and take preferably PSD but FFT work as well
>
> Thanks 
> Yared
>
>  
>
>

[julia-users] unable to connect to FTP using IP address

2016-07-20 Thread Yared Melese


Hello 

Would you please let me know if I missed anything, I am using FTPClient and 
using IP address as a host but not able to connect 
Here are my commands 

using FTPClient
ftp_init()
ftp = FTP(host="192.168.251.200", implt=true, ssl=true, user="anonymous", 
pswd="")
binary(ftp)
file = download(ftp, "dataOnFTP.bin", "C:\Users\xyz\test.bin")
close(ftp)
ftp_cleanup()

when sending  " using FTPClient" there are bunch of warnings as shown below 
partially
WARNING: Base.String is deprecated, use AbstractString instead.
  likely near C:\Users\melese\.julia\v0.4\FTPClient\src\FTPC.jl:35
WARNING: Base.String is deprecated, use AbstractString instead.
  likely near C:\Users\melese\.julia\v0.4\FTPClient\src\FTPC.jl:67
WARNING: Base.Uint8 is deprecated, use UInt8 instead.
  likely near C:\Users\melese\.julia\v0.4\FTPClient\src\FTPC.jl:81
..
.
.and at the end I am getting the following error 

ERROR: Failed to connect. :: LibCURL error #7
 [inlined code] from C:\Users\melese\.julia\v0.4\FTPClient\src\FTPC.jl:138
 in ftp_command at C:\Users\melese\.julia\v0.4\FTPClient\src\FTPC.jl:454
 in ftp_connect at C:\Users\melese\.julia\v0.4\FTPClient\src\FTPC.jl:493
 in call at C:\Users\melese\.julia\v0.4\FTPClient\src\FTPObject.jl:23

Thanks 
Yared


[julia-users] FFT, PSD and Windowing functions

2016-07-20 Thread Yared Melese
Hello 

Would you please let me know the package available to do windowing, FFT and 
PSD? 

Currently, I have bin file that I have processed in Julia and need to 
window it and take preferably PSD but FFT work as well

Thanks 
Yared

 



Re: [julia-users] Re: Julia String Manipulation

2016-07-18 Thread Yared Melese
Perfect!!! Thank you very much 

It works!

On Monday, July 18, 2016 at 2:39:21 PM UTC-5, Tom Breloff wrote:

> julia> parse(Float64,ans[1])
> 200.5
>
>
> On Mon, Jul 18, 2016 at 3:33 PM, Yared Melese <yam0...@gmail.com 
> > wrote:
>
>> Thanks for quick response, it works in most cases but when the number is 
>> float, parse has problem as shown below 
>>
>> How about when the number has decimal points for example 
>>
>> exString = "Exact number 390  \n Exact qty: +200.5 people \n Starting 
>> number:  5 now 16.5A_C"
>> srchStr ="Exact qty:"
>> search(exString, srchStr)
>> ans = exString[search(exString, srchStr)[end]+1:end] |> strip |> split
>> value1= parse(string,ans[1])
>>
>> Thanks 
>> Yared
>>
>>
>> On Monday, July 18, 2016 at 1:31:16 PM UTC-5, Yared Melese wrote:
>>
>>> Hello 
>>>
>>> I was trying to parse a number from string as shown below. Would you 
>>> please let me know if there is easy way to get the number after 
>>> a specific string ? please note that the string can be variable(different)
>>>
>>> goal is to specify search string and put out exact number with out any 
>>> text before and after the number. 
>>>
>>> The current program shown below has two faults 
>>> 1. on line 10, I have to manually enter starting word but cannot put a 
>>> variable as shown below 
>>> c = match(r"$srchStr[\w|\w %s%f%f|.|:|+]*", b[srchInd])
>>>
>>> 2. I have to only get a number, that means anything in front and behind 
>>> that number should be stripped off
>>>
>>>
>>>
>>> exString = "Exact number 390  \n Exact qty: +200 people \n Starting 
>>> number:  5 now 16.5A_C"
>>> srchStr ="Exact qty:"
>>> b= split(exString,"\n") # put each line to an array form
>>> #find index of excact string match
>>> for i in 1:length(b)
>>> if contains(b[i], srchStr) == true
>>>   srchInd = i
>>> end
>>>end
>>> c = match(r"$srchStr[\w|\w %s%f%f|.|:|+]*", b[srchInd])
>>> d=replace(c.match, srchStr,"")
>>> print(d)
>>>
>>
>

[julia-users] Re: Julia String Manipulation

2016-07-18 Thread Yared Melese
Thanks for quick response, it works in most cases but when the number is 
float, parse has problem as shown below 

How about when the number has decimal points for example 

exString = "Exact number 390  \n Exact qty: +200.5 people \n Starting 
number:  5 now 16.5A_C"
srchStr ="Exact qty:"
search(exString, srchStr)
ans = exString[search(exString, srchStr)[end]+1:end] |> strip |> split
value1= parse(string,ans[1])

Thanks 
Yared

On Monday, July 18, 2016 at 1:31:16 PM UTC-5, Yared Melese wrote:

> Hello 
>
> I was trying to parse a number from string as shown below. Would you 
> please let me know if there is easy way to get the number after 
> a specific string ? please note that the string can be variable(different)
>
> goal is to specify search string and put out exact number with out any 
> text before and after the number. 
>
> The current program shown below has two faults 
> 1. on line 10, I have to manually enter starting word but cannot put a 
> variable as shown below 
> c = match(r"$srchStr[\w|\w %s%f%f|.|:|+]*", b[srchInd])
>
> 2. I have to only get a number, that means anything in front and behind 
> that number should be stripped off
>
>
>
> exString = "Exact number 390  \n Exact qty: +200 people \n Starting 
> number:  5 now 16.5A_C"
> srchStr ="Exact qty:"
> b= split(exString,"\n") # put each line to an array form
> #find index of excact string match
> for i in 1:length(b)
> if contains(b[i], srchStr) == true
>   srchInd = i
> end
>end
> c = match(r"$srchStr[\w|\w %s%f%f|.|:|+]*", b[srchInd])
> d=replace(c.match, srchStr,"")
> print(d)
>


Re: [julia-users] Re: testing intrument Automation

2016-07-18 Thread Yared Melese
Thanks - Instrument drivers works just fine 

Here is reference for others 

using Instruments
   PXA = GenericInstrument()
   connect!(PXA,"GPIB0::18::INSTR")   # Connect to Instrument with name PXA
   write(PXA, "system:preset")  # Write to PXA instrument 
   acp = split((query(PXA, "read:ACP?")),",")  # read ACP from Inst 



On Monday, July 4, 2016 at 1:29:50 PM UTC-5, Keno Fischer wrote:

> You may want to look at Instruments.jl: 
> https://github.com/BBN-Q/Instruments.jl 
>
> On Mon, Jul 4, 2016 at 2:00 PM, Alex Mellnik <a.r.m...@gmail.com 
> > wrote: 
> > Hi Yared, 
> > 
> > This should be possible, but it could be less than ideal in some 
> instances. 
> > What exactly are you hoping to automate? 
> > 
> > Like Isaiah, I don't know of a specific GPIB library for Julia, but if 
> you 
> > are using the NI drivers you can call them directly from Julia (see 
> > 
> http://docs.julialang.org/en/release-0.4/manual/calling-c-and-fortran-code/ 
> > and there's a bit of specific information about the GPIB libraries here: 
> > 
> http://alex.mellnik.net/application-notes/application-notesusing-nis-gpib-drivers-in-qt/).
>  
>
> > 
> > -A 
> > 
> > 
> > On Saturday, July 2, 2016 at 5:39:07 PM UTC-7, Yared Melese wrote: 
> >> 
> >> Can Julia be used as instrument test Automation? Send commands via GPIB 
> to 
> >> different instruments 
> >> 
> >> If so is there Visa library for it? 
> >> 
> >> Thanks 
> >> Yared 
>


[julia-users] Julia String Manipulation

2016-07-18 Thread Yared Melese
Hello 

I was trying to parse a number from string as shown below. Would you please 
let me know if there is easy way to get the number after a specific string 
? please note that the string can be variable(different)

goal is to specify search string and put out exact number with out any 
text before and after the number. 

The current program shown below has two faults 
1. on line 10, I have to manually enter starting word but cannot put a 
variable as shown below 
c = match(r"$srchStr[\w|\w %s%f%f|.|:|+]*", b[srchInd])

2. I have to only get a number, that means anything in front and behind 
that number should be stripped off



exString = "Exact number 390  \n Exact qty: +200 people \n Starting 
number:  5 now 16.5A_C"
srchStr ="Exact qty:"
b= split(exString,"\n") # put each line to an array form
#find index of excact string match
for i in 1:length(b)
if contains(b[i], srchStr) == true
  srchInd = i
end
   end
c = match(r"$srchStr[\w|\w %s%f%f|.|:|+]*", b[srchInd])
d=replace(c.match, srchStr,"")
print(d)


Re: [julia-users] Re: testing intrument Automation

2016-07-08 Thread Yared Melese
Thanks for your quick response 

I have different commands that I want to control instruments via GPIB 
commands, It will be okay if I can import NI visa and build different logic 
in automating instruments. 

Here is a simple Python command I send to setup spectrum analyzer. I am a 
beginner and I would like to learn and stick with one language and Julia 
seems to be interesting to me

import visa
import numpy as np
class MXA_ACP:
def __init__(self,gpib_address="GPIB0::18",hw = 1, route = "A"):

rm = visa.ResourceManager()
self.handle = rm.open_resource('{}::INSTR'.format(gpib_address))
#self.handle= 
visa.instrument('TCPIP0::{}::INSTR'.format(TCPIP_Address))

  
def ACP_set(self,BW,freq,numCarr,spacing):
   self.handle.write('system:preset')
   self.handle.write('CONFigure:ACPower')
   self.handle.write('CONFigure:ACPower:NDEFault')
   self.handle.write('INST:SEL LTE')
   # set standard based on BW 
   if BW ==5:
  self.handle.write('SENSe:RADio:STANdard:PRESet B5M')
   elif BW == 10:
 self.handle.write('SENSe:RADio:STANdard:PRESet B10M')
   elif BW == 20: 
self.handle.write('SENSe:RADio:STANdard:PRESet B20M')

   self.handle.write('ACP:carr:coun {}'.format(numCarr)) #set number of 
carriers 
   self.handle.write('ACP:carrier:RCFR {} MHz'.format(freq))#set Freq
   self.handle.write('ACP:carr1:list:width {} MHz'.format(spacing)) # 
set carrier spacing 
   self.handle.write('Corr:nois:flo ON') # noise floor extention
   self.handle.write(':power:RF:range:optimize immediate')
   self.handle.write('ACP:aver:coun 50') # averaging 
   self.handle.write('*WAI')   # wait for averaging to finish   
   acp = np.fromstring(self.handle.ask('read:ACP?'), sep=',')
   acp_3rd_upper = acp[4]
   acp_3rd_lower= acp[6]
   acp_5th_upper= acp[8]
   acp_5th_lower= acp[10]
   print acp_3rd_upper
   print acp_3rd_lower
   print acp_5th_upper
   print acp_5th_lower
   return  acp_3rd_upper, acp_3rd_lower,acp_5th_upper

On Monday, July 4, 2016 at 1:29:50 PM UTC-5, Keno Fischer wrote:

> You may want to look at Instruments.jl: 
> https://github.com/BBN-Q/Instruments.jl 
>
> On Mon, Jul 4, 2016 at 2:00 PM, Alex Mellnik <a.r.m...@gmail.com 
> > wrote: 
> > Hi Yared, 
> > 
> > This should be possible, but it could be less than ideal in some 
> instances. 
> > What exactly are you hoping to automate? 
> > 
> > Like Isaiah, I don't know of a specific GPIB library for Julia, but if 
> you 
> > are using the NI drivers you can call them directly from Julia (see 
> > 
> http://docs.julialang.org/en/release-0.4/manual/calling-c-and-fortran-code/ 
> > and there's a bit of specific information about the GPIB libraries here: 
> > 
> http://alex.mellnik.net/application-notes/application-notesusing-nis-gpib-drivers-in-qt/).
>  
>
> > 
> > -A 
> > 
> > 
> > On Saturday, July 2, 2016 at 5:39:07 PM UTC-7, Yared Melese wrote: 
> >> 
> >> Can Julia be used as instrument test Automation? Send commands via GPIB 
> to 
> >> different instruments 
> >> 
> >> If so is there Visa library for it? 
> >> 
> >> Thanks 
> >> Yared 
>


[julia-users] testing intrument Automation

2016-07-02 Thread Yared Melese
Can Julia be used as instrument test Automation? Send commands via GPIB to 
different instruments

If so is there Visa library for it? 

Thanks 
Yared