Query regarding the code for deriving temperature of solar plasma using sunpy

33 views
Skip to first unread message

Divya Maria

unread,
May 19, 2021, 12:32:06 PM5/19/21
to SunPy
Dear sir,

I am a student doing masters in physics. As part of the curriculum, I have to submit my dissertation for the fulfillment of my degree.

My current need is to get the temperature of solar plasma using GOES 16 XRS data. My guide has instructed me to use sunpy. I came across this module sunpy.instr.goes.calculate_temperature_em and verified with my guide. I have a netcdf file which I have downloaded from GOES website. The data is recorded for the date of 29 -11-2020.

Using the module mentioned above with the file and seeing the error log, I understand that this module supports only for time series or the timeseries doesn't work for netcdf files.

But verifying again with my guide, she is telling the module I have referred to is correct. All I need to do is to read the file and use the function.

It would be great if I can get a piece of advice on how to use the module with netcdf files. I request you to kindly consider the same. 

Attaching the .py file I have tried.

Regards,
Divya Maria Varghese
temptest2.py

will.t...@gmail.com

unread,
May 19, 2021, 4:14:40 PM5/19/21
to SunPy
Hi Divya,

The input to calculate_temperature_em is a TimeSeries object (see https://docs.sunpy.org/en/stable/api/sunpy.instr.goes.calculate_temperature_em.html#sunpy.instr.goes.calculate_temperature_em.) rather than an array extracted from the netCDF file that you have passed in your script. You can easily create a TimeSeries from your file which you can then pass into this function,

from sunpy.timeseries import TimeSeries
em = calculate_temperature_em(ts)

However, it seems there are a few bugs in calculate_temperature_em. These are summarized in this issue: https://github.com/sunpy/sunkit-instruments/issues/49. One seems to be related to missing metadata in the netCDF file (a potential fix is included in the issue linked above). However, there seems be another underlying issue regarding the lookup tables for the GOES-16 ratio that I do not quite understand at the moment. A first step would probably be to check the downloaded temperature and emission measure files to see what keys they contain and understand why the ratio key is not being parsed correctly.

Best,

Will

Divya Maria

unread,
May 20, 2021, 3:02:37 AM5/20/21
to su...@googlegroups.com
Okay. Thank you so much!

--
You received this message because you are subscribed to a topic in the Google Groups "SunPy" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sunpy/tj_KS5cD5s4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sunpy+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sunpy/94a863df-4c73-4f6b-b254-a14768ad78c7n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages