Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need some clarification regarding the getting of commanded states #10

Open
jzuhone opened this issue Sep 26, 2017 · 2 comments
Open

Need some clarification regarding the getting of commanded states #10

jzuhone opened this issue Sep 26, 2017 · 2 comments

Comments

@jzuhone
Copy link
Member

jzuhone commented Sep 26, 2017

Hi @taldcroft and @jeanconn,

@Gregg140 and I had some questions about what is going on in this code snippet:

dpa_check/dpa_check.py

Lines 267 to 277 in ca60736

# If cmd lines options were not fully specified then get state0 as last
# cmd_state that starts within available telemetry. Update with the
# mean temperatures at the start of state0.
if None in state0.values():
state0 = cmd_states.get_state0(tlm['date'][-5], db,
datepar='datestart')
ok = ((tlm['date'] >= state0['tstart'] - 700) &
(tlm['date'] <= state0['tstart'] + 700))
state0.update({'T_dpa': np.mean(tlm['1dpamzt'][ok])})

  1. Why do we go back 5 values from the end of telemetry in line 272?
  2. Is it necessary to take an average in lines 274-276?
  3. Is there any particular reason why we can't just pick some arbitrary time in the past long enough ago to pick a starting temperature, instead of the last commanded state with available telemetry?

We're just looking for ways to simplify this particular part of the code. We will be implementing these changes primarily in acis_thermal_check, but since this is the code that is running at the moment I thought we'd comment here.

Thanks!

@jzuhone
Copy link
Member Author

jzuhone commented Sep 26, 2017

cc: @richardjedgar if you want to follow along

@taldcroft
Copy link
Contributor

Why do we go back 5 values from the end of telemetry in line 272?

That's somewhat arbitrary, but I just wanted to back up a little to be sure the value is not right on the edge.

Is it necessary to take an average in lines 274-276?

Not strictly necessary, but it seemed like a reasonable thing because IIRC the DPA temperature telemetry is fairly quantized so getting a sampling over 1.4ks might give a better starting estimate. But it's true that it is not critical.

Is there any particular reason why we can't just pick some arbitrary time in the past long enough ago to pick a starting temperature, instead of the last commanded state with available telemetry?

You don't want to go back any further than necessary because then propagation errors are larger. That probably wasn't in your plan but just want to be clear.

Looking at this code again, the point is that it uses these discrete command states for thermal propagation and so you need to join the starting temperature (from available telemetry) to the available command states. The existing code does that, but I realize now that one could modify the start time of state0 to match the starting temperature time. This might avoid a situation where your propagation is longer than necessary because state0 happens to be a very long one and then current code backs up to the beginning of that state.

Something along the lines of:

    if None in state0.values():
        state0 = cmd_states.get_state0(tlm['date'][-5], db,
                                       datepar='datestart')
        state0.update({'T_dpa': np.mean(tlm['1dpamzt'][-10:])})  # last 10 samples
        state0['datestart'] = tlm['date'][-5]  # middle of the last 10 samples
        state0['tstart'] = ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants