PixInsight Forum
PixInsight => Tutorials and Processing Examples => Topic started by: mcgillca on 2015 January 06 07:40:57

Hi  not sure where to post this, but I had some fun this morning creating a HR diagram for M67.
Had some fun constructing the HerzsprungRussell diagram. Also loaded the HR diagram from Johnson and Sandage (1955)  Ap.J. 121, pp 616627, for comparison.
To do this, I used the FWHMEccentricity tool on each of the master R, G and B images and exported CSV files for each. These contain the parameters for a Moffat fit to each star: x and y location, X size, Y size, rotation angle, amplitude and background.
I found the definition of a Moffat function in the PixInsight documentation (the Dynamic PSF tool), then used Wolfram Alpha to integrate the expression over X and Y to get the total flux from the star For Beta = 4, the standard fit, turns out its A * (Sigma X * Sigma Y) * Pi/3.
I then created an index for each star based on its location: i+NX * j to allow me to match up stars from each filter.
Finally, I used ImageSolver to get the exact coordinates of the frames and AnnotateImage to label the Tycho stars in the image. I found one that wasn't saturated and looked up its magnitudes in Vizier. These were used to calibrate the magnitudes.
From there, I just used Excel to plot the data.
Not sure its science (the original paper is 60 years old), but interesting to see that we can now go 3 magnitudes deeper with an 8" RC and a CCD than Sandage could go with an 82" scope and a photoelectric detector.
Colin

Simply GREAT!
It can be an Idea for a script or module in the next version of PI ;)

Colin, that is great.
It would be nice if you can post a tutorial on that technique.

Thank you both.
Zocky  not sure I can say much more than I've said already. The PI part is easy  simply apply the FWHMEstimator script to R, G, B (aligned) master frames separately and export as CSV files.
The rest is manipulation in Excel.
Steps I took:
1) Combined each of the frames into one file  one tab, per filter.
2) Created a "Flux column" for each filter equal to A * Sigma_X * Sigma_Y*PI()/3. A, Sigma_X and Sigma_Y are the amplitude and star sizes from the Moffat4 fit.
3) Created an index column for each star equal to INT(xstar+0.5)+INT(ystar+0.5)*NX. The INT(xstar+0.5) calculates the nearest integer. Multiplying the y coord by NX and adding the x coord creates a unique index for each pixel on the chip and allows you to then cross reference star locations between filters.
4) Choose the filter with the most stars. Use VLOOKUP to find the flux for the other filters using the index column  you need to place the index column on the left to make this work  see the documentation for VLOOKUP. Use FALSE as the final argument to ensure that only exact matches are reported. Don't worry about the N/A values where there is no match.
5) Find a named star using your favourite technique (I used the Annotate script, but there are other ways e.g. Aladin). Use Vizier or similar to look up its magnitudes.
6) Find the star in your tables. Calculate the magnitude =  2.5 * LOG10(Flux). Calculate the offset needed to match the Vizier magnitude. Say you calculate  0.3 and the magnitude is 12.4, then you need to add 12.7 to the magnitudes. Calculate for both G and B. G is the closest filter for the old V band, so use that as V.
7) Now you can calculate the apparent magnitudes  simply calculate 2.5*LOG10(Flux)+Offet for each start for the Blue and Green filters.
8) Now you can calculate the colour of the star by working out BV.
9) FInally, create a scatter plot of V vs BV, with BV as the XAxis. You'll need to play about with the axis definitions to reverse the Y axis (highest values at top), and to set the range for the data. The plot will ignore the N/A data.
I've posted a slightly cut down version of my spreadsheet below (removed some stars to get below 500kb).
I haven't written a script before, but if someone who has written a script is interested, I'm happy to work with them to automate this as much as possible!
Colin

Great!! sounds like science to me! ;)

Hi Colin,
Good work. But this would be way easier with the AperturePhotometry script.
Regards,
Vicent.

Thnx Colin.
Can you try the script which Vicent suggested, and compare it with your results?

Colin,
That's the "cut down version"!?? :o
Fascinating stuff!
Best,
Jim

This is a really neat thread!
First, Colin, great job making that HR diagram. That's totally neat! It brings back a lot of memories, since I made an M67 HR diagram when I was working on my Swinburne degree.
(I didn't have my own images, though. I was an even less advanced imager than I am now, if that's possible. :tongue: I used some images that had been shot at McDonald Observatory in Texas. Hmm, how I did I automate the photometry?... IIRC, I think I used some nonPI software and some star coordinates from a recent paper whose authors had done highprecision astrometry on M67.)
I've been wishing I had the time to try and use the PI photometry script to redo this project, just for fun. It would be big fun to do it in PI!
(Plus, if I could simplify the whole affair as much as possible, maybe I could use something like this as a lab exercise in my astronomy lab class. That would be fun, to get students making HR diagrams from images. Might give me ammunition to try and find the money to purchase PI for the lab computers, hmm..)
Thanks for reminding me of this dream, good job on your diagram, and thanks to Vicent for reminding us of the PI photometry script.
 Marek

Thanks for all your comments.
Vicent  I didn't know about your script. I had a play last night  does a great job of pulling out the named stars down to a magnitude of 15. Given the names, its a lot easier to cross reference between filters, but obviously, leaves out the fainter stars that have not been named.
This would be a great way to calibrate the masters before extracting the remaining stars and plotting the diagram.
I will see if I can do this more systematically when I next have time (back at work now, so likely to be be next week).
Marek  I think this would be a fantastic exercise for students. You could also combine it with working out atmospheric extinction values if you had subs at different altitudes.
Colin

Hi Colin,
You can select a deeper catalog, like the PPMXL, I think it reaches 20 mag. Two additional options:
 Under the "Images" tab, select the "Local files" option and then select the three master images corresponding to each filter from your hard drive.
 Under the "Output" tab, select the "Generate flux tables" option. This will generate a single table that contains in each row the flux for a given star in all the image series. You can generate the HR diagram directly from here.
One advice. Be sure the astrometric solution is very good for you image. You can check this by executing the AnnotateImage script and selecting a star catalog to draw crosses over each star. If the astrometry is good, all the crosses will be centered on the stars. This is important because AperturePhotometry locates the stars based on the astrometry solution, and tries to find the nearest star according to the position given by the catalog.
Best regards,
Vicent.

Thanks, Vicent  I'll give that a try!
Colin

*Please* post how it goes  I'd very much like to turn your great idea into a lab for my students!

Ditto to what Josh just said.
(That's a USA English expression for "I'm thinking the same thing Josh is".)
 Marek

Hi  it works well.
The only downside is that you can only choose 1 filter to get magnitude data for, so to get both filters calibrated, you need to do this twice. I've been looking at the scripts and wondering how best to modify them. I suspect this will take some time!
Colin