-
Notifications
You must be signed in to change notification settings - Fork 6
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
Tutorial Error when including shift #111
Comments
The problem arised because we have the line The basic solution to this problem would be to create a similar line to (1) involving the shifts so it has the same length, but that doesn't make sense physically. x is a continuous dataset but the corresponding shift isn't |
Works when Does not work when This is because the sh array is being called somewhere in the calculation of the transit model which is then used to calculate the smooth model and as sh is not then transformed to the new x_smooth then it does not work with the module being called. @ivalaginja could you take a look at this in the notebook you can change the parameters above on In[7]
Then going down to In[11] with the line
This model.calc seems to call transit model not just marg.occultnl and it then gets the error printed in the first comment. This needs to be determined if it is just a tutorial notebook problem or if this is an issue in the main code. |
This is clearly limited to the tutorial notebook and the main margmodul and marginalization codes work well locally. |
Ah I see. Yes, I can have a look at this this week. |
Looking at this, I confirm what @hrwakeford said above: This is an issue in the notebook only, not in the main marginalisation code. This is because the tutorial tries to exploit as many of the internal Sherpa functionality as possible, since it presents a simplified example. The main code on the other hand still uses some own functions where Sherpa could be used, in this case the evaluation of the model on a smooth grid. We can see in the main code ( I will now look for a solution. |
The difference occurs because It is only the systematic model that needs the shift array |
Yeah the problem in the tutorial notebook comes when you include your own gris of sh values and then follow the rest of the procedures. And it is in the calling of the model evaluator that is then essentially taking in more information than needed for the smooth model generation. I think this is fairly minor and just then needs some details at the top of the notebook to outline the situations where it is valid. So for example: This notebook is just a simple example to demonstrate how the package handles the input light curves. For example, it does not include fitting for positional shifts via the sh array to speed up the fitting process and provide visual examples of the routine. |
Yup, I see. Would you like me to do that, add clarifying notes in the notebook and call it? If it is not physical to include a grid of sh values when calculating a smooth model, then there is no point in hacking the code to enable it to do something of that sort. |
Yeah it does not make sense to include the sh values when making the smooth model. As we have in the main code package. I think add a note to the top of the notebook and I like the idea of the error message as well just so it is clear. As the main code calculates the smooth model in a different way I think we can leave it for now and close this issue. I think what we might do @lili-alderson is think of putting together a more complete tutorial in the future if needed. |
Ok cool, I am on it. Yes, a more extensive tutorial going into more details would certainly be a great addition. And, it's good that @lili-alderson found this, as this will directly inform any potential work in issue #35. |
Resolved with #112. |
When adding sh=value (rather than sh=None) in model=marg.Transit(), y_smooth_model = model.calc(pars=params, x=x_smooth) creates the following error. Both the data and the shift have the same length
The text was updated successfully, but these errors were encountered: