Maybe its the data.

Discussion in 'Mac Programming' started by farmerdoug, Feb 6, 2012.

  1. macrumors 6502a

    Joined:
    Sep 16, 2008
    #1
    scale_psf and shift are basically the same routine. Shift is given a 5x5 array; does a spline fit; and spits out values for different shifts.
    scale_psf reads a 7x7 array from a 9x9, then does a spline fit, etc.
    scale_psf runs. Shift gives an error from subroutine splint.

    Bad xa input to routine splint meaning the xa's are supposed to be distinct

    Segmentation fault: 11
    The data looks good. ideas?

    row and col from original array x and y values for fits.

    1 1 4.583470e-04 0.000000
    2 1 2.077194e-03 1.000000
    3 1 5.094325e-03 2.000000
    4 1 6.767528e-03 3.000000
    5 1 4.821159e-03 4.000000
    6 1 1.817393e-03 5.000000
    7 1 3.617132e-04 6.000000
    1 2 4.277461e-03 0.000000
    2 2 1.952928e-02 1.000000
    3 2 4.829266e-02 2.000000
    4 2 6.475326e-02 3.000000
    5 2 4.635365e-02 4.000000
    6 2 1.757597e-02 5.000000
    7 2 3.521748e-03 6.000000
    1 3 1.613505e-02 0.000000
    2 3 7.439683e-02 1.000000
    3 3 2.058777e-01 2.000000
    4 3 3.419473e-01 3.000000
    5 3 2.014201e-01 4.000000
    6 3 6.890912e-02 5.000000
    7 3 1.385475e-02 6.000000
    1 4 2.473772e-02 0.000000
    2 4 1.157985e-01 1.000000
    3 4 4.236829e-01 2.000000
    4 4 1.001269e+00 3.000000
    5 4 4.291793e-01 4.000000
    6 4 1.106424e-01 5.000000
    7 4 2.214931e-02 6.000000
    1 5 1.544559e-02 0.000000
    2 5 7.225405e-02 1.000000
    3 5 2.023644e-01 2.000000
    4 5 3.419895e-01 3.000000
    5 5 2.048718e-01 4.000000
    6 5 7.078581e-02 5.000000
    7 5 1.441986e-02 6.000000
    1 6 3.918950e-03 0.000000
    2 6 1.842335e-02 1.000000
    3 6 4.690383e-02 2.000000
    4 6 6.473467e-02 3.000000
    5 6 4.760941e-02 4.000000
    6 6 1.853932e-02 5.000000
    7 6 3.815576e-03 6.000000
    1 7 4.017731e-04 0.000000
    2 7 1.902726e-03 1.000000
    3 7 4.875838e-03 2.000000
    4 7 6.764522e-03 3.000000
    5 7 5.018507e-03 4.000000
    6 7 1.969349e-03 5.000000
    7 7 4.080752e-04 6.000000
     

    Attached Files:

  2. macrumors 6502

    Joined:
    Mar 12, 2010
    #2
    Since the code you posted won't compile, the advice I'd offer is:
    1) Make sure the 2 files referenced in the code exist and contain what you think they're supposed to.

    2) Compile with -g then run the program in a debugger. You'll see what line it's crashing on.
     
  3. thread starter macrumors 6502a

    Joined:
    Sep 16, 2008
    #3
    I know exactly where they are crashing. In the subroutine spline, where the xa's are checked.

    ----------

    If you want to load the cfitsio library, I'll send you an image.
     

Share This Page