byuflowlab / Solar.jl

Package Containing Methods related to solar energy collection.
Other
0 stars 0 forks source link

Trajectory and sunshine structs have a common dependence on time #3

Open taylormcd opened 6 years ago

taylormcd commented 6 years ago

The trajectory and the sunshine data both change with time. Where should the time array then be stored? Should we have a separate array for each struct and develop a method to combine them when calculating solar capture?

juddmehr commented 6 years ago

Why is time necessary for trajectory information?
The time field in the sunshine type is an absolute hour used to access the flux interpolation object. In the current setup, everything else is just an array that doesn't require time data in order to be accessed.

taylormcd commented 6 years ago

Both solar flux and the aircraft trajectory vary with time. While the aircraft trajectory does not require a time array in order to be accessed, its contents are meaningless without the corresponding time for each aircraft orientation. Sunshine data is similarly meaningless without the corresponding time. How do we ensure that we are working with the same time array for both structs? I'm not referring to how things currently are set up, but rather how we organize the package for future use.

juddmehr commented 6 years ago

I understand now. I don't think that the sunshine and trajectory structs should be inherently coupled. I can see uses for both outside the realm of SRHALE aircraft. It is important for them to be temporally synced though. I can think of a few options

  1. just initialize them at the same time, using the same time array in both structs.
  2. allow different time steps for each struct and figure out some way to align them later.
  3. Put both structs into another struct that includes a time field.

If these structs are just set up with arrays, without any interpolation objects, then we really only need time step lengths, which I've generally assumed are constant. We could just go with option 1, and give them both a dt field and set them equal.