-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue hla 255 - Address issues associated with routines under copyrig…
…ht (#408) * Use released version of ci-watson from conda, rather than master commit via pip. (#399) * Final adjustments for combining bias and dark images * Update comments based on review. * Replaced Numerical Recipes routines and cleaned up obsolete routines * ACS and WFC3 updates to eliminate copyrighted code. * Updated text in documenation files * Removed erroneous comment in Dates/Updates Co-authored-by: Matt Rendina <[email protected]>
- Loading branch information
Showing
14 changed files
with
576 additions
and
1,148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,73 @@ | ||
#include <stdio.h> | ||
# include "trlbuf.h" | ||
/* | ||
PIKSRT - Sorting by straight insertion. | ||
Sorts an array arr[0...n-1] of float type into ascending numerical | ||
order of its .value elements. arr is replaced on output by its sorted | ||
Sorts an array arrayOfFloats[0...n-1] of float type into ascending numerical | ||
order of its value elements. arrayOfFloats is replaced on output by its sorted | ||
rearrangement. | ||
IPIKSRT - Sorting by straight insertion. | ||
Same algorithm as PIKSRT, but now an arrayOfInts is along for the ride. It is | ||
sorted according to the ranking for the arrayOfFloats elements simultaneously. | ||
There is an assumption the two input arrays are the same size. | ||
Order: n^2 | ||
*/ | ||
|
||
From "Numerical Recipes - The Art of Scientific Computing", | ||
Press, W.H., Teukolsky, S.A., Vetterling, W.T. and Flannery, B.P., | ||
2nd edition, Cambridge University Press, 1995. | ||
void piksrt (float arrayOfFloats[], int arrayLength) { | ||
float value; | ||
int position; | ||
trlmessage (MsgText); | ||
|
||
*/ | ||
/* Loop over the full input array */ | ||
for (int j = 1; j < arrayLength; j++) { | ||
|
||
void piksrt (float arr[], int n) { | ||
/* Get the value to be sorted and the candidate position */ | ||
value = arrayOfFloats[j]; | ||
position = j; | ||
|
||
int i, j; | ||
float a; | ||
/* Is preceding value larger than the new value? | ||
If so, move the preceding value to the higher ranking position... | ||
*/ | ||
while (position > 0 && arrayOfFloats[position-1] > value) { | ||
arrayOfFloats[position] = arrayOfFloats[position-1]; | ||
position--; | ||
} | ||
|
||
for (j = 1; j < n; j++) { | ||
a = arr[j]; | ||
i = j - 1; | ||
while ((i >= 0) && (arr[i] > a)) { | ||
arr[i+1] = arr[i]; | ||
i--; | ||
/* ...and put the new value in the lower ranking position. */ | ||
if (position != j) { | ||
arrayOfFloats[position] = value; | ||
} | ||
arr[i+1] = a; | ||
} | ||
} | ||
void ipiksrt (float arr[], int n, int brr[]) { | ||
|
||
int i, j; | ||
float a; | ||
int b; | ||
|
||
for (j = 1; j < n; j++) { | ||
a = arr[j]; | ||
b = brr[j]; | ||
i = j - 1; | ||
while ((i >= 0) && (arr[i] > a)) { | ||
arr[i+1] = arr[i]; | ||
brr[i+1] = brr[i]; | ||
i--; | ||
|
||
void ipiksrt (float arrayOfFloats[], int arrayLength, int arrayOfInts[]) { | ||
float fValue; | ||
int iValue; | ||
int position; | ||
trlmessage (MsgText); | ||
|
||
/* Loop over the input array */ | ||
for (int j = 1; j < arrayLength; j++) { | ||
|
||
/* Get the value to be sorted and the candidate position */ | ||
fValue = arrayOfFloats[j]; | ||
iValue = arrayOfInts[j]; | ||
position = j; | ||
|
||
/* Is preceding value larger than the new value? | ||
If so, move the preceding value to the higher ranking position... | ||
*/ | ||
while (position > 0 && arrayOfFloats[position-1] > fValue) { | ||
arrayOfFloats[position] = arrayOfFloats[position-1]; | ||
arrayOfInts[position] = arrayOfInts[position-1]; | ||
position--; | ||
} | ||
|
||
/* ...and put the new value in the lower ranking position. */ | ||
if (position != j) { | ||
arrayOfFloats[position] = fValue; | ||
arrayOfInts[position] = iValue; | ||
} | ||
arr[i+1] = a; | ||
brr[i+1] = b; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,35 @@ | ||
#include <stdio.h> | ||
/* | ||
PIKSRT - Sorting by straight insertion. | ||
PIKSRT - Sorting by straight insertion. | ||
Sorts an array arrayOfFloats[0...n-1] of float type into ascending numerical | ||
order of its value elements. arrayOfFloats is replaced on output by its sorted | ||
rearrangement. | ||
Sorts an array arr[0...n-1] of float type into ascending numerical | ||
order of its .value elements. arr is replaced on output by its sorted | ||
rearrangement. | ||
Order: n^2 | ||
Order: n^2 | ||
*/ | ||
|
||
From "Numerical Recipes - The Art of Scientific Computing", | ||
Press, W.H., Teukolsky, S.A., Vetterling, W.T. and Flannery, B.P., | ||
2nd edition, Cambridge University Press, 1995. | ||
void piksrt (float arrayOfFloats[], int arrayLength) { | ||
float value; | ||
int position; | ||
|
||
*/ | ||
/* Loop over the full input array */ | ||
for (int j = 1; j < arrayLength; j++) { | ||
|
||
void piksrt (float arr[], int n) { | ||
/* Get the value to be sorted and the candidate position */ | ||
value = arrayOfFloats[j]; | ||
position = j; | ||
|
||
int i, j; | ||
float a; | ||
/* Is preceding value larger than the new value? | ||
If so, move the preceding value to the higher ranking position... | ||
*/ | ||
while (position > 0 && arrayOfFloats[position-1] > value) { | ||
arrayOfFloats[position] = arrayOfFloats[position-1]; | ||
position--; | ||
} | ||
|
||
for (j = 1; j < n; j++) { | ||
a = arr[j]; | ||
i = j - 1; | ||
while ((i >= 0) && (arr[i] > a)) { | ||
arr[i+1] = arr[i]; | ||
i--; | ||
} | ||
arr[i+1] = a; | ||
} | ||
/* ...and put the new value in the lower ranking position. */ | ||
if (position != j) { | ||
arrayOfFloats[position] = value; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.