Skip to content

Commit

Permalink
adding some missing function from the original one.
Browse files Browse the repository at this point in the history
  • Loading branch information
hydrogencl committed Jan 5, 2023
1 parent eaeb16e commit deaeffc
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions GRIDINFORMER.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import math,re,sys,os,time
import random as RD
import time
import struct

try:
import netCDF4 as NC
except:
Expand Down Expand Up @@ -803,7 +805,11 @@ def FindZatP3( P0, P1, P2, P3):
A,B,C,D = MATH_TOOLS.NVtoPlane(P0, P1, P2)
return (D-A*P3[0] - B*P3[1])/float(C)


def c2p(x,y):
if y != 0.0:
return math.fmod(math.atan(float(x/y)) * 180./math.pi + (x < 0) * 360 + (y < 0)*180, 360)
else:
return (x < 0) * 270 + (x > 0) * 90

class TOOLS:
""" TOOLS is contains:
Expand Down Expand Up @@ -926,6 +932,10 @@ def calendar_cal(ARR_START_TIME, ARR_INTERVAL, ARR_END_TIME_IN=[0, 0, 0, 0, 0, 0
if sum(ARR_FERTIG) == 6: IF_FERTIG = True
return ARR_END_TIME





class MPI_TOOLS:

def __init__(self, MPI_SIZE=1, MPI_RANK=0,\
Expand Down Expand Up @@ -1222,7 +1232,12 @@ class DATA_READER:
def __init__(self, STR_NULL="noData", NUM_NULL=-999.999):
self.STR_NULL=STR_NULL
self.NUM_NULL=NUM_NULL

self.endian = STR_endian
if self.endian=="b":
sym_end=">"
elif self.endian=="l":
sym_end="<"

def stripblnk(arr,*num_typ):
new_arr=[]
for i in arr:
Expand Down

0 comments on commit deaeffc

Please sign in to comment.