1- import pysatMagVect as pymv
1+ import OMMBV as OMMBV
22
33
4- def add_mag_drift_unit_vectors_ecef (inst , ** kwargs ):
4+ def add_mag_drift_unit_vectors_ecef (inst , lat_label = 'latitude' , long_label = 'longitude' ,
5+ alt_label = 'altitude' , ** kwargs ):
56 """Adds unit vectors expressing the ion drift coordinate system
67 organized by the geomagnetic field. Unit vectors are expressed
78 in ECEF coordinates.
@@ -10,8 +11,6 @@ def add_mag_drift_unit_vectors_ecef(inst, **kwargs):
1011 ----------
1112 inst : pysat.Instrument
1213 Instrument object that will get unit vectors
13- max_steps : int
14- Maximum number of steps allowed for field line tracing
1514 **kwargs
1615 Passed along to calculate_mag_drift_unit_vectors_ecef
1716
@@ -27,11 +26,11 @@ def add_mag_drift_unit_vectors_ecef(inst, **kwargs):
2726 """
2827
2928 # add unit vectors for magnetic drifts in ecef coordinates
30- zvx , zvy , zvz , bx , by , bz , mx , my , mz = pymv .calculate_mag_drift_unit_vectors_ecef (inst ['latitude' ],
31- inst ['longitude' ],
32- inst ['altitude' ],
33- inst . data .index ,
34- ** kwargs )
29+ zvx , zvy , zvz , bx , by , bz , mx , my , mz = OMMBV .calculate_mag_drift_unit_vectors_ecef (inst [lat_label ],
30+ inst [long_label ],
31+ inst [alt_label ],
32+ inst .index ,
33+ ** kwargs )
3534
3635 inst ['unit_zon_ecef_x' ] = zvx
3736 inst ['unit_zon_ecef_y' ] = zvy
@@ -168,7 +167,8 @@ def add_mag_drift_unit_vectors_ecef(inst, **kwargs):
168167 return
169168
170169
171- def add_mag_drift_unit_vectors (inst , ** kwargs ):
170+ def add_mag_drift_unit_vectors (inst , lat_label = 'latitude' , long_label = 'longitude' ,
171+ alt_label = 'altitude' , ** kwargs ):
172172 """Add unit vectors expressing the ion drift coordinate system
173173 organized by the geomagnetic field. Unit vectors are expressed
174174 in S/C coordinates.
@@ -198,19 +198,20 @@ def add_mag_drift_unit_vectors(inst, **kwargs):
198198 """
199199
200200 # vectors are returned in geo/ecef coordinate system
201- add_mag_drift_unit_vectors_ecef (inst , ** kwargs )
201+ add_mag_drift_unit_vectors_ecef (inst , lat_label = lat_label , long_label = long_label ,
202+ alt_label = alt_label ,** kwargs )
202203 # convert them to S/C using transformation supplied by OA
203- inst ['unit_zon_x' ], inst ['unit_zon_y' ], inst ['unit_zon_z' ] = pymv .project_ecef_vector_onto_basis (
204+ inst ['unit_zon_x' ], inst ['unit_zon_y' ], inst ['unit_zon_z' ] = OMMBV .project_ecef_vector_onto_basis (
204205 inst ['unit_zon_ecef_x' ], inst ['unit_zon_ecef_y' ], inst ['unit_zon_ecef_z' ],
205206 inst ['sc_xhat_x' ], inst ['sc_xhat_y' ], inst ['sc_xhat_z' ],
206207 inst ['sc_yhat_x' ], inst ['sc_yhat_y' ], inst ['sc_yhat_z' ],
207208 inst ['sc_zhat_x' ], inst ['sc_zhat_y' ], inst ['sc_zhat_z' ])
208- inst ['unit_fa_x' ], inst ['unit_fa_y' ], inst ['unit_fa_z' ] = pymv .project_ecef_vector_onto_basis (
209+ inst ['unit_fa_x' ], inst ['unit_fa_y' ], inst ['unit_fa_z' ] = OMMBV .project_ecef_vector_onto_basis (
209210 inst ['unit_fa_ecef_x' ], inst ['unit_fa_ecef_y' ], inst ['unit_fa_ecef_z' ],
210211 inst ['sc_xhat_x' ], inst ['sc_xhat_y' ], inst ['sc_xhat_z' ],
211212 inst ['sc_yhat_x' ], inst ['sc_yhat_y' ], inst ['sc_yhat_z' ],
212213 inst ['sc_zhat_x' ], inst ['sc_zhat_y' ], inst ['sc_zhat_z' ])
213- inst ['unit_mer_x' ], inst ['unit_mer_y' ], inst ['unit_mer_z' ] = pymv .project_ecef_vector_onto_basis (
214+ inst ['unit_mer_x' ], inst ['unit_mer_y' ], inst ['unit_mer_z' ] = OMMBV .project_ecef_vector_onto_basis (
214215 inst ['unit_mer_ecef_x' ], inst ['unit_mer_ecef_y' ], inst ['unit_mer_ecef_z' ],
215216 inst ['sc_xhat_x' ], inst ['sc_xhat_y' ], inst ['sc_xhat_z' ],
216217 inst ['sc_yhat_x' ], inst ['sc_yhat_y' ], inst ['sc_yhat_z' ],
0 commit comments