This file contains hidden or 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
# Remove duplicate vertices from lines | |
# A point is considered duplicate if it has the same XY coordinates within a tolerance (precision) | |
# The precision is an integer number of decimal places | |
# for X,Y in lat, long, 5 decimals is 1.1 meters and 6 is 11 cm | |
def removeDupeVertices(feature, precision): | |
fields = ['SHAPE@'] + [f.name for f in arcpy.ListFields(feature)] | |
sr = arcpy.Describe(feature).SpatialReference | |
upd = arcpy.da.UpdateCursor(feature,fields) | |
orphanList = [] | |
for row in upd: |
This file contains hidden or 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
Function interp(X As Double, xRange As Range, yRange As Range) As Double | |
ascending = xRange.Cells(1) < xRange.Cells(2) | |
With WorksheetFunction | |
If ascending Then i = .Match(X, xRange) Else i = .Match(X, xRange, -1) | |
Set x1x2 = Range(xRange.Cells(i), xRange.Cells(i + 1)) | |
Set y1y2 = Range(yRange.Cells(i), yRange.Cells(i + 1)) | |
interp = X * .Slope(y1y2, x1x2) + .Intercept(y1y2, x1x2) | |
End With | |
This file contains hidden or 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
Function Muskingum(timeSeries As Range, _ | |
K As Double, X As Double, _ | |
Optional Reaches As Integer = 1) As Variant | |
'Muskingum routing in Excel | |
'Returns a column array the same length as timeSeries (use array formula or spill) | |
'K (travel time) is in same units as the time step of the input timeSeries | |
'X must be between 0 and 0.5 | |
'Reaches will be automatically adjusted to avoid negative coefficients if K is < 1 / (2*(1-X)) or K > 1/2X | |
Dim Coeffs(1 To 5) As Double |
This file contains hidden or 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
aalii | |
aargh | |
aarti | |
abaca | |
abaci | |
aback | |
abacs | |
abaft | |
abaka | |
abamp |
This file contains hidden or 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
/* | |
Name: Show Moon Phase Emoji (MOONPHASE) | |
Description: Returns a lunar phase character closest matching to any Excel Date/Time value. | |
If you calculate for daily values at midnight, the lunar cycle will be the same for every 3 or 4 days (3.691 days). | |
🌑🌒🌓🌔🌕🌖🌗🌘 | |
*/ | |
MOONPHASE = LAMBDA(datetime,LET( | |
phase,MOD(ROUND(MOD(datetime-1.5,29.53059)/3.69125,0),8)+1, | |
UNICHAR(127760+phase))); |
This file contains hidden or 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
_search = LAMBDA(txt, searchtext, [case_sensitive], | |
// Test the inputs for errors so that we can distinguish | |
// the error that comes from FIND/SEARCH as meaning "not-found". | |
IFS( | |
ISERROR(txt), | |
txt, | |
ISERROR(searchtext), | |
searchtext, | |
ISERROR(case_sensitive), | |
case_sensitive, |
This file contains hidden or 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
# name=Godin | |
# description=This jython script reads your DSSVue selection, and performs Godin tidal smoothing. | |
# description=The original 1972 Godin algorithm was to apply successive 25-hour averages to hourly data. | |
# description=This filter is slightly modified for 15-minute data, and specific to the periods of tidal constituents. | |
# description=The 51-period (12.5-hr) filters M4, MS4 and MN4, 97-period (24-hr) filters S2 and K2, and 101-period (25-hr) filters M2, N2, and L2. | |
# displayinmenu=false | |
# displaytouser=true | |
# displayinselector=false | |
from hec.hecmath import HecMath | |
from hec.heclib.dss import HecDss, DSSPathname |
OlderNewer