def rungtd1d(time: Union[datetime, str, np.ndarray],<EOL>altkm: np.ndarray,<EOL>glat: float, glon: float) -> xarray.Dataset:
time = todt64(time)<EOL>f107Ap = gi.getApF107(time, smoothdays=<NUM_LIT>)<EOL>f107a = f107Ap['<STR_LIT>'].item()<EOL>f107 = f107Ap['<STR_LIT>'].item()<EOL>Ap = f107Ap['<STR_LIT>'].item()<EOL><INDENT>dimensions<EOL><DEDENT>altkm = np.atleast_1d(altkm)<EOL>assert altkm.ndim == <NUM_LIT:1><EOL>assert isinstance(glon, (int, float))<EOL>assert isinstance(glat, (int, float))<EOL>assert isinstance(time, np.datetime64) or (time.size == <NUM_LIT:1> and isinstance(<EOL>time[<NUM_LIT:0>], np.datetime64)), '<STR_LIT>'<EOL>n't check ap, too complicated<EOL>assert isinstance(MASS, (float, int))<EOL>assert len(TSELECOPS) == <NUM_LIT><EOL>gtd7.tselec(TSELECOPS)  <EOL>iyd, utsec, stl = datetime2gtd(time, glon)<EOL>altkm = np.atleast_1d(altkm)<EOL>gtd7.meters(<NUM_LIT:1>)  <EOL>if isinstance(Ap, (float, int)):<EOL><INDENT>Ap = [Ap]*<NUM_LIT:7>  <EOL><DEDENT>dens = np.empty((altkm.size, len(species)))<EOL>temp = np.empty((altkm.size, len(ttypes)))<EOL>for i, a in enumerate(altkm):<EOL><INDENT>dens[i, :], temp[i, :] = gtd7.gtd7(iyd, utsec, a, glat, glon, stl, f107a, f107, Ap, MASS)<EOL><DEDENT>dsf = {k: (('<STR_LIT:time>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>'), v[None, :, None, None]) for (k, v) in zip(species, dens.T)}<EOL>dsf.update({'<STR_LIT>':  (('<STR_LIT:time>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>'), temp[:, <NUM_LIT:1>][None, :, None, None]),<EOL>'<STR_LIT>': (('<STR_LIT:time>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>'), temp[:, <NUM_LIT:0>][None, :, None, None])})<EOL>atmos = xarray.Dataset(dsf,<EOL>coords={'<STR_LIT:time>': time.astype(datetime), '<STR_LIT>': altkm, '<STR_LIT>': [glat], '<STR_LIT>': [glon], },<EOL>attrs={'<STR_LIT>': Ap, '<STR_LIT>': f107, '<STR_LIT>': f107a,<EOL>'<STR_LIT>': species})<EOL>return atmos<EOL>
This is the "atomic" function looped by other functions