diff --git a/.gitignore b/.gitignore index c31424d..ca5bed5 100644 --- a/.gitignore +++ b/.gitignore @@ -100,3 +100,6 @@ ENV/ # eclipse .project .pydevproject + +#vscode settings +schainpy/.vscode/ diff --git a/schainpy/model/proc/clean_data.json b/schainpy/model/proc/clean_data.json index c9e80e5..84c2885 100644 --- a/schainpy/model/proc/clean_data.json +++ b/schainpy/model/proc/clean_data.json @@ -134,8 +134,58 @@ {"year": 2024, "doy": 252, "initial_time": [5,35], "final_time": [5,35], "aux_index": [ 31, null]}, {"year": 2024, "doy": 252, "initial_time": [5,20], "final_time": [5,40], "aux_index": [ 33, null]}, {"year": 2024, "doy": 252, "initial_time": [7,5], "final_time": [7,5], "aux_index": [ 21, null]}, - {"year": 2024, "doy": 252, "initial_time": [7,10], "final_time": [7,10], "aux_index": [ 23, null]} + {"year": 2024, "doy": 252, "initial_time": [7,10], "final_time": [7,10], "aux_index": [ 23, null]}, + + {"year": 2025, "doy": 21, "initial_time": [19,45], "final_time": [19,50], "aux_index": [ null, null]}, + {"year": 2025, "doy": 22, "initial_time": [0,50], "final_time": [3,30], "aux_index": [ null, 30]}, + {"year": 2025, "doy": 22, "initial_time": [1,50], "final_time": [1,50], "aux_index": [ null, null]}, + {"year": 2025, "doy": 22, "initial_time": [2,15], "final_time": [2,25], "aux_index": [ null, 38]}, + {"year": 2025, "doy": 22, "initial_time": [2,25], "final_time": [2,35], "aux_index": [ null, null]}, + {"year": 2025, "doy": 22, "initial_time": [2,40], "final_time": [2,50], "aux_index": [ null, 40]}, + {"year": 2025, "doy": 22, "initial_time": [2,40], "final_time": [2,40], "aux_index": [ 44, null]}, + {"year": 2025, "doy": 22, "initial_time": [2,45], "final_time": [2,45], "aux_index": [ 50, null]}, + {"year": 2025, "doy": 22, "initial_time": [3,0], "final_time": [3,15], "aux_index": [ null, 33]}, + {"year": 2025, "doy": 22, "initial_time": [3,30], "final_time": [4,15], "aux_index": [ null, 28]}, + {"year": 2025, "doy": 22, "initial_time": [4,15], "final_time": [4,25], "aux_index": [ null, 24]}, + {"year": 2025, "doy": 22, "initial_time": [3,50], "final_time": [4,15], "aux_index": [ null, 15]}, + {"year": 2025, "doy": 22, "initial_time": [0,0], "final_time": [5,0], "aux_index": [ null, 13]}, + + {"year": 2025, "doy": 22, "initial_time": [5,0], "final_time": [23,55], "aux_index": [ null, 13]}, + {"year": 2025, "doy": 22, "initial_time": [14,20], "final_time": [14,20], "aux_index": [ null, null]}, + {"year": 2025, "doy": 23, "initial_time": [0,10], "final_time": [0,10], "aux_index": [ null, null]}, + {"year": 2025, "doy": 23, "initial_time": [0,55], "final_time": [3,30], "aux_index": [ null, 26]}, + {"year": 2025, "doy": 23, "initial_time": [0,0], "final_time": [5,0], "aux_index": [ null, 13]}, + {"year": 2025, "doy": 23, "initial_time": [2,25], "final_time": [2,25], "aux_index": [ null, 34]}, + {"year": 2025, "doy": 23, "initial_time": [2,10], "final_time": [2,10], "aux_index": [ 44, 48]}, + {"year": 2025, "doy": 23, "initial_time": [0,50], "final_time": [0,50], "aux_index": [ 53, 53]}, + + {"year": 2025, "doy": 23, "initial_time": [5,0], "final_time": [23,55], "aux_index": [ null, 13]}, + {"year": 2025, "doy": 23, "initial_time": [5,0], "final_time": [8,0], "aux_index": [ null, 14]}, + {"year": 2025, "doy": 23, "initial_time": [12,5], "final_time": [12,5], "aux_index": [ null, null]}, + {"year": 2025, "doy": 24, "initial_time": [1,40], "final_time": [3,15], "aux_index": [ null, null]}, + {"year": 2025, "doy": 24, "initial_time": [3,25], "final_time": [3,30], "aux_index": [ 44, null]}, + {"year": 2025, "doy": 24, "initial_time": [3,20], "final_time": [3,40], "aux_index": [ null, 31]}, + {"year": 2025, "doy": 24, "initial_time": [3,40], "final_time": [4,55], "aux_index": [ null, 29]}, + {"year": 2025, "doy": 24, "initial_time": [0,0], "final_time": [5,0], "aux_index": [ null, 13]}, + + {"year": 2025, "doy": 24, "initial_time": [5,0], "final_time": [23,55], "aux_index": [ null, 13]}, + {"year": 2025, "doy": 25, "initial_time": [0,0], "final_time": [4,55], "aux_index": [ null, 27]}, + {"year": 2025, "doy": 25, "initial_time": [2,50], "final_time": [4,55], "aux_index": [ null, 30]}, + {"year": 2025, "doy": 25, "initial_time": [0,0], "final_time": [5,0], "aux_index": [ null, 13]}, + + {"year": 2025, "doy": 25, "initial_time": [5,0], "final_time": [23,55], "aux_index": [ null, 13]}, + {"year": 2025, "doy": 26, "initial_time": [2,50], "final_time": [4,5], "aux_index": [ null, null]}, + {"year": 2025, "doy": 26, "initial_time": [2,50], "final_time": [4,5], "aux_index": [ null, null]}, + {"year": 2025, "doy": 26, "initial_time": [0,40], "final_time": [4,20], "aux_index": [ null, 24]}, + {"year": 2025, "doy": 26, "initial_time": [4,30], "final_time": [4,30], "aux_index": [ null, 20]}, + {"year": 2025, "doy": 26, "initial_time": [0,0], "final_time": [5,0], "aux_index": [ null, 13]}, + + {"year": 2025, "doy": 26, "initial_time": [5,0], "final_time": [23,55], "aux_index": [ null, 13]}, + {"year": 2025, "doy": 26, "initial_time": [0,55], "final_time": [0,55], "aux_index": [ null, null]}, + {"year": 2025, "doy": 26, "initial_time": [0,55], "final_time": [4,55], "aux_index": [ null, 24]}, + {"year": 2025, "doy": 27, "initial_time": [0,0], "final_time": [5,0], "aux_index": [ null, 13]} + ]} diff --git a/schainpy/model/proc/jroproc_voltage.py b/schainpy/model/proc/jroproc_voltage.py index 6ac481b..7ab6773 100644 --- a/schainpy/model/proc/jroproc_voltage.py +++ b/schainpy/model/proc/jroproc_voltage.py @@ -2164,7 +2164,7 @@ class DoublePulseACFs_PerLag(Operation): if i == 4: exit(1) ''' - + print("dataOut.alag",dataOut.alag) #print("dataOut.p",datetime.datetime.utcfromtimestamp(dataOut.utctime), dataOut.p) #print(numpy.sum(dataOut.kabxys_integrated[8][:,:,0]+dataOut.kabxys_integrated[11][:,:,0])) @@ -2480,16 +2480,39 @@ class NormalizeDPPowerRoberto_V2(Operation): dataOut.cflast=numpy.zeros(1,'float32') self.aux=0 - #print(dataOut.ut_Faraday) + print(dataOut.ut_Faraday) - if (dataOut.ut_Faraday>=11.5 and dataOut.ut_Faraday<23): + if (dataOut.ut_Faraday>=11.5 and dataOut.ut_Faraday<23): # 6 30am to 6pm i2=(500.-dataOut.range1[0])/dataOut.DH i1=(200.-dataOut.range1[0])/dataOut.DH - elif(dataOut.ut_Faraday>=5 and dataOut.ut_Faraday<11.5): - inda = numpy.where(dataOut.heightList >= 260) #200 km + elif(dataOut.ut_Faraday>=5 and dataOut.ut_Faraday<8): # 0 am to 3am + inda = numpy.where(dataOut.heightList >= 330) # 260 #200 km minIndex = inda[0][0] - indb = numpy.where(dataOut.heightList < 350) # 700 km + indb = numpy.where(dataOut.heightList < 470) # 350 # 700 km + maxIndex = indb[0][-1] + print(minIndex) + print(dataOut.heightList) + + ph2max_idx = numpy.nanargmax(dataOut.ph2[minIndex:maxIndex]) + #print("dataOut.ph2[minIndex:maxIndex]: ", dataOut.ph2[minIndex:maxIndex]) + print("dataOut.ph2: ", dataOut.ph2) + print("dataOut.phi: ", dataOut.phi) + print("minIndex", minIndex, "maxIndex", maxIndex) + print(ph2max_idx) + + ph2max_idx += minIndex + + i2 = maxIndex #ph2max_idx + 6 + i1 = minIndex #ph2max_idx - 6 + + print("ELSE^^^^^^^^^^^^^^^^^^^^^") + print(dataOut.heightList[i1]) + print(dataOut.heightList[i2]) + elif(dataOut.ut_Faraday>=8 and dataOut.ut_Faraday<11.5): # 3 am to 6 30am ADDED + inda = numpy.where(dataOut.heightList >= 260) # 260 #200 km + minIndex = inda[0][0] + indb = numpy.where(dataOut.heightList < 350) # 350 # 700 km maxIndex = indb[0][-1] print(minIndex) print(dataOut.heightList) @@ -2499,14 +2522,7 @@ class NormalizeDPPowerRoberto_V2(Operation): #print("dataOut.ph2: ", dataOut.ph2) print("minIndex", minIndex, "maxIndex", maxIndex) print(ph2max_idx) - ''' - #if dataOut.flagTeTiCorrection: - if 1: - import matplotlib.pyplot as plt - plt.figure() - plt.plot(dataOut.ph2[minIndex:maxIndex],dataOut.heightList[minIndex:maxIndex],'*-') - plt.show() - ''' + ph2max_idx += minIndex i2 = maxIndex #ph2max_idx + 6 @@ -2515,7 +2531,7 @@ class NormalizeDPPowerRoberto_V2(Operation): print("ELSE^^^^^^^^^^^^^^^^^^^^^") print(dataOut.heightList[i1]) print(dataOut.heightList[i2]) - else: + else: #6pm to 12am inda = numpy.where(dataOut.heightList >= 200) #200 km minIndex = inda[0][0] indb = numpy.where(dataOut.heightList < 700) # 700 km @@ -2526,8 +2542,6 @@ class NormalizeDPPowerRoberto_V2(Operation): ph2max_idx = numpy.nanargmax(dataOut.ph2[minIndex:maxIndex]) #print("dataOut.ph2[minIndex:maxIndex]: ", dataOut.ph2[minIndex:maxIndex]) #print("dataOut.ph2: ", dataOut.ph2) - #print("minIndex", minIndex, "maxIndex", maxIndex) - #print(ph2max_idx) ''' #if dataOut.flagTeTiCorrection: if 1: @@ -2541,7 +2555,6 @@ class NormalizeDPPowerRoberto_V2(Operation): i2 = ph2max_idx + 6 i1 = ph2max_idx - 6 - print("ELSE^^^^^^^^^^^^^^^^^^^^^") print(dataOut.heightList[i1]) print(dataOut.heightList[i2]) ''' @@ -2632,7 +2645,7 @@ class NormalizeDPPowerRoberto_V2(Operation): dataOut.cf=self.normal(dataOut.dphi[i1::], dataOut.ph2[i1::], i2-i1, 1) except: - print("except") + print("except: chi factor not achieved in normalization") dataOut.cf = numpy.nan #print("cf: ",dataOut.cf) @@ -3023,8 +3036,8 @@ class DenCorrection(NormalizeDPPowerRoberto_V2): from scipy import signal - def func(params): - return (ratio2-self.gaussian(dataOut.heightList[:dataOut.NSHTS],params[0],params[1],params[2])) + #def func(params): + # return (ratio2-self.gaussian(dataOut.heightList[:dataOut.NSHTS],params[0],params[1],params[2])) #print("Before loop") dataOut.info2[0] = 1 diff --git a/schainpy/model/proc/normalize_factor2.json b/schainpy/model/proc/normalize_factor2.json index 7bdfabc..a6834e2 100644 --- a/schainpy/model/proc/normalize_factor2.json +++ b/schainpy/model/proc/normalize_factor2.json @@ -441,7 +441,40 @@ {"year": 2024,"doy": 252, "time": [[7,5]], - "cf": "dataOut.cflast[0]"} + "cf": "dataOut.cflast[0]"}, + + + {"year": 2025,"doy": 21, + "time": [[15,20]], + "cf": 0.0019}, + {"year": 2025,"doy": 22, + "time": [[2,30],[2,35],[2,40],[2,45],[2,50],[2,55],[3,5],[3,55]], + "cf": "dataOut.cflast[0]"}, + {"year": 2025,"doy": 22, + "time": [[3,0]], + "cf": 0.0019}, + + {"year": 2025,"doy": 22, + "time": [[5,15],[5,35],[5,45],[5,50],[5,55]], + "cf": "dataOut.cflast[0]"}, + {"year": 2025,"doy": 23, + "time": [[2,5],[2,25]], + "cf": "dataOut.cflast[0]"}, + {"year": 2025,"doy": 23, + "time": [[5,5],[5,30],[5,50]], + "cf": "dataOut.cflast[0]"}, + {"year": 2025,"doy": 24, + "time": [[4,0]], + "cf": "dataOut.cflast[0]"}, + + {"year": 2025,"doy": 25, + "time": [[3,5],[3,30]], + "cf": "dataOut.cflast[0]"}, + + {"year": 2025,"doy": 26, + "time": [[4,15],[4,20]], + "cf": "dataOut.cflast[0]"} + ]}