Image_display2

Hi,

I am using the image_display2() macro to plot some fits data. I would like to put some markers in the plot. Does somebody know how to do it ?
Cheers,

Sabrina

Hi Sabrina,

Could you be more precise? where did you get this image_display2() macro?
In general, to add markers on a plot, you can do something like this:

TMarker *m = new TMarker(x, y, type); m->SetMarkerSize(1.5); m->SetMarkerColor(kBlue); m->Draw();
Cheers,
Bertrand.

Hi Bertrand,

thanks for your reply. I took this macro from AstroROOT homepage. I will try with your suggestion. Thanks a lot,

Sabrina

[quote=“bellenot”]Hi Sabrina,

Could you be more precise? where did you get this image_display2() macro?
In general, to add markers on a plot, you can do something like this:

TMarker *m = new TMarker(x, y, type); m->SetMarkerSize(1.5); m->SetMarkerColor(kBlue); m->Draw();
Cheers,
Bertrand.[/quote]

Sorry for being so unprecise. The macro image_display2() reads a fits file and displays it as an image. This is the complete macro:

image_display2()
{
// read an FITS image, modify it slightly and display the
// result.

// The image we want to display is the extension SPI.-SKY.-IMA
// in the image.fits file.
TFFloatImg * img = TFReadImage(“image.fits”, “SPI.-SKY.-IMA”);
if (img == NULL)
{
TFError::PrintErrors();
return;
}

// get the size of image. We know it has two dimensions
UInt_t size[2];
img->GetSize(size);

// cut all values above 8
for (UInt_t x = 0; x < size[1]; x++)
for (UInt_t y = 0; y < size[0]; y++)
if ( (Float_t)((*img)[y][x]) > 8.0)
(*img)[y][x] = 8.0;

// open a window and open the status bar to display the
// coordinates and value of the image pixel at the mouse position
TCanvas * win = new TCanvas(“image”, “SPI”, 100, 100, 550, 524);
win->ToggleEventStatus();

// create the image display for the just read and slightly
// modified image
AstroImage * disp = new AstroImage(img);

// we don’t need the image any more
delete img;

// draw the image
disp->Draw();
}

Sabrina

quote=“bellenot”]Hi Sabrina,

Could you be more precise? where did you get this image_display2() macro?
In general, to add markers on a plot, you can do something like this:

TMarker *m = new TMarker(x, y, type); m->SetMarkerSize(1.5); m->SetMarkerColor(kBlue); m->Draw();
Cheers,
Bertrand.[/quote]

Hi Sabrina,

Thanks for the clarification. I found the macro on Astro-ROOT web page.
Did you manage to put some markers?

Cheers, Bertrand.

Hello Bertrand,

thanks for your help. I managed to put the markers.
Cheers,

Sabrina

[quote=“bellenot”]Hi Sabrina,

Thanks for the clarification. I found the macro on Astro-ROOT web page.
Did you manage to put some markers?

Cheers, Bertrand.[/quote]