Convert MJD date range to number of days elapsed in IDL [message #93661] |
Sun, 25 September 2016 12:53  |
cdav1601
Messages: 1 Registered: September 2016
|
Junior Member |
|
|
I'm trying to figure out if there's some way I can take a range of MJD values and convert them into number of days elapsed over that range so I can normalize a plot of two supernova and their absolute magnitudes over time in IDL. Is there a simple conversion for this I'm not seeing or do I need to tediously convert every value to determine the number of days to use for my x-axis?
Note: I do not wish to convert to the date, but the actually number of days elapsed as to normalize my two plots for comparison.
Thanks!
|
|
|
Re: Convert MJD date range to number of days elapsed in IDL [message #93662 is a reply to message #93661] |
Mon, 26 September 2016 06:46   |
wlandsman
Messages: 743 Registered: June 2000
|
Senior Member |
|
|
If you have a vector of modified Julian dates, MJD, and want to convert them to elapsed time from a scalar reference time, MJD0, then just subtract
IDL> TElapse = MJD - MJD0
I suspect that you actually asking for something else but, if so, you will have to clarify your question. --Wayne
On Sunday, September 25, 2016 at 3:53:03 PM UTC-4, cdav...@terpmail.umd.edu wrote:
> I'm trying to figure out if there's some way I can take a range of MJD values and convert them into number of days elapsed over that range so I can normalize a plot of two supernova and their absolute magnitudes over time in IDL. Is there a simple conversion for this I'm not seeing or do I need to tediously convert every value to determine the number of days to use for my x-axis?
>
> Note: I do not wish to convert to the date, but the actually number of days elapsed as to normalize my two plots for comparison.
>
> Thanks!
|
|
|
Re: Convert MJD date range to number of days elapsed in IDL [message #93663 is a reply to message #93661] |
Mon, 26 September 2016 06:54  |
Markus Schmassmann
Messages: 129 Registered: April 2016
|
Senior Member |
|
|
On 09/25/2016 09:53 PM, cdav1601@terpmail.umd.edu wrote:
> I'm trying to figure out if there's some way I can take a range of
> MJD values and convert them into number of days elapsed over that
> range so I can normalize a plot of two supernova and their absolute
> magnitudes over time in IDL. Is there a simple conversion for this
> I'm not seeing or do I need to tediously convert every value to
> determine the number of days to use for my x-axis?
>
> Note: I do not wish to convert to the date, but the actually number
> of days elapsed as to normalize my two plots for comparison.
jd=julday(month,day,year)
days_elapsed=jd-jd[0]
month, day & year are arrays
|
|
|