comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Convert MJD date range to number of days elapsed in IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Convert MJD date range to number of days elapsed in IDL [message #93661] Sun, 25 September 2016 12:53 Go to next message
cdav1601 is currently offline  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 Go to previous messageGo to next message
wlandsman is currently offline  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 Go to previous message
Markus Schmassmann is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Plotting a horizontal line over a cgImage
Next Topic: something faster than file_search ?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:30:19 PDT 2025

Total time taken to generate the page: 0.00471 seconds