- Timestamp:
- May 3, 2010, 8:50:52 AM (16 years ago)
- Location:
- branches/simtest_nebulous_branches
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/simtest_nebulous_branches
- Property svn:mergeinfo changed
-
branches/simtest_nebulous_branches/Ohana
-
Property svn:mergeinfo
set to (toggle deleted branches)
/trunk/Ohana merged eligible /branches/eam_branches/Ohana.20100407 27635-27772 /branches/pap_delete/Ohana 27530-27595
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/simtest_nebulous_branches/Ohana/src/opihi/dvo/imbox.c
r21065 r27840 1 1 # include "dvoshell.h" 2 2 3 // LARGEFILES: this function is currently limited to images with Nx,Ny each < 2^31 3 4 int imbox (int argc, char **argv) { 4 5 5 int j, kapa, Nskip, status, InPic, flipped, N, haveNx, haveNy, Nx, Ny, SOLO_PHU; 6 off_t Nskip; 7 int j, kapa, status, InPic, flipped, N, haveNx, haveNy, Nx, Ny, SOLO_PHU, Npts, NPTS; 6 8 Vector Xvec, Yvec; 7 9 double r, d, x[4], y[4], Rmin, Rmax, Rmid; … … 36 38 37 39 /* project this image to screen display coords */ 38 SetVector (&Xvec, OPIHI_FLT, 8); 39 SetVector (&Yvec, OPIHI_FLT, 8); 40 Npts = 0; 41 NPTS = 200; 42 SetVector (&Xvec, OPIHI_FLT, NPTS); 43 SetVector (&Yvec, OPIHI_FLT, NPTS); 40 44 41 45 while (gfits_fread_header (f, &header)) { … … 82 86 while (r > Rmid) r-= 360.0; 83 87 } 84 status |= RD_to_XY (&Xvec.elements.Flt[ 2*j], &Yvec.elements.Flt[2*j], r, d, &graphmode.coords);88 status |= RD_to_XY (&Xvec.elements.Flt[Npts + 2*j], &Yvec.elements.Flt[Npts + 2*j], r, d, &graphmode.coords); 85 89 if (j > 0) { 86 Xvec.elements.Flt[ 2*j - 1] = Xvec.elements.Flt[2*j];87 Yvec.elements.Flt[ 2*j - 1] = Yvec.elements.Flt[2*j];90 Xvec.elements.Flt[Npts + 2*j - 1] = Xvec.elements.Flt[Npts + 2*j]; 91 Yvec.elements.Flt[Npts + 2*j - 1] = Yvec.elements.Flt[Npts + 2*j]; 88 92 } 89 93 } 90 Xvec.elements.Flt[7] = Xvec.elements.Flt[0]; 91 Yvec.elements.Flt[7] = Yvec.elements.Flt[0]; 94 Xvec.elements.Flt[Npts + 7] = Xvec.elements.Flt[Npts + 0]; 95 Yvec.elements.Flt[Npts + 7] = Yvec.elements.Flt[Npts + 0]; 96 92 97 InPic = FALSE; 93 98 for (j = 0; j < 8; j+=2) { 94 if ((Xvec.elements.Flt[j] >= graphmode.xmin) && 95 (Xvec.elements.Flt[j] <= graphmode.xmax) && 96 (Yvec.elements.Flt[j] >= graphmode.ymin) && 97 (Yvec.elements.Flt[j] <= graphmode.ymax)) 98 InPic = TRUE; 99 if ((Xvec.elements.Flt[Npts + j] >= graphmode.xmin) && 100 (Xvec.elements.Flt[Npts + j] <= graphmode.xmax) && 101 (Yvec.elements.Flt[Npts + j] >= graphmode.ymin) && 102 (Yvec.elements.Flt[Npts + j] <= graphmode.ymax)) 103 InPic = TRUE; 104 } 105 if (!InPic) continue; 106 107 Npts += 8; 108 if (Npts + 8 >= NPTS) { /* need to leave room for 4 point image */ 109 NPTS += 200; 110 REALLOCATE (Xvec.elements.Flt, opihi_flt, NPTS); 111 REALLOCATE (Yvec.elements.Flt, opihi_flt, NPTS); 99 112 } 100 113 101 Xvec.Nelements = Yvec.Nelements = 8;102 if (InPic) {103 graphmode.style = 2; /* points */104 graphmode.ptype = 100; /* connect pairs of points */105 graphmode.etype = 0;106 PlotVectorPair (kapa, &Xvec, &Yvec, &graphmode);107 }108 114 skip: 109 115 Nskip = gfits_data_size (&header); 110 fseek (f, Nskip, SEEK_CUR);116 fseeko (f, Nskip, SEEK_CUR); 111 117 gfits_free_header (&header); 112 118 } 119 120 Xvec.Nelements = Yvec.Nelements = Npts; 121 if (Npts > 0) { 122 graphmode.style = 2; /* points */ 123 graphmode.ptype = 100; /* connect pairs of points */ 124 graphmode.etype = 0; 125 PlotVectorPair (kapa, &Xvec, &Yvec, &graphmode); 126 } 127 113 128 fclose (f); 114 129 free (Xvec.elements.Flt);
Note:
See TracChangeset
for help on using the changeset viewer.
