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

[Review]: Functions to calculate GOES radiative losses #1067

Merged
merged 137 commits into from Feb 2, 2015

Conversation

DanRyanIrish
Copy link
Member

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.

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.
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.
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.
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().
_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
Copy link
Member

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 ~)

@Cadair
Copy link
Member

Cadair commented Jan 30, 2015

Just minor documentation tweaks left, so 👍 from me.

@Cadair
Copy link
Member

Cadair commented Jan 31, 2015

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
Copy link
Member

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

Copy link
Member

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.

Copy link
Member Author

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
?

Copy link
Member

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
@ayshih
Copy link
Member

ayshih commented Feb 2, 2015

@dpshelio gave 👍 in chat, so merging

ayshih added a commit that referenced this pull request Feb 2, 2015
[Review]: Functions to calculate GOES radiative losses
@ayshih ayshih merged commit c1af1ec into sunpy:master Feb 2, 2015
@Cadair Cadair removed the Needs Review Needs reviews before merge label Feb 2, 2015
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

Successfully merging this pull request may close these issues.

None yet

9 participants