1 / 12

Guide Star Lister -- Java Edition

Guide Star Lister -- Java Edition. M.Lampton UCB SSL 15 March 2003. Guide Star Lister. Determine s/c orientation Given a target (RA,dec) on the sky Given a target location (x,y) on the focal plane Given DoY hence sun location on sky.. what s/c orientation (pitch,yaw,roll)?

kimn
Download Presentation

Guide Star Lister -- Java Edition

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Guide Star Lister -- Java Edition M.Lampton UCB SSL 15 March 2003

  2. Guide Star Lister • Determine s/c orientation • Given a target (RA,dec) on the sky • Given a target location (x,y) on the focal plane • Given DoY hence sun location on sky.. • what s/c orientation (pitch,yaw,roll)? • Find & list all guide stars for that orientation • use GSC2.2 catalog subset for RA, dec, mag • use nominal guider chip locations on focal plane • Do it all in Java.

  3. Focal Plane Coordinates Telescope axis: (0.0, 0.0) meters Spectrometer feed: (+0.1,+0.1) meters

  4. GSC2.2http://www-gsss.stsci.edu/gsc/gsc2/GSC2home.htm • Digitized photographic survey • Palomar Schmidt + UK Schmidt: all sky • Has 456 million entries • Released July 2001 • Goes to about 18.5 in “F” or 19.5 in “J” • 23 fields and 208 bytes per object • Subsets can be downloaded from STScI

  5. GuideStarLister Overview • General purpose methods: • 6 static general purpose math methods • 6 static general purpose timekeeping/astronomy methods • 11 static general purpose vector & matrix methods • Mission specific methods: • “telescope( )” converts star_sc into star_fp • “epocselet( )” converts star_fp into star_sc • “whichchip( )” converts star_fp into ichip, pixrow, pixcol • 5 solver support functions • given target RA,dec coordinates & solar constraints • solve for attitude vector and unitary matrix • GSC parser analyzes Guide Star Cat 2.2 data • Took a Java novice (me) five weekends to write • 670 lines. • approx 10% is comments

  6. public static void main(String args[]) throws Exception { double [][] umat = new double[3][3]; System.out.println("..determining attitude....."); epocselet(TARGET_FPX, TARGET_FPY, tgt_sc); // get tgt_sc setup(TARGET_DOY); // get approx ori[] solve(); // get exact ori[] get3x3mat(ori, umat); // get umat[][] showattitude(); System.out.println("...RA.......dec.....Rmag....chip...row...col"); int[] chipvec = new int[3]; int nrec=0, ngood=0; File myfile = new File("gs.dat"); if (myfile.exists() && myfile.canRead()) // LJ p.308 try { FileReader fr = new FileReader(myfile); BufferedReader br = new BufferedReader(fr); String record = ""; while ((record = br.readLine()) != null) { nrec++; if (isguidestar(umat, record, chipvec)) { ngood++; showstar(record, chipvec); } } System.out.println("Records="+nrec+" good="+ngood); } catch (FileNotFoundException e) { System.out.println("file is not available"); } } main( )

  7. static boolean telescope(double star_sc[], double fp[]) // Converts star_sc vector to focal plane coords, meters. // Returns true if all is OK, otherwise returns false. // For differentiability this model responds to a full circular field; // but actual telescope is useful only over annulus 0.006<s<0.013 // M.Lampton UCB SSL Feb 2003 { double x = star_sc[0]; double y = star_sc[1]; double z = star_sc[2]; double err = Math.abs(x*x + y*y + z*z - 1.0); double s = Math.sqrt(x*x + y*y); // s=sin(OffAxisAngle) if ((s>0.0145) || (z<0.99) || (err>TOL)) { fp[0]=0.0; fp[1]=0.0; return false; // outside circular field or norm error } // Coefs fit to TMA63 distortion 0.006<s<0.013 // M.Lampton SPIE 4849 p.215 2002 // The RMS fit error is 1 microns RMS double a1=21.442388; double a3=2154.5181; double a5=216569.56; double radius = a1*s + a3*s*s*s + a5*s*s*s*s*s; double azim = Math.atan2(y, x); fp[0] = radius * Math.cos(azim); fp[1] = radius * Math.sin(azim); return true; } telescope( )

  8. static boolean epocselet(double fpx, double fpy, double star[]) // Inverse telescope: given (fpx,fpy) on focal plane, // computes the direction to the star in SC coordinates. // Returns 1 if OK; otherwise zero. // For differentiability, this routine allows full disk r<0.3 meters; // but actual telescope will image only over annulus 0.129<r<0.285. // M.Lampton UCB SSL Feb 2003 { double FL = 22.0; double fpr = Math.sqrt(fpx*fpx + fpy*fpy); if (fpr>0.3) return false; star[0] = star[1] = 0.0; // initially zero double [] trial = {0.0, 0.0, 1.0}; // trial values int i; for (int n=0; n<10; n++) { star[0] += (fpx - trial[0])/FL; star[1] += (fpy - trial[1])/FL; star[2] = Math.sqrt(1.0 - SQR(star[0]) - SQR(star[1])); if (!telescope(star, trial)) return false; } return true; } epocselet( )

  9. static boolean whichchip(double fpxy[], int ipix[]) // Given a focal plane fpxy[] in meters, // computes which chip and which pixel gets the photon. // Returns true if some chip succeeds, else false. // NOTE: ipix[0]=chipid, ipix[1]=col, ipix[2]=row. // Ultrasimplified! really there are various tilts etc. // M.Lampton UCB SSL Feb 2003 { int npix = 3238; // pixels on each axis double h = 0.017; // half size of chip, meters double [][] c = { {0.150000, 0.150000}, // xy center of chip zero {0.150000, -0.150000}, // xy center of chip one {-0.150000, -0.150000}, // xy center of chip two {-0.150000, 0.150000}}; // xy center of chip three double x = fpxy[0]; double y = fpxy[1]; ipix[0] = ipix[1] = ipix[2] = 0; for (int i=0; i<4; i++) { if (((x-c[i][0]-h)*(x-c[i][0]+h)<0) && ((y-c[i][1]-h)*(y-c[i][1]+h)<0)) { ipix[0] = i; // chipid = 0,1,2,3 ipix[1] = (int) (npix * ((x-c[i][0]+h))/(2*h)); ipix[2] = (int) (npix * ((y-c[i][1]+h))/(2*h)); return true; } } return false; } whichchip( )

  10. static void parseGSCrecord(String record, double star[]) // Parses GSC record into star[] = {RA, dec, mag} // M.Lampton UCB SSL Oct 2002, Feb 2003 { String NAMEstr = ""; String RAstr = ""; String DECstr = ""; String Fstr = ""; String classif = ""; star[0] = star[1] = star[2] = 0.0; if (record.length() < 1) return; StringTokenizer st = new StringTokenizer(record); // LJ p.228 int nfield = 0; while (st.hasMoreTokens( )) { String token = st.nextToken(); switch (nfield) { case 0: NAMEstr = token; break; case 1: RAstr = token; break; case 2: DECstr = token; break; case 10: Fstr = token; break; case 21: classif = token; break; default: break; } nfield++; } if (nfield < 23) return; star[0] = Double.parseDouble(RAstr); // LJ p.230 star[1] = Double.parseDouble(DECstr); // LJ p.230 star[2] = Double.parseDouble(Fstr); // LJ p.230 } parseGSCrecord( )

  11. isguidestar( ) static boolean isguidestar(double u[][], String line, int chipvec[]) // tests a GSC record and sees if it is a guide star { double [] radecmag = new double[3]; // ra, dec, mag double [] star_eq = new double[3]; // xyz unitsphere double [] star_sc = new double[3]; // xyz unitsphere double [] star_fp = new double[2]; // fpxy coords parseGSCrecord(line, radecmag); geteqvec(radecmag[0], radecmag[1], star_eq); mult(u, star_eq, star_sc); if (telescope(star_sc, star_fp) == 1) if (whichchip(star_fp, chipvec) && (radecmag[2]<DIMMESTMAG)) return true; return false; }

  12. ..determining attitude..... INPUT DoY=0.0 target fpxy = 0.1000 0.1000 OUTPUT yaw pitch roll = 31.8254 345.2915 247.7508 ...RA.......dec.....Rmag....chip...row...col 242.8606 54.8418 15.2400 0001 2572 1897 242.8629 54.8482 14.7400 0001 2339 1950 242.8747 54.8632 15.9500 0001 1794 2207 242.8146 55.6465 14.0700 0002 2169 1253 242.8695 55.6612 15.2500 0002 1657 2378 242.8361 55.6999 15.4500 0002 0237 1695 244.1969 55.6183 11.7900 0003 3217 0740 244.2170 55.6447 15.7500 0003 2252 1150 244.2039 55.6532 15.3400 0003 1948 0882 244.1671 55.6823 12.9700 0003 0904 0129 244.2454 55.6887 15.1800 0003 0642 1732 242.8812 55.6238 15.0100 0002 3019 2615 242.8919 54.8704 12.3800 0001 1532 2571 242.8764 54.9060 15.1000 0001 0242 2272 242.8857 54.9019 14.0800 0001 0391 2462 244.1633 54.9063 14.8700 0000 0230 0287 244.1590 54.8399 15.5800 0000 2642 0238 244.2374 54.8311 14.1300 0000 2964 1885 244.1969 54.8939 15.1400 0000 0678 0994 244.1584 54.8606 14.3700 0000 1890 0212 244.2685 54.8979 13.5600 0000 0533 2487 Records=15517 good=21 Typical Output

More Related