Array -Time [message #91972] |
Thu, 24 September 2015 05:16  |
joyrles1996
Messages: 27 Registered: August 2015
|
Junior Member |
|
|
I have:
HH FLOAT = Array[1, 859]
MM FLOAT = Array[1, 859]
how Do create a only array with times value,e.g time=[1,859], with datas in array hh:mm. After I need to create a plot with day of year in funtion of time. Help me please.
|
|
|
Re: Array -Time [message #91973 is a reply to message #91972] |
Thu, 24 September 2015 05:34   |
Helder Marchetto
Messages: 520 Registered: November 2011
|
Senior Member |
|
|
On Thursday, September 24, 2015 at 2:16:22 PM UTC+2, Joyrles Fernandes wrote:
> I have:
> HH FLOAT = Array[1, 859]
> MM FLOAT = Array[1, 859]
>
> how Do create a only array with times value,e.g time=[1,859], with datas in array hh:mm. After I need to create a plot with day of year in funtion of time. Help me please.
My first question should be: what have you tried so far and what didn't work?
But whatever, I don't have my IDL open at the moment and I don't think it's necessary. So how about multiplying HH by 60 and summing that to MM? That would look like(*):
time = HH*60.0+MM
And time would have units of minutes(**).
Apart from that, depending on what you do, it might be convenient to make HH and MM 1d-arrays:
time = reform(HH)*60.0+reform(MM)
As far as your second question is concerned, I don't understand what "plot with day of year in function of time" means. Plotting this would result in a line. There are 24 h in a day and the equation would be day = 24.0*60.0*time.
Cheers,
Helder
(*) if you want to have time in hours instead of minutes, then use time = HH + MM/60.0.
(**) depending on your scientific field, minutes are generally not the unit to use. I would go for seconds, but astronomers might go for years or whatever else. But seconds would be my choice, so you would have to multiply everything by 60.0
|
|
|
|
|
Re: Array -Time [message #91997 is a reply to message #91977] |
Mon, 28 September 2015 09:28  |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
On 09/24/15 08:53, Joyrles Fernandes wrote:
> Em quinta-feira, 24 de setembro de 2015 09:39:52 UTC-3, Klemen escreveu:
>> The most elegant is converting all time / date to Julian day
>> format(using Julian function) and once you plot it (in functional graphics),
>> you can define in which format is the date / time.
>>
>> Cheers, Klemen >
> How do i convert just hours and minutes with julday?
Here ya go:
http://www.exelisvis.com/docs/date_time_data.html
and
http://www.exelisvis.com/docs/LABEL_DATE.html
The latter has examples on how to plot formatted time axes. The examples
are for direct graphics but I believe can be translated directly to
function graphics.
cheers,
paulv
|
|
|