Commit af16ae5a09dae862fb520e2acc7b4711b5e38019
1 parent
17655559
Exists in
master
2 angles + Templates
Showing
8 changed files
with
90 additions
and
16 deletions
Show diff stats
Bin.py/run.py
... | ... | @@ -87,7 +87,8 @@ def main(): |
87 | 87 | plasmaCmd = ['get_OMNI_1H',MYDIR+'/plasma.csv',plasmaDDStart,ddTimeDeltaPlasma] |
88 | 88 | elif plasmaVi == 'ace_swepam_real': |
89 | 89 | plasmaCmd = ['get_ACE_RT',MYDIR+'/plasma.csv',MYDIR+'/mag.csv',plasmaDDStart,ddTimeDeltaPlasma] |
90 | - | |
90 | + | |
91 | + print plasmaCmd | |
91 | 92 | srcCmd = ['get_R_LON_HCI',MYDIR+'/source.csv',srcVi,srcR,srcLon,orbitsDDStart,ddTimeDeltaOrbit] |
92 | 93 | tgtCmd = ['get_R_LON_HCI',MYDIR+'/target.csv',tgtVi,tgtR,tgtLon,orbitsDDStart,ddTimeDeltaOrbit] |
93 | 94 | os.system(' '.join(plasmaCmd)) |
... | ... | @@ -136,7 +137,10 @@ def main(): |
136 | 137 | target = target.set_index('Time') |
137 | 138 | |
138 | 139 | # CARTESIAN TO SPHERICAL COORDS |
140 | + | |
141 | + #r_source = source['R_HCI_source'] / 150000000.0 | |
139 | 142 | r_source = source['R_HCI_source'] |
143 | + | |
140 | 144 | lon_source_deg = np.degrees(source['LON_HCI_source']) |
141 | 145 | lon_source_deg[lon_source_deg < 0] = lon_source_deg+360.0 #-180/180 -> 0/360 |
142 | 146 | |
... | ... | @@ -302,7 +306,7 @@ def main(): |
302 | 306 | |
303 | 307 | temperatureVar = nc.createVariable( 'T', 'f4', (u'Time',) ) |
304 | 308 | tempKelvin = [ tempi/11600.0 for tempi in np.array(outputs['Temperature']) ] |
305 | - temperatureVar.units = 'K' | |
309 | + temperatureVar.units = 'eV' | |
306 | 310 | temperatureVar[:] = tempKelvin |
307 | 311 | |
308 | 312 | deltaPhiVar = nc.createVariable( 'Delta_angle', 'f4', (u'Time',) ) |
... | ... | @@ -459,8 +463,8 @@ def writeNamelist(directory,idprop,xmax1,xmin1): |
459 | 463 | nl.write(' idp_prop=1\n') |
460 | 464 | nl.write(' idp_out=1\n') |
461 | 465 | #nl.write(' angref(1)=0.,30.,60.,90.,120.,150.,180.,210.,240.,270.,300.,330.\n') |
462 | - nl.write(' angref(1)=0.,60.,120.,180.,240.,300.\n') | |
463 | - #nl.write(' angref(1)=0.,60.\n') | |
466 | + #nl.write(' angref(1)=0.,60.,120.,180.,240.,300.\n') | |
467 | + nl.write(' angref(1)=0.,180.\n') | |
464 | 468 | nl.write(' idprop='+str(idprop)+'\n') |
465 | 469 | nl.write(' fnin=\''+directory+'/inputs.txt\'\n') |
466 | 470 | nl.write(' fnout=\''+directory+'/outputs.txt\'\n') | ... | ... |
Sources/get_OMNI_1H.cpp
... | ... | @@ -38,7 +38,7 @@ int main(int argc, char const *argv[]) |
38 | 38 | ofstream plasmaFile(dataFilename.c_str(), ios::out); |
39 | 39 | |
40 | 40 | int id = DD_SetVariable( const_cast<char*>( plasmaVi.c_str() ) ); |
41 | - | |
41 | + | |
42 | 42 | char *st = const_cast<char*>( ddStart.c_str() ); |
43 | 43 | |
44 | 44 | int error = DD_SetTime(id, st); |
... | ... | @@ -46,7 +46,7 @@ int main(int argc, char const *argv[]) |
46 | 46 | if (error < 0) |
47 | 47 | { |
48 | 48 | std::string ddSetTimeErr = "[ERROR] Bad time pointer init in DD_SetTime -> err value : " + error; |
49 | - throw std::string(ddSetTimeErr); | |
49 | + throw ddSetTimeErr; | |
50 | 50 | } |
51 | 51 | |
52 | 52 | // GET DATA | ... | ... |
... | ... | @@ -0,0 +1,12 @@ |
1 | +<?xml version="1.0" ?> | |
2 | +<MISSION> | |
3 | + <START>XXXX-01-01T00:00:00</START> | |
4 | + <STOP>YYYY-01-01T00:00:00</STOP> | |
5 | + <PLASMA_VI>omni_hour_all</PLASMA_VI> | |
6 | + <SOURCE_VI>earth_orb_all</SOURCE_VI> | |
7 | + <SOURCE_R_PARAM>R</SOURCE_R_PARAM> | |
8 | + <SOURCE_LON_PARAM>LON_HCI</SOURCE_LON_PARAM> | |
9 | + <TARGET_VI>jupiter_orb_all</TARGET_VI> | |
10 | + <TARGET_R_PARAM>R_HCI</TARGET_R_PARAM> | |
11 | + <TARGET_LON_PARAM>LON_HCI</TARGET_LON_PARAM> | |
12 | +</MISSION> | |
0 | 13 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,12 @@ |
1 | +<?xml version="1.0" ?> | |
2 | +<MISSION> | |
3 | + <START>XXXX-01-01T00:00:00</START> | |
4 | + <STOP>YYYY-01-01T00:00:00</STOP> | |
5 | + <PLASMA_VI>omni_hour_all</PLASMA_VI> | |
6 | + <SOURCE_VI>earth_orb_all</SOURCE_VI> | |
7 | + <SOURCE_R_PARAM>R</SOURCE_R_PARAM> | |
8 | + <SOURCE_LON_PARAM>LON_HCI</SOURCE_LON_PARAM> | |
9 | + <TARGET_VI>mars_orb_all</TARGET_VI> | |
10 | + <TARGET_R_PARAM>R_HCI</TARGET_R_PARAM> | |
11 | + <TARGET_LON_PARAM>LON_HCI</TARGET_LON_PARAM> | |
12 | +</MISSION> | |
0 | 13 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,12 @@ |
1 | +<?xml version="1.0" ?> | |
2 | +<MISSION> | |
3 | + <START>XXXX-01-01T00:00:00</START> | |
4 | + <STOP>YYYY-01-01T00:00:00</STOP> | |
5 | + <PLASMA_VI>omni_hour_all</PLASMA_VI> | |
6 | + <SOURCE_VI>earth_orb_all</SOURCE_VI> | |
7 | + <SOURCE_R_PARAM>R</SOURCE_R_PARAM> | |
8 | + <SOURCE_LON_PARAM>LON_HCI</SOURCE_LON_PARAM> | |
9 | + <TARGET_VI>mercury_orb_all</TARGET_VI> | |
10 | + <TARGET_R_PARAM>R_HCI</TARGET_R_PARAM> | |
11 | + <TARGET_LON_PARAM>LON_HCI</TARGET_LON_PARAM> | |
12 | +</MISSION> | |
0 | 13 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,12 @@ |
1 | +<?xml version="1.0" ?> | |
2 | +<MISSION> | |
3 | + <START>XXXX-01-01T00:00:00</START> | |
4 | + <STOP>YYYY-01-01T00:00:00</STOP> | |
5 | + <PLASMA_VI>omni_hour_all</PLASMA_VI> | |
6 | + <SOURCE_VI>earth_orb_all</SOURCE_VI> | |
7 | + <SOURCE_R_PARAM>R</SOURCE_R_PARAM> | |
8 | + <SOURCE_LON_PARAM>LON_HCI</SOURCE_LON_PARAM> | |
9 | + <TARGET_VI>saturn_orb_all</TARGET_VI> | |
10 | + <TARGET_R_PARAM>R_HCI</TARGET_R_PARAM> | |
11 | + <TARGET_LON_PARAM>LON_HCI</TARGET_LON_PARAM> | |
12 | +</MISSION> | |
0 | 13 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,12 @@ |
1 | +<?xml version="1.0" ?> | |
2 | +<MISSION> | |
3 | + <START>XXXX-01-01T00:00:00</START> | |
4 | + <STOP>YYYY-01-01T00:00:00</STOP> | |
5 | + <PLASMA_VI>omni_hour_all</PLASMA_VI> | |
6 | + <SOURCE_VI>earth_orb_all</SOURCE_VI> | |
7 | + <SOURCE_R_PARAM>R</SOURCE_R_PARAM> | |
8 | + <SOURCE_LON_PARAM>LON_HCI</SOURCE_LON_PARAM> | |
9 | + <TARGET_VI>venus_orb_all</TARGET_VI> | |
10 | + <TARGET_R_PARAM>R_HCI</TARGET_R_PARAM> | |
11 | + <TARGET_LON_PARAM>LON_HCI</TARGET_LON_PARAM> | |
12 | +</MISSION> | |
0 | 13 | \ No newline at end of file | ... | ... |
runAll
1 | 1 | #!/bin/bash |
2 | 2 | |
3 | -for request in Requests/venus*.xml | |
4 | - do | |
5 | - if [[ -f $request ]] | |
6 | - then | |
7 | - python Bin.py/run.py venus $request -1 | |
8 | - else | |
9 | - echo -100 | |
10 | - fi | |
11 | - | |
12 | - done | |
3 | +for i in `seq 0 5` | |
4 | + do | |
5 | + YEAR=$((i + 2010)) | |
6 | + YEAR_STOP=$((YEAR + 1)) | |
7 | + echo $YEAR_STOP | |
8 | + | |
9 | + for template in Templates/venus_XXXX.xml | |
10 | + do | |
11 | + if [[ -f $template ]] | |
12 | + then | |
13 | + IFS='_/. ' read -r -a array <<< $template | |
14 | + target=${array[1][1]} | |
15 | + request=$target"_"$YEAR".xml" | |
16 | + sed "s/XXXX/$YEAR/g;s/YYYY/$YEAR_STOP/g" $template > Requests/$request | |
17 | + python Bin.py/run.py $target Requests/$request $YEAR_STOP-01-01T00:00:00.000Z | |
18 | + else | |
19 | + echo -100 | |
20 | + fi | |
21 | + done | |
22 | + done | |
13 | 23 | |
14 | 24 | \ No newline at end of file | ... | ... |