-
Notifications
You must be signed in to change notification settings - Fork 5
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
Adjust earthshine effect based on Earth phase #117
Conversation
I am having trouble seeing how telemetry format could play into a thermal model, but maybe I'm missing something. There are likely some coincidental correlations with format, but not causation right? Since this is completely unrelated it would probably be best to put 555c291 into a separate PR. |
@taldcroft the motivation for including the telemetry format is that during FMT1 we are not getting ACIS DEA HKP data at frequent intervals and it is sometimes helpful when fitting the ACIS FP model in I'm happy to remove it and put it in a different PR if necessary. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code here looks basically fine, with some minor comments. The PR itself needs docs on the testing, interface impacts (e.g. making sure it doesn't change existing results for the case without solar ephemeris) etc.
Is there benefit to getting this into the upcoming Ska release?
xija/component/heat.py
Outdated
solar_xyzs = [getattr(self, 'solarephem0_{}'.format(x)) | ||
for x in ('x', 'y', 'z')] | ||
|
||
if not None in solar_xyzs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linters will probably say this should be if None not in solar_xyzs:
. I'm try to get away from nitpicky comments, but here there is real ambiguity about precedence not (None in solar_xyzs)
or (not None) in solar_xyzs
. It is probably the former since the code is working, but this could be worth fixing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed this
xija/component/heat.py
Outdated
@@ -640,6 +654,21 @@ def dvals(self): | |||
else: | |||
self.calc_earth_vis_from_taco(ephems, q_atts) | |||
|
|||
# This next bit optionally checks to see if the solar ephemeris | |||
# was passed in, and if it was it computes the fraction of the | |||
# Earth's surface that is illuminated by the Sun. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Include a link or reference to the TWG meeting where you presented this, so we can get back to that nice hand-drawn picture of the math.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
xija/component/heat.py
Outdated
cos = np.sum(ephems*solars, axis=1) | ||
es = np.sum(ephems*ephems, axis=1)*np.sum(solars*solars, axis=1) | ||
cos /= np.sqrt(es) | ||
self._dvals *= 0.5*(1.0+cos) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there be a convenient way to get access to this multiplicative factor via plotting or at least as an attribute to allow for diagnostics? I don't remember enough of the details to know how hard this would be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
OK, now I understand about the TlmFormat. So just go ahead with a separate PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran the unit tests on Mac with a pass. Thanks for the changes, looks good now.
I tested this PR on chimchim with a local Xija installation by generating the ACIS FP dashboard plot with your new acisfp_spec.json (https://github.com/jzuhone/chandra_models/blob/fp_recal_2022/chandra_models/xija/acisfp/acisfp_spec.json). Everything seemed to work. |
@taldcroft I will add the extra info to the PR description. Should I bundle this with the new thermal model in a single FSDS? |
@taldcroft @matthewdahmer one note--with the added parameter |
@jzuhone @taldcroft, If I remember correctly, the new ACIS FP model will require changes to the Matlab FOT Tools to pass in new parameters. We should get that sorted out before submitting the FSDS for the thermal model. The new version of Xija should be promoted first and included in the FOT MATLAB Tools version of Ska so @jskrist has the supporting Xija code available to develop against. |
But if we promote this version of xija and install it without the new model, we cannot run the existing ACIS FP flight model, correct? It does not have the new parameter. |
@jzuhone Sorry, I read what you wrote too quickly. I thought I heard you say during the TWG meeting that the current version of the ACIS FP model would work with the new version of Xija, however I see you are saying this is not the case. We just need to:
We should tag up with @jskrist during our follow-on meeting after the MPCWG to see what his schedule looks like and how he would prefer we proceed. I'll bring this up during our Matlab Dev meeting tomorrow as well. |
I also note that doesn't seem quite clear from the interface impacts? If I understand correctly, should this PR be updated to be more backward compatible and then make the breaking change at the next version? |
This PR was included in FSDS-25 and is now approved. |
Right, so since the FSDS was brought as a github PR, I think this can get merged and a new release cut. |
Description
NOTE: The PR is finished but there is no expected hurry to merge it since I anticipate it will generate some discussion.
This PR allows the heating on the ACIS FP from the earthshine into the ACIS radiator to depend on the Earth phase. The existing code assumes that the relevant earthshine is in the infrared, which should to zeroth order be the same regardless if the Earth is illuminated or not by the Sun. This code is an experimental feature to test the hypothesis that the model for the effect of earthshine on the temperature could be improved if we accounted for the Earth phase.
This PR adds this capability by using the solar ephemeris along with the spacecraft ephemeris to compute the fraction of the Earth which is illuminated by the Sun. It is currently an optional calculation through the use of kwargs. Note that this is a simple calculation which assumes that the ACIS radiator can see the whole Earth.
This calculation improves the fit of the ACIS FP thermal model at high temperatures during radzones, which was demonstrated at the TWG on 3/3/22.
Interface impacts
If the Earth phase factor is not included, the same model results are obtained as with the previous xija version.
Testing
Unit tests
Functional tests
Models with and without the Earth phase factor were checked to ensure they ran as expected.