11 NNGC=7840, /* number of NGC numbers [1..NNGC] */
12 NIC = 5386, /* number of IC numbers */
13 NNGCrec=NNGC+NIC, /* number of records in the NGC catalog (including IC's, starting at NNGC */
14 NMrec=122, /* number of M records */
15 NM=110, /* number of M numbers */
16 NAbell=2712, /* number of records in the Abell catalog */
17 NName=1000, /* number of prose names; estimated maximum (read from editable text file) */
18 NBayer=1517, /* number of bayer entries */
19 NSAO=258998, /* number of SAO stars */
20 MAXcon=1932, /* maximum number of patches in a constellation */
21 Ncon=88, /* number of constellations */
22 Npatch=92053, /* highest patch number */
25 char ngctype[NNGCrec];
26 Mindexrec mindex[NMrec];
28 Bayerec bayer[NBayer];
30 ushort conindex[Ncon+1];
31 long patchaddr[Npatch+1];
58 main(int argc, char *argv[])
63 Binit(&bin, 0, OREAD);
64 Binit(&bout, 1, OWRITE);
68 while(line = Brdline(&bin, '\n')){
69 line[Blinelen(&bin)-1] = 0;
74 closedisplay(display);
75 /* automatic refresh of rio window is triggered by mouse */
76 /* close(open("/dev/mouse", OREAD)); */
94 rec = realloc(rec, nreca*sizeof(Record));
96 fprint(2, "scat: realloc fails\n");
108 orec = realloc(orec, nreca*sizeof(Record));
110 fprint(2, "scat: realloc fails\n");
114 memmove(orec, rec, nrec*sizeof(Record));
124 sprint(buf, "%s/%s.scat", dir, s);
127 fprint(2, "scat: can't open %s\n", buf);
135 Eread(int f, char *name, void *addr, long n)
137 if(read(f, addr, n) != n){ /* BUG! */
138 fprint(2, "scat: read error on %s\n", name);
146 while(*s!=0 && (*s==' ' || *s=='\t'))
152 skipstr(char *s, char *t)
159 /* produce little-endian long at address l */
166 return (long)p[0]|((long)p[1]<<8)|((long)p[2]<<16)|((long)p[3]<<24);
169 /* produce little-endian long at address l */
176 return p[0]|(p[1]<<8);
187 namedb = eopen("name");
188 Binit(&b, namedb, OREAD);
189 for(i=0; i<NName; i++){
190 l = Brdline(&b, '\n');
196 Bprint(&bout, "warning: name.scat bad format; line %d\n", i+1);
200 strcpy(name[i].name, l);
201 if(strncmp(p, "ngc", 3) == 0)
202 name[i].ngc = atoi(p+3);
203 else if(strncmp(p, "ic", 2) == 0)
204 name[i].ngc = atoi(p+2)+NNGC;
205 else if(strncmp(p, "sao", 3) == 0)
206 name[i].sao = atoi(p+3);
207 else if(strncmp(p, "abell", 5) == 0)
208 name[i].abell = atoi(p+5);
213 Bprint(&bout, "warning: too many names in name.scat (max %d); extra ignored\n", NName);
216 bayerdb = eopen("bayer");
217 Eread(bayerdb, "bayer", bayer, sizeof bayer);
219 for(i=0; i<NBayer; i++)
220 bayer[i].sao = Long(&bayer[i].sao);
229 saodb = eopen("sao");
238 ngcdb = eopen("ngc2000");
239 ngctypedb = eopen("ngc2000type");
240 Eread(ngctypedb, "ngctype", ngctype, sizeof ngctype);
248 /* nothing extra to do with abell: it's directly indexed by number */
250 abelldb = eopen("abell");
261 patchdb = eopen("patch");
262 sprint(buf, "%s/patchindex.scat", dir);
263 b = Bopen(buf, OREAD);
265 fprint(2, "can't open %s\n", buf);
268 for(m=0,l=0; l<=Npatch; l++)
269 patchaddr[l] = m += Bgetc(b)*4;
280 mindexdb = eopen("mindex");
281 Eread(mindexdb, "mindex", mindex, sizeof mindex);
283 for(i=0; i<NMrec; i++)
284 mindex[i].ngc = Short(&mindex[i].ngc);
294 condb = eopen("con");
295 conindexdb = eopen("conindex");
296 Eread(conindexdb, "conindex", conindex, sizeof conindex);
298 for(i=0; i<Ncon+1; i++)
299 conindex[i] = Short((short*)&conindex[i]);
307 if('A'<=*s && *s<='Z')
318 j = (index-1)*sizeof(NGCrec);
323 /* special case: NGC data may not be available */
324 if(read(ngcdb, &cur->u.ngc, sizeof(NGCrec)) != sizeof(NGCrec)){
326 fprint(2, "scat: NGC database not available\n");
337 cur->u.ngc.ngc = Short(&cur->u.ngc.ngc);
338 cur->u.ngc.ra = Long(&cur->u.ngc.ra);
339 cur->u.ngc.dec = Long(&cur->u.ngc.dec);
340 cur->u.ngc.diam = Long(&cur->u.ngc.diam);
341 cur->u.ngc.mag = Short(&cur->u.ngc.mag);
346 loadabell(long index)
355 seek(abelldb, j*sizeof(Abellrec), 0);
356 Eread(abelldb, "abell", &cur->u.abell, sizeof(Abellrec));
357 cur->u.abell.abell = Short(&cur->u.abell.abell);
358 if(cur->u.abell.abell != index){
359 fprint(2, "bad format in abell catalog\n");
362 cur->u.abell.ra = Long(&cur->u.abell.ra);
363 cur->u.abell.dec = Long(&cur->u.abell.dec);
364 cur->u.abell.glat = Long(&cur->u.abell.glat);
365 cur->u.abell.glong = Long(&cur->u.abell.glong);
366 cur->u.abell.rad = Long(&cur->u.abell.rad);
367 cur->u.abell.mag10 = Short(&cur->u.abell.mag10);
368 cur->u.abell.pop = Short(&cur->u.abell.pop);
369 cur->u.abell.dist = Short(&cur->u.abell.dist);
376 if(index<=0 || index>NSAO)
382 seek(saodb, (index-1)*sizeof(SAOrec), 0);
383 Eread(saodb, "sao", &cur->u.sao, sizeof(SAOrec));
384 cur->u.sao.ra = Long(&cur->u.sao.ra);
385 cur->u.sao.dec = Long(&cur->u.sao.dec);
386 cur->u.sao.dra = Long(&cur->u.sao.dra);
387 cur->u.sao.ddec = Long(&cur->u.sao.ddec);
388 cur->u.sao.mag = Short(&cur->u.sao.mag);
389 cur->u.sao.mpg = Short(&cur->u.sao.mpg);
390 cur->u.sao.hd = Long(&cur->u.sao.hd);
395 loadplanet(int index, Record *r)
397 if(index<0 || index>NPlanet || planet[index].name[0]=='\0')
402 /* check whether to take new or existing record */
404 memmove(&cur->u.planet, &planet[index], sizeof(Planetrec));
406 memmove(&cur->u.planet, &r->u.planet, sizeof(Planetrec));
411 loadpatch(long index)
416 if(index<=0 || index>Npatch)
421 seek(patchdb, patchaddr[index-1], 0);
422 cur->u.patch.nkey = (patchaddr[index]-patchaddr[index-1])/4;
423 Eread(patchdb, "patch", cur->u.patch.key, cur->u.patch.nkey*4);
424 for(i=0; i<cur->u.patch.nkey; i++)
425 cur->u.patch.key[i] = Long(&cur->u.patch.key[i]);
435 for(i=0; i<NNGCrec; i++)
436 if(t == (ngctype[i])){
455 for(i=0,or=orec; i<norec; i++,or++){
458 fprint(2, "bad type %d in flatten\n", or->type);
469 memmove(cur, or, sizeof(Record));
473 if(loadngc(or->index))
483 if(loadngc(or->index))
488 loadabell(or->index);
493 loadpatch(or->index);
498 for(j=1; j<or->u.patch.nkey; j++){
499 key = or->u.patch.key[j];
500 if((key&0x3F) == SAO)
501 loadsao((key>>8)&0xFFFFFF);
502 else if((key&0x3F) == Abell)
503 loadabell((key>>8)&0xFFFFFF);
505 loadngc((key>>16)&0xFFFF);
519 for(i=0; i<NMrec; i++)
520 if(mindex[i].ngc == index)
526 alpha(char *s, char *t)
531 if(strncmp(s, t, n)==0 && (s[n]<'a' || 'z'<s[n]))
538 text(char *s, char *t)
543 if(strncmp(s, t, n)==0 && (s[n]==0 || s[n]==' ' || s[n]=='\t'))
550 cull(char *s, int keep, int dobbox)
552 int i, j, nobj, keepthis;
555 int dogrtr, doless, dom, dosao, dongc, doabell;
559 memset(obj, 0, sizeof(obj));
573 mgrtr = 10 * strtod(s+1, &t);
574 if(mgrtr==0 && t==s+1){
575 fprint(2, "bad magnitude\n");
583 mless = 10 * strtod(s+1, &t);
584 if(mless==0 && t==s+1){
585 fprint(2, "bad magnitude\n");
591 if(t = text(s, "m")){
596 if(t = text(s, "sao")){
601 if(t = text(s, "ngc")){
606 if(t = text(s, "abell")){
611 for(i=0; names[i].name; i++)
612 if(t = alpha(s, names[i].name)){
614 fprint(2, "too many object types\n");
617 obj[nobj++] = names[i].type;
625 fprint(2, "syntax error in object list\n");
641 for(i=0,or=orec; i<norec; i++,or++){
643 if(dobbox && inbbox(or->u.ngc.ra, or->u.ngc.dec))
645 if(doless && or->u.ngc.mag <= mless)
647 if(dogrtr && or->u.ngc.mag >= mgrtr)
649 if(dom && (or->type==NGC && ism(or->u.ngc.ngc)))
651 if(dongc && or->type==NGC)
653 if(doabell && or->type==Abell)
655 if(dosao && or->type==SAO)
657 for(j=0; j<nobj; j++)
658 if(or->type==NGC && or->u.ngc.type==obj[j])
662 memmove(cur, or, sizeof(Record));
669 compar(const void *va, const void *vb)
671 Record *a=(Record*)va, *b=(Record*)vb;
673 if(a->type == b->type)
674 return a->index - b->index;
675 return a->type - b->type;
686 qsort(rec, nrec, sizeof(Record), compar);
689 for(i=1; i<nrec; i++,r++){
690 /* may have multiple instances of a planet in the scene */
691 if(r->type==s->type && r->index==s->index && r->type!=Planet)
693 memmove(++s, r, sizeof(Record));
709 for(i=1; i<=24; i++){
710 n = strlen(greek[i]);
711 if(strncmp(s, greek[i], n)==0 && (s[n]==' ' || s[n]=='\t')){
713 t += runetochar(t, &greeklet[i]);
717 n = chartorune(&r, s);
735 n = chartorune(&r, s);
736 for(i=1; i<=24; i++){
737 if(r == greeklet[i]){
739 t += strlen(greek[i]);
762 long dec, ra, ndec, nra;
769 for(i=0,or=orec; i<norec; i++,or++){
770 if(or->type == Planet) /* must keep it here */
771 loadplanet(or->index, or);
772 dec = or->u.ngc.dec/MILLIARCSEC;
773 ra = or->u.ngc.ra/MILLIARCSEC;
774 rdeg = deg/cos((dec*PI)/180);
775 for(y=-deg; y<=+deg; y++){
777 if(ndec/2>=90 || ndec/2<=-90)
779 /* fp errors hurt here, so we round 1' to the pole */
781 ndec = ndec*500*60*60 + 60000;
783 ndec = ndec*500*60*60 - 60000;
784 for(x=-rdeg; x<=+rdeg; x++){
790 /* fp errors hurt here, so we round up 1' */
791 nra = nra/2*MILLIARCSEC + 60000;
792 loadpatch(patcha(angle(nra), angle(ndec)));
802 * New version attempts to match the boundaries of the plot better.
814 circle = 360*MILLIARCSEC;
821 factor = cos(angle((decmax+decmin)/2));
824 factor = floor(1/factor);
826 bbox(factor*deg, deg, 1);
827 Bprint(&bout, "%s to ", hms(angle(ramin)));
828 Bprint(&bout, "%s\n", hms(angle(ramax)));
829 Bprint(&bout, "%s to ", dms(angle(decmin)));
830 Bprint(&bout, "%s\n", dms(angle(decmax)));
833 for(i=0,or=orec; i<norec; i++,or++)
834 if(or->type == Planet) /* must keep it here */
835 loadplanet(or->index, or);
839 for(x=min; x<=ramax; x+=250*60*60){
843 for(y=decmin; y<=decmax; y+=250*60*60)
844 if(-circle/4 < y && y < circle/4)
845 loadpatch(patcha(angle(xx), angle(y)));
857 int na, rah, ram, d1, d2;
860 long ramin, ramax, decmin, decmax; /* all in degrees */
863 Angle racenter, deccenter, rasize, decsize, a[4];
872 if(('0'<=*flags && *flags<='9') || *flags=='+' || *flags=='-'){
875 a[na++] = getra(flags);
876 while(*flags && *flags!=' ')
882 Bprint(&bout, "syntax error in plate\n");
907 if(rasize<0.0 || decsize<0.0){
908 Bprint(&bout, "negative sizes\n");
914 /* convert to milliarcsec */
918 Bprint(&bout, "empty\n");
924 decmax = -0x7FFFFFFF;
925 for(r=rec,i=0; i<nrec; i++,r++){
926 if(r->type == Patch){
927 radec(r->index, &rah, &ram, &dec);
929 r0 = c/cos(RAD(dec));
938 }else if(r->type==SAO || r->type==NGC || r->type==Abell){
941 d1 = 0, d2 = 0, r0 = 0;
942 }else if(r->type==NGCN){
945 }else if(r->type==NamedSAO){
948 }else if(r->type==NamedNGC){
951 }else if(r->type==NamedAbell){
970 if(!folded && ramax-ramin>270*c){
974 racenter = angle(ramin+(ramax-ramin)/2);
975 deccenter = angle(decmin+(decmax-decmin)/2);
976 if(rasize<0 || decsize<0){
977 rasize = angle(ramax-ramin)*cos(deccenter);
978 decsize = angle(decmax-decmin);
981 if(DEG(rasize)>1.1 || DEG(decsize)>1.1){
982 Bprint(&bout, "plate too big: %s", ms(rasize));
983 Bprint(&bout, " x %s\n", ms(decsize));
984 Bprint(&bout, "trimming to 30'x30'\n");
988 Bprint(&bout, "%s %s ", hms(racenter), dms(deccenter));
989 Bprint(&bout, "%s", ms(rasize));
990 Bprint(&bout, " x %s\n", ms(decsize));
993 pic = image(racenter, deccenter, rasize, decsize);
996 Bprint(&bout, "plate %s locn %d %d %d %d\n", pic->name, pic->minx, pic->miny, pic->maxx, pic->maxy);
1002 lookup(char *s, int doreset)
1006 char *starts, *inputline=s, *t, *u;
1019 if(t = alpha(s, "flat")){
1021 fprint(2, "flat takes no arguments\n");
1025 fprint(2, "no records\n");
1032 if(t = alpha(s, "print")){
1034 fprint(2, "print takes no arguments\n");
1037 for(i=0,r=rec; i<nrec; i++,r++)
1042 if(t = alpha(s, "add")){
1047 if(t = alpha(s, "sao")){
1048 n = strtoul(t, &u, 10);
1053 fprint(2, "syntax error in sao\n");
1063 if(t = alpha(s, "ngc")){
1064 n = strtoul(t, &u, 10);
1069 fprint(2, "syntax error in ngc\n");
1079 if(t = alpha(s, "ic")){
1080 n = strtoul(t, &u, 10);
1085 fprint(2, "syntax error in ic\n");
1090 if(!loadngc(n+NNGC))
1095 if(t = alpha(s, "abell")){
1096 n = strtoul(t, &u, 10);
1097 if(n<=0 || n>NAbell)
1106 if(t = alpha(s, "m")){
1107 n = strtoul(t, &u, 10);
1111 for(j=n-1; mindex[j].m<n; j++)
1115 while(mindex[j].m == n){
1119 cur->index = mindex[j].ngc;
1126 for(i=1; i<=Ncon; i++)
1127 if(t = alpha(s, constel[i])){
1129 fprint(2, "syntax error in constellation\n");
1133 seek(condb, 4L*conindex[i-1], 0);
1134 j = conindex[i]-conindex[i-1];
1135 Eread(condb, "con", con, 4*j);
1141 cur->index = Long(&con[k]);
1146 if(t = alpha(s, "expand")){
1149 if(*t<'0' && '9'<*t){
1151 fprint(2, "syntax error in expand\n");
1154 n = strtoul(t, &u, 10);
1163 if(t = alpha(s, "plot")){
1165 Bprint(&bout, "empty\n");
1172 if(t = alpha(s, "astro")){
1177 if(t = alpha(s, "plate")){
1182 if(t = alpha(s, "gamma")){
1189 Bprint(&bout, "%.2f\n", gam.gamma);
1193 if(t = alpha(s, "keep")){
1199 if(t = alpha(s, "drop")){
1205 for(i=0; planet[i].name[0]; i++){
1206 if(t = alpha(s, planet[i].name)){
1214 for(i=0; names[i].name; i++){
1215 if(t = alpha(s, names[i].name)){
1217 fprint(2, "syntax error in type\n");
1222 loadtype(names[i].type);
1232 fprint(2, "bad star name\n");
1240 starts = fromgreek(starts);
1241 for(i=0; i<NName; i++)
1242 if(equal(starts, name[i].name)){
1245 rec[j].type = NamedSAO;
1246 rec[j].index = name[i].sao;
1249 rec[j].type = NamedNGC;
1250 rec[j].index = name[i].ngc;
1253 rec[j].type = NamedAbell;
1254 rec[j].index = name[i].abell;
1256 strcpy(rec[j].u.named.name, name[i].name);
1259 if(parsename(starts))
1260 for(i=0; i<NBayer; i++)
1261 if(bayer[i].name[0]==parsed[0] &&
1262 (bayer[i].name[1]==parsed[1] || parsed[1]==0) &&
1263 bayer[i].name[2]==parsed[2]){
1265 rec[j].type = NamedSAO;
1266 rec[j].index = bayer[i].sao;
1267 strncpy(rec[j].u.named.name, starts, sizeof(rec[j].u.named.name));
1276 case '0': case '1': case '2': case '3': case '4':
1277 case '5': case '6': case '7': case '8': case '9':
1281 fprint(2, "bad coordinates %s\n", inputline);
1285 while(*s && *s!=' ' && *s!='\t')
1290 deg = strtol(s, &t, 10);
1293 /* degree sign etc. is optional */
1296 deg = DEG(getra(s));
1299 if(abs(deg)>=90 || rah>=24)
1301 if(!loadpatch(patch(rah, ram, deg)))
1306 fprint(2, "unknown command %s\n", inputline);
1312 Bprint(&bout, "empty\n");
1314 for(i=0; i<nrec; i++)
1317 Bprint(&bout, "%ld items\n", nrec);
1321 fprint(2, "%s not found\n", inputline);
1347 if(d<Galaxy || d>PlateDefect)
1348 return "can't happen";
1352 short descindex[NINDEX];
1355 printnames(Record *r)
1360 for(i=0; i<NName; i++){ /* stupid linear search! */
1362 if(r->type==SAO && r->index==name[i].sao)
1364 if(r->type==NGC && r->u.ngc.ngc==name[i].ngc)
1366 if(r->type==Abell && r->u.abell.abell==name[i].abell)
1370 Bprint(&bout, "\t");
1371 Bprint(&bout, " \"%s\"", togreek(name[i].name));
1375 Bprint(&bout, "\n");
1379 equal(char *s1, char *s2)
1392 if('A'<=*s2 && *s2<='Z')
1407 blank = strchr(s, ' ');
1408 if(blank==0 || strchr(blank+1, ' ') || strlen(blank+1)!=3)
1411 parsed[0] = parsed[1] = parsed[2] = 0;
1412 if('0'<=s[0] && s[0]<='9'){
1418 for(i=1; i<=24; i++)
1419 if(strncmp(greek[i], s, strlen(greek[i]))==0){
1425 if('0'<=s[strlen(greek[i])] && s[strlen(greek[i])]<='9')
1426 parsed[1]=s[strlen(greek[i])]-'0';
1428 for(i=1; i<=88; i++)
1429 if(strcmp(constel[i], blank)==0){
1486 static char buf[128];
1496 if(s->name[0] >= 100){
1497 i = snprint(buf, sizeof buf, "%C", greeklet[s->name[0]-100]);
1499 i += snprint(buf+i, sizeof buf-i, "%d", s->name[1]);
1501 i = snprint(buf, sizeof buf, " %d", s->name[0]);
1502 snprint(buf+i, sizeof buf-i, " %s", constel[(uchar)s->name[2]]);
1506 if(n->type >= Uncertain)
1509 snprint(buf, sizeof buf, "NGC%4d ", n->ngc);
1511 snprint(buf, sizeof buf, "IC%4d ", n->ngc-NNGC);
1515 snprint(buf, sizeof buf, "Abell%4d", a->abell);
1528 int i, rah, ram, dec, nn;
1531 if(r) switch(r->type){
1533 fprint(2, "can't prrec type %d\n", r->type);
1538 Bprint(&bout, "%s", p->name);
1539 Bprint(&bout, "\t%s %s",
1541 dms(angle(p->dec)));
1542 Bprint(&bout, " %3.2f° %3.2f°",
1543 p->az/(double)MILLIARCSEC, p->alt/(double)MILLIARCSEC);
1544 Bprint(&bout, " %s",
1545 ms(angle(p->semidiam)));
1547 Bprint(&bout, " %g", p->phase);
1548 Bprint(&bout, "\n");
1554 Bprint(&bout, "NGC%4d ", n->ngc);
1556 Bprint(&bout, "IC%4d ", n->ngc-NNGC);
1557 Bprint(&bout, "%s ", ngcstring(n->type));
1558 if(n->mag == UNKNOWNMAG)
1559 Bprint(&bout, "----");
1561 Bprint(&bout, "%.1f%c", n->mag/10.0, n->magtype);
1562 Bprint(&bout, "\t%s %s\t%c%.1f'\n",
1566 DEG(angle(n->diam))*60.);
1567 prdesc(n->desc, desctab, descindex);
1573 Bprint(&bout, "Abell%4d %.1f %.2f° %dMpc", a->abell, a->mag10/10.0,
1574 DEG(angle(a->rad)), a->dist);
1575 Bprint(&bout, "\t%s %s\t%.2f %.2f\n",
1578 DEG(angle(a->glat)),
1579 DEG(angle(a->glong)));
1580 Bprint(&bout, "\tdist grp: %s rich grp: %s %d galaxies/°²\n",
1581 dist_grp(a->distgrp),
1582 rich_grp(a->richgrp),
1589 Bprint(&bout, "SAO%6ld ", r->index);
1590 if(s->mag==UNKNOWNMAG)
1591 Bprint(&bout, "---");
1593 Bprint(&bout, "%.1f", s->mag/10.0);
1594 if(s->mpg==UNKNOWNMAG)
1595 Bprint(&bout, ",---");
1597 Bprint(&bout, ",%.1f", s->mpg/10.0);
1598 Bprint(&bout, " %s %s %.4fs %.3f\"",
1601 DEG(angle(s->dra))*(4*60),
1602 DEG(angle(s->ddec))*(60*60));
1603 Bprint(&bout, " %.3s %c %.2s %ld %d",
1604 s->spec, s->code, s->compid, s->hd, s->hdcode);
1606 Bprint(&bout, " \"%s\"", nameof(r));
1607 Bprint(&bout, "\n");
1612 radec(r->index, &rah, &ram, &dec);
1613 Bprint(&bout, "%dh%dm %d°", rah, ram, dec);
1614 key = r->u.patch.key[0];
1615 Bprint(&bout, " %s", constel[key&0xFF]);
1616 if((key>>=8) & 0xFF)
1617 Bprint(&bout, " %s", constel[key&0xFF]);
1618 if((key>>=8) & 0xFF)
1619 Bprint(&bout, " %s", constel[key&0xFF]);
1620 if((key>>=8) & 0xFF)
1621 Bprint(&bout, " %s", constel[key&0xFF]);
1622 for(i=1; i<r->u.patch.nkey; i++){
1623 key = r->u.patch.key[i];
1626 Bprint(&bout, " SAO%ld", (key>>8)&0xFFFFFF);
1629 Bprint(&bout, " Abell%ld", (key>>8)&0xFFFFFF);
1632 nn = (key>>16)&0xFFFF;
1634 Bprint(&bout, " IC%d", nn-NNGC);
1636 Bprint(&bout, " NGC%d", nn);
1637 Bprint(&bout, "(%s)", ngcstring(key&0x3F));
1641 Bprint(&bout, "\n");
1645 if(r->index <= NNGC)
1646 Bprint(&bout, "NGC%ld\n", r->index);
1648 Bprint(&bout, "IC%ld\n", r->index-NNGC);
1652 Bprint(&bout, "SAO%ld \"%s\"\n", r->index, togreek(r->u.named.name));
1656 if(r->index <= NNGC)
1657 Bprint(&bout, "NGC%ld \"%s\"\n", r->index, togreek(r->u.named.name));
1659 Bprint(&bout, "IC%ld \"%s\"\n", r->index-NNGC, togreek(r->u.named.name));
1663 Bprint(&bout, "Abell%ld \"%s\"\n", r->index, togreek(r->u.named.name));
1667 radec(r->index, &rah, &ram, &dec);
1668 Bprint(&bout, "%dh%dm %d\n", rah, ram, dec);