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
[Review]: Functions to calculate GOES radiative losses #1067
Conversation
GOESLightCurve DataFrame is numpy arrays with np.asarray(). Added if statement in rad_loss_rate() to ensure that AttributeError was raised due to absence of temperature and/or em data in GOESLightCurve before carrying on with code. Added download kwarg to rad_loss_rate() as exists in temp_em(). Replaced usage of exceptions module.
Replaces usage of exceptions module Introduced usage of np.asarray() and np.asanyarray() instead of using np.array() to convert a variable to a numpy array.
Introduced usage of np.asarray() and np.asanyarray() instead of using np.array() to convert a variable to a numpy array.
Replaced usage of exceptions module. Introduced usage of np.asanyarray() and np.anarray() instead of np.array() for converting to numpy float arrays.
are also done in goes_lx().
Replaced usaged of exceptions module with use of np.asanyarray() to ensure flux input is of correct float64 numpy array type and also sunpy.time.parse_time() to ensure date is of correct type.
as this is already checked in _calc_xraylum().
Updated docstring. Replaced usaged of exceptions module with np.asarray() Added funtionality whereby time intervals are calculated even if only two time measurements are given. In this case, two intervals are given, each equal to half the time difference between the two time measurements. This is now explained in the docstring.
…loss Conflicts: sunpy/instr/goes.py
chianti_rad_loss.csv exists locally on user's machine. This also required added download_dir kwarg to calc_rad_loss() and rad_loss_rate().
…string of calc_rad_loss().
_get_goes_chianti_temp(), and _get_goes_chianti_em() to bring them more in line with PEP8 conventions.
…gy in the GOES wavelength ranges as a function of time via the cumulative kwarg.
LightCurve object containing GOES data. The radiative loss rate is | ||
determined from the GOES isothermal temperature and volume emission | ||
measure as a function of time, as calculated by | ||
calculate_temperature_em(). See docstring of that function for more |
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.
This function name should be in backticks so it's linked (prefix with ~)
Just minor documentation tweaks left, so 👍 from me. |
Final review on this one please people. |
References | ||
---------- | ||
Hanser, F.A., & Sellers, F.B. 1996, Proc. SPIE, 2812, 344 | ||
Dere, K.P., et al. 2009 A&A, 498, 915 |
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 we put doi with any reference we put in our docs? it makes a lot easier to search for them:
Hanser... doi:10.1117/12.254082
Dere... doi:10.1051/0004-6361/200911712
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 sense the desire for a sphinx extension here
..ref: doi 10.1051/0004-6361/200911712
which prints a formatted reference with links.
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.
Just to be clear @Cadair, the full thing in this example would be
Dere, K.P., et al. 2009 A&A, 498, 915 ref doi 10.1051/0004-6361/200911712
?
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.
@DanRyanIrish No, I was suggesting that we could automate it in some distant future land.
Also added import statements in examples sections of docstrings
1cae549
to
813e637
Compare
@dpshelio gave 👍 in chat, so merging |
[Review]: Functions to calculate GOES radiative losses
Hi guys,
Here is the next batch of software for analysing GOES data in sunpy. This PR includes functions to calculate the radiative losses from the GOES-observed plasma, calc_rad_loss(), and the X-ray luminosity in the wavelength ranges of the two GOES channels, goes_lx(). There are also two functions which allows these properties to be calculated and inserted directly into and GOESLightCurve object, rad_loss_rate() and xray_luminosity, respectively.
Let me know what you guys think. For instance, there is probably a better place than goes.py to put _time_steps(), which calculates the time differences between successive measurement times. I'm also not sure if the assert statements in my units tests are the most efficient.
However, all the function give the correct results. If the functionality proposed here can be merged, sunpy could allow you to do all the analysis of GOES data that is possible in SSW which I think would be a great step forward.