Bi-monthly release with minor bug fixes and improvements
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
GSCDAT=/usr/share/GSC
GSCBIN=/usr/share/GSC/bin
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
indiserver -v indi_simulator_ccd indi_simulator_telescope
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
gsc -c 12 34 -5 6 -r 3
0495401224 188.49149 -05.14840 0.4 15.17 0.40 0 0 02O2 F; 2.95 190
0495400366 188.52469 -05.11609 0.4 12.34 0.40 0 0 02O2 T; 1.76 123
0495400366 188.52466 -05.11606 0.3 12.86 0.40 0 0 024P T; 1.76 123
Please Log in or Create an account to join the conversation.
GSCDAT=/usr/share/GSC
GSCBIN=/usr/share/GSC/bin
Please Log in or Create an account to join the conversation.
/* ------ Find out the required path variables --------------------------*/
GSCDAT = getenv("GSCDAT") ;
if ((!GSCDAT)
&& (strcmp(argv[0]+strlen(argv[0])-12, "/usr/bin/gsc") == 0)) {
/* When path terminated by .../bin/gsc.exe, use path */
GSCDAT = strdup(argv[0]) ;
GSCDAT[strlen(argv[0])-12] = 0 ;
}
if (!GSCDAT) GSCDAT = "/usr/share/GSC" ;
/* Export the variable for the subroutines */
ptr = malloc(strlen(GSCDAT)+8) ;
strcpy(ptr, "GSCDAT=") ; strcat(ptr, GSCDAT) ;
putenv(ptr) ;
/* Get the GSCBIN environment variable */
GSCBIN = getenv("GSCBIN");
if (! GSCBIN) {
strcpy(path, GSCDAT);
strcat(path, "/bin");
GSCBIN = strdup(path);
}
Please Log in or Create an account to join the conversation.
if (ftype==CCDChip::LIGHT_FRAME)
{
//sprintf(gsccmd,"gsc -c %8.6f %+8.6f -r 120 -m 0 9.1",rad+PEOffset,decPE);
sprintf(gsccmd,"gsc -c %8.6f %+8.6f -r %4.1f -m 0 %4.2f -n 3000",rad+PEOffset,cameradec,radius,lookuplimit);
//fprintf(stderr,"gsccmd %s\n",gsccmd);
// Start fix part 1
//replace ',' with '.'
for(int x=0; x<=250; x++) {
if (gsccmd[x] == ',') {
gsccmd[x] = '.';
}
}
// End of fix
pp=popen(gsccmd,"r");
if(pp != NULL) {
char line[256];
while(fgets(line,256,pp)!=NULL)
{
//fprintf(stderr,"%s",line);
// ok, lets parse this line for specifcs we want
char id[20];
char plate[6];
char ob[6];
float mag;
float mage;
float ra;
float dec;
float pose;
int band;
float dist;
int dir;
int c;
int rc;
//Start fix part 2
//replace '.' with ','
for(int x=0; x<=250; x++) {
if (line[x] == '.') {
line[x] = ',';
}
}
//End fix
rc=sscanf(line,"%10s %f %f %f %f %f %d %d %4s %2s %f %d",
id,&ra,&dec,&pose,&mag,&mage,&band,&c,plate,ob,&dist,&dir);
//fprintf(stderr,"Parsed %d items\n",rc);
if(rc==12) {
lines++;
//if(c==0) {
stars++;
//fprintf(stderr,"%s %8.4f %8.4f %5.2f %5.2f %d\n",id,ra,dec,mag,dist,dir);
// Convert the ra/dec to standard co-ordinates
double sx; // standard co-ords
double sy; //
double srar; // star ra in radians
double sdecr; // star dec in radians;
double ccdx;
double ccdy;
//fprintf(stderr,"line %s",line);
//fprintf(stderr,"parsed %6.5f %6.5f\n",ra,dec);
srar=ra*0.0174532925;
sdecr=dec*0.0174532925;
// Handbook of astronomical image processing
// page 253
// equations 9.1 and 9.2
// convert ra/dec to standard co-ordinates
sx=cos(decr)*sin(srar-rar)/( cos(decr)*cos(sdecr)*cos(srar-rar)+sin(decr)*sin(sdecr) );
sy=(sin(decr)*cos(sdecr)*cos(srar-rar)-cos(decr)*sin(sdecr))/( cos(decr)*cos(sdecr)*cos(srar-rar)+sin(decr)*sin(sdecr) );
// now convert to microns
ccdx=pa*sx+pb*sy+pc;
ccdy=pd*sx+pe*sy+pf;
rc=DrawImageStar(targetChip, mag,ccdx,ccdy);
drawn+=rc;
if(rc==1)
{
//fprintf(stderr,"star %s scope %6.4f %6.4f star %6.4f %6.4f ccd %6.2f %6.2f\n",id,rad,decPE,ra,dec,ccdx,ccdy);
//fprintf(stderr,"star %s ccd %6.2f %6.2f\n",id,ccdx,ccdy);
}
}
}
pclose(pp);
} else
{
IDMessage(getDeviceName(),"Error looking up stars, is gsc installed with appropriate environment variables set ??");
//fprintf(stderr,"Error doing gsc lookup\n");
}
if(drawn==0)
{
IDMessage(getDeviceName(),"Got no stars, is gsc installed with appropriate environment variables set ??");
}
}
Please Log in or Create an account to join the conversation.