ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/JSOC/proj/sharp/apps/update_sharp_keys.c
(Generate patch)

Comparing proj/sharp/apps/update_sharp_keys.c (file contents):
Revision 1.9 by mbobra, Fri Jun 6 19:04:51 2014 UTC vs.
Revision 1.10 by mbobra, Mon Jun 9 21:07:41 2014 UTC

# Line 12 | Line 12
12   *      of update_sharp_keys.c. HISTORY will include a human-readable sentence about which
13   *      keywords were updated.
14   *
15 + *      N.B.: This module calculates the keyword specified in keylist and then does a
16 + *      drms_copykeys() to copy over all the remaining keywords. However, if [1] a keyword
17 + *      does not exist in the .jsd files of the input series, and [2] said keyword X is not
18 + *      specified in keylist, then [3] drms_copykeys() will copy DRMS_MISSING_VALUE into
19 + *      keyword X for all the output series.
20 + *
21   *      This module does not produce segments.
22   *
23   *      INPUTS     : -- DRMS SHARP series
# Line 223 | Line 229 | int DoIt(void)
229          int ny = inseg->axis[1];
230          int nxny = nx * ny;
231          int dims[2] = {nx, ny};
232 +        //int nx = (inseg->axis[0])+1;
233 +        //int ny = (inseg->axis[1])+1;
234 +        //int nxny = nx * ny;
235 +        //int dims[2] = {nx, ny};
236  
237          // Temp arrays  
238          float *bh      = (float *) (malloc(nxny * sizeof(float)));
# Line 289 | Line 299 | int DoIt(void)
299          int nxp = nx1+40;
300          int nyp = ny1+40;
301  
302 +        // check to make sure that the dimensions passed into fsample() are adequate
303          if (nx1 > floor((nx-1)/scale + 1) )
304                  DIE("X-dimension of output array in fsample() is too large.");
305          if (ny1 > floor((ny-1)/scale + 1) )
306 <                DIE("Y-dimension of output array in fsample() is too large.");
306 >                DIE("Y-dimension of output array in fsample() is too large.");
307  
308          // malloc some arrays for the R parameter calculation
309          float *rim     = (float *)malloc(nx1*ny1*sizeof(float));
# Line 310 | Line 321 | int DoIt(void)
321          float *fy = (float *) (malloc(nxny * sizeof(float)));
322          float *fz = (float *) (malloc(nxny * sizeof(float)));
323      
313    
324          for (irec=0;irec<nrecs;irec++)
325          {
326 +
327 +           DRMS_Record_t *sharpceainrec = sharpceainrecset->records[irec];
328 +           DRMS_Segment_t *inseg = drms_segment_lookup(sharpceainrec, "Br");
329 +           int nxtest = inseg->axis[0];
330 +           int nytest = inseg->axis[1];
331 +
332 +           // Check to make sure that nx x ny are constant for this harpnum
333 +           if (nx != nxtest || ny!= nytest)
334 +                   DIE("CEA series does not have constant dimensions for this HARPNUM.");
335 +
336             // Get emphemeris
337             sharpinrec    = sharpinrecset->records[irec];
338             sharpceainrec = sharpceainrecset->records[irec];
# Line 742 | Line 762 | int DoIt(void)
762  
763             /******************************* END FLAGS **********************************/
764  
765 +
766             drms_free_array(bitmaskArray);              
767             drms_free_array(maskArray);
768             drms_free_array(bxArray);          
# Line 751 | Line 772 | int DoIt(void)
772             drms_free_array(by_errArray);
773             drms_free_array(bz_errArray);
774             drms_free_array(losArray);
775 +
776          } //endfor
777  
778          drms_close_records(sharpinrecset, DRMS_FREE_RECORD);
# Line 758 | Line 780 | int DoIt(void)
780  
781          drms_close_records(sharpoutrecset, DRMS_INSERT_RECORD);
782          drms_close_records(sharpceaoutrecset, DRMS_INSERT_RECORD);
783 <  
783 >
784          //used for select calculations
785          free(bh); free(bt); free(jz);
786          free(bpx); free(bpy); free(bpz);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines