Skip to content

AstraCarta

Joseph Postma edited this page Feb 3, 2023 · 11 revisions

Overview

Provides query access to the Gaia Data Release 3 Archive (GaiaDR3), for downloading catalogue regions given an RA, DEC, and field scale and size, etc. Used by WCSAutoSolver.

Usage Example

Code

FITSImage fimg = new FITSImage("C:\\Users\\Joseph E Postma\\Desktop\\median tonny\\MU Cam_513515_West_Clear_60s_-40d.fit", null, true, true, true, true);

//you have to know if your RA & DEC keywords are in degree.degree format, or sexagesimal.
//AstraCarta needs degree.degree, these images are sexagesimal
string sra = fimg.Header.GetKeyValue("RA");
string sdec = fimg.Header.GetKeyValue("DEC");
WorldCoordinateSolution.SexagesimalElementsToDegreeElements(sra, sdec, "", out double dra, out double ddec);

//populate the optional arguments for AstraCarta query
ArrayList args = new ArrayList();
keys.Add("-fitsout");//need a fits binary table for WCS solver
keys.Add("-overwrite");//overwrite existing files instead of appending
eys.Add(“-buffer”);//just for demo
keys.Add(2);//enlarge the query region by 2 arcminutes around the nominal image field

string fullcataloguepath = AstraCarta.Query(dra, ddec, 1.8, fimg.Width, fimg.Height, keys);//calls GaiaDR3 online
//keys is optional and can be left out entirely if no options needed

MessageBox.Show(fullcataloguepath);

User Interface

JPFITS.AstraCarta ac = new AstraCarta();
ac.CloseOnComplete = true;
if (ac.ShowDialog() == DialogResult.Cancel)//manually fill entries on the form to get what you want
return;
MessageBox.Show(ac.Result_Filename);

Constructors

JPFITS.AstraCarta();//usually used for showing the dialog form

Construct AstraCarta with some mandatory and optional values. Useful for repeating/specifying user interface option settings.

JPFITS.AstraCarta(double ra, double dec, double scale, int pixwidth, int pixheight, ArrayList? optArgs = null)
ra The right acension of the field center.
dec The declination of the field center.
scale The plate scale in arcseconds per pixel.
pixwidth The number of horizontal pixels of the image.
pixheight The number of vertical pixels of the image
optArgs Optional arguments list. Possible arguments can be found here: https://github.com/user29A/AstraCarta/wiki, or with AstraCarta.Help() call.
Be sure to pass the switch "-argument"; for example do not pass "buffer", but pass "-buffer", etc.
Arguments and their values should be consecutive, for example:
optArgs.Add("-buffer);
optArgs.Add(2);
and so on.
Boolean arguments do not require a value, and their presence indicates true. For example the presence of
optArgs.Add("-fitsout");
equates to true for writing the file as a FITS bintable.

Properties

public string Result_Filename

public bool ExecuteOnShow

public bool CloseOnComplete

Static Methods

Perform a query with no user interface dialog form. Will throw an informative exception if something goes wrong. Returns a string which is the filename of the catalogue data downloaded. If nothing was found the string will be empty.
public static string Query(double ra, double dec, double scale, int pixwidth, int pixheight, ArrayList? optArgs = null)
ra The right acension of the field center.
dec The declination of the field center.
scale The plate scale in arcseconds per pixel.
pixwidth The number of horizontal pixels of the image.
pixheight The number of vertical pixels of the image
optArgs Optional arguments list. Possible arguments can be found here: https://github.com/user29A/AstraCarta/wiki, or with AstraCarta.Help() call.
Be sure to pass the switch "-argument"; for example do not pass "buffer", but pass "-buffer", etc.
Arguments and their values should be consecutive, for example:
optArgs.Add("-buffer);
optArgs.Add(2);
and so on.
Boolean arguments do not require a value, and their presence indicates true. For example the presence of
optArgs.Add("-fitsout");
equates to true for writing the file as a FITS bintable.

Clone this wiki locally