Commit af92088961b3538c5c3a14cb8b99f0678adbff7c
1 parent
5c44cc6c
Exists in
master
ajust
Showing
4 changed files
with
32 additions
and
11 deletions
Show diff stats
Bin.py/makeRequest.py
@@ -24,8 +24,6 @@ checkArgs(6, 'Usage : python makeRequest.py (target) (tgt_vi) (sw_vi) (TaoStopTi | @@ -24,8 +24,6 @@ checkArgs(6, 'Usage : python makeRequest.py (target) (tgt_vi) (sw_vi) (TaoStopTi | ||
24 | prefix = sys.argv[1] | 24 | prefix = sys.argv[1] |
25 | tgtVI = sys.argv[2] | 25 | tgtVI = sys.argv[2] |
26 | plasmaVI = sys.argv[3] | 26 | plasmaVI = sys.argv[3] |
27 | -#missionStopTime = sys.argv[4] | ||
28 | -#omniStopTime = sys.argv[5] | ||
29 | 27 | ||
30 | # In[4]: | 28 | # In[4]: |
31 | omniStopTime = datetime.strptime(sys.argv[5], '%Y-%m-%dT%H:%M:%S') | 29 | omniStopTime = datetime.strptime(sys.argv[5], '%Y-%m-%dT%H:%M:%S') |
@@ -0,0 +1,20 @@ | @@ -0,0 +1,20 @@ | ||
1 | +&INPARA1 | ||
2 | + idp_in=1 | ||
3 | + idp_prop=1 | ||
4 | + idp_out=1 | ||
5 | + angref(1)=0.,60.,120.,180.,240.,300. | ||
6 | + idprop=1 | ||
7 | + fnin='/home/budnik/SolarWind/Data/mars_20160727/inputs.txt' | ||
8 | + fnout='/home/budnik/SolarWind/Data/mars_20160727/outputs.txt' | ||
9 | + fdirtmp='/home/budnik/SolarWind/Data/mars_20160727/' | ||
10 | + instop=0 | ||
11 | + dtr=300. | ||
12 | + touts=12. | ||
13 | + xmin1=0.8 | ||
14 | + xmax1=10.8 | ||
15 | +/ | ||
16 | +&INPARA2 | ||
17 | + npout=10 | ||
18 | + bx0at1au=0.001d0 | ||
19 | + gm=1.40 | ||
20 | +/ |
Bin.py/run.py
@@ -31,8 +31,11 @@ def main(): | @@ -31,8 +31,11 @@ def main(): | ||
31 | # logger.info("SW2NC : " + SW2NC) | 31 | # logger.info("SW2NC : " + SW2NC) |
32 | 32 | ||
33 | # CREATE A DIRECTORY FOR THE NEW QUERY | 33 | # CREATE A DIRECTORY FOR THE NEW QUERY |
34 | + if not os.path.exists(SW2DATA): | ||
35 | + os.makedirs(SW2DATA) | ||
36 | + | ||
34 | MYDIR = SW2DATA+'/'+prefix+'_'+datetime.now().strftime('%Y%m%d') | 37 | MYDIR = SW2DATA+'/'+prefix+'_'+datetime.now().strftime('%Y%m%d') |
35 | - os.system('mkdir '+MYDIR) | 38 | + os.makedirs(MYDIR) |
36 | os.system('chmod ug+w ' + MYDIR) | 39 | os.system('chmod ug+w ' + MYDIR) |
37 | 40 | ||
38 | # CREATION OF A LOGGER | 41 | # CREATION OF A LOGGER |
@@ -183,8 +186,8 @@ def main(): | @@ -183,8 +186,8 @@ def main(): | ||
183 | else: | 186 | else: |
184 | idprop = 1 | 187 | idprop = 1 |
185 | # xmax1 = 2.3 | 188 | # xmax1 = 2.3 |
186 | - xmax1 = 10.3 | ||
187 | - xmin1 = 0.3 | 189 | + xmax1 = 10.8 |
190 | + xmin1 = 0.8 | ||
188 | 191 | ||
189 | # QUALITY FLAG | 192 | # QUALITY FLAG |
190 | dataFlagData = np.array( [df.index,np.zeros(len(df.index)).astype(int)]) | 193 | dataFlagData = np.array( [df.index,np.zeros(len(df.index)).astype(int)]) |
@@ -248,7 +251,7 @@ def main(): | @@ -248,7 +251,7 @@ def main(): | ||
248 | 251 | ||
249 | ddFile.close() | 252 | ddFile.close() |
250 | 253 | ||
251 | - ncFile = MYDIR+'/'+xmlFile.split('.')[0]+'.nc' | 254 | + ncFile = MYDIR+'/'+prefix+'_'+datetime.now().strftime('%Y%m%d')+'.nc' |
252 | 255 | ||
253 | os.system('WriteDDTime '+ncFile) | 256 | os.system('WriteDDTime '+ncFile) |
254 | 257 | ||
@@ -430,7 +433,7 @@ def writeNamelist(directory,idprop,xmax1,xmin1): | @@ -430,7 +433,7 @@ def writeNamelist(directory,idprop,xmax1,xmin1): | ||
430 | nl.write(' idp_prop=1\n') | 433 | nl.write(' idp_prop=1\n') |
431 | nl.write(' idp_out=1\n') | 434 | nl.write(' idp_out=1\n') |
432 | #nl.write(' angref(1)=0.,30.,60.,90.,120.,150.,180.,210.,240.,270.,300.,330.\n') | 435 | #nl.write(' angref(1)=0.,30.,60.,90.,120.,150.,180.,210.,240.,270.,300.,330.\n') |
433 | - nl.write(' angref(1)=0.,60.,120.,180.,240.,300.\n') | 436 | + nl.write(' angref(1)=0.,60.,120.,180.,240.,300.\n') |
434 | nl.write(' idprop='+str(idprop)+'\n') | 437 | nl.write(' idprop='+str(idprop)+'\n') |
435 | nl.write(' fnin=\''+directory+'/inputs.txt\'\n') | 438 | nl.write(' fnin=\''+directory+'/inputs.txt\'\n') |
436 | nl.write(' fnout=\''+directory+'/outputs.txt\'\n') | 439 | nl.write(' fnout=\''+directory+'/outputs.txt\'\n') |
runRequest
@@ -12,11 +12,11 @@ SwStop=$5 | @@ -12,11 +12,11 @@ SwStop=$5 | ||
12 | # delete results of previous calculations | 12 | # delete results of previous calculations |
13 | rm -rf $SW2DATA/temp $SW2DATA/$tgt* | 13 | rm -rf $SW2DATA/temp $SW2DATA/$tgt* |
14 | 14 | ||
15 | - # delete previous requests | ||
16 | - rm -f $REQ/*.xml | 15 | + # delete previous requests |
16 | + rm -f $REQ/*.xml $ | ||
17 | 17 | ||
18 | - cd $SW2ROOT/Bin.py; python makeRequest.py $tgt $tgt_vi $src_vi $TaoStop $SwStop > $tgt\.log | ||
19 | - DDLogin $DDUSER $DDPWD > ddlog | 18 | + cd $SW2ROOT/Bin.py; python makeRequest.py $tgt $tgt_vi $src_vi $TaoStop $SwStop |
19 | + DDLogin $DDUSER $DDPWD | ||
20 | 20 | ||
21 | # run newly created Request | 21 | # run newly created Request |
22 | for request in $REQ/$tgt*.xml | 22 | for request in $REQ/$tgt*.xml |