LadyBug - Extracting data of a specific hour of a year

Hello everybody,

I would like to ask how to use three separate sliders (hour, day, month) to extract data of a specific hour of a year. For example, I want to get dryBulb Temperature data (from importEPW component) of today. I am wondering if there are any LadyBug components that help me to do that, or there are anyway to do that with Grasshopper components.

Please kindly help me to answer my question! I am looking forward to your helps!

Thank you very much in advance!!

Best regards,

Anthony Pham

Hello Anthony,
I don’t remember seing a component like this in LB tools but maybe I’m wrong.

What you can do here is some manipulations with your list of data. Use the date to HOY component converter to find the indices to cut your list. You have the example in the file attached.
Maybe you should consider to fully understand how to manipulate data with GH because this IS really usefull. This is a very good starting point : https://vimeopro.com/rhino/grasshopper-masterclass-with-david-rutten

ExtractPeriodData.gh (375.4 KB)

NB : Please note that you may have to think about the boundaries of your domain, maybe you have to shift the HOY indice of +/-1 to have the correct period. As I did on the first component. I let you solve that

1 Like

Hello Emmanue,

Thank you so much for your kind reply! I have not tried your recommendation out yet, but I will and get back to you soon. I will be back to my work early next week. So I will let you know about my solving at that time.

Again, I really appreciate you help!

With the best regards,

Anthony Pham

Your question is a bit fuzzy, do you want value for only 1 hour or hourly values for a specific time range?

The answer from @EmmanuelR is for a time range, which there’s already exists a component for it. For only 1 specific hour then you can just use list item.

4 Likes

My bad, thank you for the advice !

1 Like

You can do the following

1 Like

This is incorrect and only gives you result of 1 hour after your selected HOY instead of correct value.
HOY = [1…8760] while list index = [0…8759]

1 Like

Hello guys,

Thank you sooo very much for your kind help! I will try all the recommendations out and let you guys know how they work.

Really appreciate your help!

Best regards,

Pham Anh Tu

@vhoang is correct! @devang please either modify the reply or remove it so it doesn’t confuse others who see this topic in the future.

Good catch @vhoang. Thanks! I will update the solution in next week.

I updated the solution

Thanks… I was searching for it.

The solution using Ladybug_DOY_HOY miss leap year condition

import datetime

sampleDate = datetime.date(year[20], month, day)   ##year[20] from modelYear list

dateFormatted = sampleDate.strftime("%j")

Index = ((int(dateFormatted)-1)*24)+hour-1  ##range of input hours between (1,24)