From indiajoe at gmail.com Mon Sep 1 14:24:40 2014 From: indiajoe at gmail.com (Joe Philip Ninan) Date: Mon, 1 Sep 2014 23:54:40 +0530 Subject: [AstroPy] how to flatten an optical spectrum of a star In-Reply-To: References: Message-ID: Hi Hang, I am not sure, i understand exactly what you mean by flattened spectrum. Are you talking about Continuum Normalised Spectrum? If so, you can do it in python, by dividing the original spectrum with a smooth curve, which is obtained by fitting the spectrum with a heavily smoothed spline OR low order polynomial. You can use scipy and numpy modules for it. -cheers joe On 1 September 2014 08:39, gonghang.naoc wrote: > Hi all, > Sometimes we can see a star's spectrum is flattened. That is because we > have already known its black body continuum well and a flattened spectrum > can save space, right? > > A naive question is generally how to make that kind of spectrum? Every > point is divided by its neighbours? values? > Is there any ready made python module to do that? > > Thank you. > hang > > _______________________________________________ > AstroPy mailing list > AstroPy at scipy.org > http://mail.scipy.org/mailman/listinfo/astropy > > -- /--------------------------------------------------------------- "GNU/Linux: because a PC is a terrible thing to waste" - GNU Generation ************************************************ Joe Philip Ninan Research Scholar /________________\ DAA, | Vadakeparambil | TIFR, | Pullad P.O. | Mumbai-05, India. | Kerala, India | Ph: +917738438212 | PIN:689548 | ------------------------------\_______________/-------------- My GnuPG Public Key: https://sites.google.com/site/jpninan/index-html/aboutmehtml/JPN_public.key?attredirects=0&d=1 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ghang.naoc at gmail.com Tue Sep 2 07:45:26 2014 From: ghang.naoc at gmail.com (gonghang.naoc) Date: Tue, 2 Sep 2014 19:45:26 +0800 Subject: [AstroPy] how to flatten an optical spectrum of a star In-Reply-To: References: Message-ID: Thanks, Joe. Now I get it. best hang On Tue, Sep 2, 2014 at 2:24 AM, Joe Philip Ninan wrote: > Hi Hang, > I am not sure, i understand exactly what you mean by flattened spectrum. > Are you talking about Continuum Normalised Spectrum? > > If so, you can do it in python, by dividing the original spectrum with a > smooth curve, which is obtained by fitting the spectrum with a heavily > smoothed spline OR low order polynomial. > You can use scipy and numpy modules for it. > -cheers > joe > > > > On 1 September 2014 08:39, gonghang.naoc wrote: > >> Hi all, >> Sometimes we can see a star's spectrum is flattened. That is because we >> have already known its black body continuum well and a flattened spectrum >> can save space, right? >> >> A naive question is generally how to make that kind of spectrum? Every >> point is divided by its neighbours? values? >> Is there any ready made python module to do that? >> >> Thank you. >> hang >> >> _______________________________________________ >> AstroPy mailing list >> AstroPy at scipy.org >> http://mail.scipy.org/mailman/listinfo/astropy >> >> > > > -- > /--------------------------------------------------------------- > "GNU/Linux: because a PC is a terrible thing to waste" - GNU Generation > > ************************************************ > Joe Philip Ninan > Research Scholar /________________\ > DAA, | Vadakeparambil | > TIFR, | Pullad P.O. | > Mumbai-05, India. | Kerala, India | > Ph: +917738438212 | PIN:689548 | > ------------------------------\_______________/-------------- > My GnuPG Public Key: > https://sites.google.com/site/jpninan/index-html/aboutmehtml/JPN_public.key?attredirects=0&d=1 > > _______________________________________________ > AstroPy mailing list > AstroPy at scipy.org > http://mail.scipy.org/mailman/listinfo/astropy > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From p3y1i4n at gmail.com Tue Sep 2 09:40:16 2014 From: p3y1i4n at gmail.com (Pey Lian Lim) Date: Tue, 2 Sep 2014 09:40:16 -0400 Subject: [AstroPy] how to flatten an optical spectrum of a star Message-ID: Hi Hang, You can probably do it with pysynphot (which is currently not a part of astropy). It is currently distributed with http://www.stsci.edu/institute/software_hardware/pyraf/stsci_python but there are long-term plans to port it to astropy and use modeling. I tried the following and I could recover the Gaussian emission line by subtracting away the blackbody spectrum that I added at the beginning: >>> import pysynphot as S >>> bb = S.BlackBody(5000) >>> gg = S.GaussianSource(0.03, 4500, 100, fluxunits='photlam') >>> source_with_bg = bb + gg >>> source_no_bg = source_with_bg - bb If you have questions about pysynphot, please contact help[at]stsci.edu . Hope this helps, Pey-Lian From ghang.naoc at gmail.com Thu Sep 4 07:59:06 2014 From: ghang.naoc at gmail.com (gonghang.naoc) Date: Thu, 4 Sep 2014 19:59:06 +0800 Subject: [AstroPy] time conversion between JD and UT Message-ID: Hi all, I am trying astropy.time to do conversion between JD and UT. It is easier to convert UT to JD. It seems JD equals jd1+jd2, right? I do not know why there are two parts since one value is enough. However It is difficult to convert JD to UT? It seems there is no relative manipulation in this package. >>> from astropy.time import Time >>> t = Time('2010-01-01 00:00:00', scale='utc')>>> t.jd1, t.jd2(2455197.5, 0.0) best Thank you. hang -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim.jenness at gmail.com Thu Sep 4 10:54:55 2014 From: tim.jenness at gmail.com (Tim Jenness) Date: Thu, 4 Sep 2014 07:54:55 -0700 Subject: [AstroPy] time conversion between JD and UT In-Reply-To: References: Message-ID: On Thu, Sep 4, 2014 at 4:59 AM, gonghang.naoc wrote: > Hi all, > I am trying astropy.time to do conversion between JD and UT. > It is easier to convert UT to JD. It seems JD equals jd1+jd2, right? I > do not know why there are two parts since one value is enough. > There are two values to allow you use high precision. A single double precision number can not provide you with nanosecond precision as a JD. If you split the JD into two distinct numbers (apportioned in a way that best suits your requirements) you can retain accuracy. -- Tim Jenness -------------- next part -------------- An HTML attachment was scrubbed... URL: From ghang.naoc at gmail.com Thu Sep 4 11:01:44 2014 From: ghang.naoc at gmail.com (gonghang.naoc) Date: Thu, 4 Sep 2014 23:01:44 +0800 Subject: [AstroPy] time conversion between JD and UT In-Reply-To: References: Message-ID: You mean jd2 is very small? It can be as large as,say, 0.3. On Thu, Sep 4, 2014 at 10:54 PM, Tim Jenness wrote: > > > > On Thu, Sep 4, 2014 at 4:59 AM, gonghang.naoc > wrote: > >> Hi all, >> I am trying astropy.time to do conversion between JD and UT. >> It is easier to convert UT to JD. It seems JD equals jd1+jd2, right? I >> do not know why there are two parts since one value is enough. >> > > There are two values to allow you use high precision. A single double > precision number can not provide you with nanosecond precision as a JD. If > you split the JD into two distinct numbers (apportioned in a way that best > suits your requirements) you can retain accuracy. > > -- > Tim Jenness > > > _______________________________________________ > AstroPy mailing list > AstroPy at scipy.org > http://mail.scipy.org/mailman/listinfo/astropy > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aldcroft at head.cfa.harvard.edu Thu Sep 4 11:08:24 2014 From: aldcroft at head.cfa.harvard.edu (Aldcroft, Thomas) Date: Thu, 4 Sep 2014 11:08:24 -0400 Subject: [AstroPy] time conversion between JD and UT In-Reply-To: References: Message-ID: On Thu, Sep 4, 2014 at 7:59 AM, gonghang.naoc wrote: > Hi all, > I am trying astropy.time to do conversion between JD and UT. > It is easier to convert UT to JD. It seems JD equals jd1+jd2, right? I > do not know why there are two parts since one value is enough. > However It is difficult to convert JD to UT? It seems there is no relative > manipulation in this package. > > >>> from astropy.time import Time > >>> t = Time('2010-01-01 00:00:00', scale='utc')>>> t.jd1, t.jd2(2455197.5, 0.0) > > Hi Hang, This is probably what you want: >>> from astropy.time import Time >>> t = Time('2010-01-01 00:00:00', scale='utc') >>> t