author: Rebeca Garcia Lopez ; Brunella Nisini ; Jochen Eislöffel ; Teresa Giannini ; Francesca Bacciotti ; Linda Podio
bibliography: references.bib
date: Received date; Accepted date
title: IR diagnostics of embedded jets: kinematics and physical characteristics of the HH46-47 jet [^1]

We present an analysis of the kinematics and physical properties of the Class I driven jet HH46-47 based on IR medium and low resolution spectroscopy obtained with ISAAC on VLT. Our aim is to study the gas physics as a function of the velocity and distance from the source and compare the results with similar studies performed on other Class I and classical T Tauri jets, as well as with existing models for the jet formation and excitation. The ratios and luminosities of several important diagnostic lines (e.g. \[\] 1.644, 1.600 $\mu$m, \[\] 1.189 $\mu$m, and H$_2$ lines) have been used to derive physical parameters such as electron density, H$_2$ temperature, iron gas-phase abundance and mass flux. \[\] 1.644 $\mu$m and H$_2$ 2.122 $\mu$m Position Velocity Diagrams (PVDs) have been in addition constructed to study the kinematics of both the atomic and molecular gas. Within 1000-2000 AU from the source the atomic gas presents a wide range of radial velocities, from $\sim$ -230 km s$^{-1}$ to $\sim$ 100 km s$^{-1}$. Only the gas component at the highest velocity (High Velocity Component, HVC) survives at large distances. The H$_2$, shows, close to the source, only a single velocity component at almost zero velocity, while it reaches higer velocities (up to $\sim$`<!-- -->`{=html}95 km s$^{-1}$) further downstream. Electron densities (n$_e$) and mass ejection fluxes ($\dot{M}_{jet}$) have been measured separately for the HVC and for the component at lower velocity (LVC) from the \[\] lines. n$_e$ increases with decreasing velocities with an average value of $\sim6000$ cm$^{-3}$ for the LVC and $\sim4000$ cm$^{-3}$ for the HVC, while the opposite occurs for $\dot{M}_{jet}$ which is $\sim0.5-2\times10^{-7}$ M$_{\odot}$yr$^{-1}$ and $\sim0.5-3.6\times10^{-8}$ M$_{\odot}$yr$^{-1}$ for the HVC and LVC, respectively. The mass flux carried out by the molecular component, measured from the H$_2$ lines flux, is $\sim4\times10^{-9}$ M$_{\odot}$yr$^{-1}$. We have estimated that the Fe gas phase abundance is significantly lower than the solar value, with $\sim$ 88% of iron still depleted onto dust grains in the internal jet region. This fraction decreases to $\sim$`<!-- -->`{=html}58%, in the external knots. Many of the derived properties of the HH46-47 jet are common to jets from YSOs in different evolutionary states. The derived densities and mass flux values are typical of Class I objects or very active T Tauri stars. However, the spatial extent of the LVC and the velocity dependence of the electron density have been so far observed only in another Class I jet, the HH34 jet, and are not explained by the current models of jet launching.

# Introduction

Protostellar jets are tightly associated with the first stage of protostar evolution. They are believed to remove angular momentum, disrupt infalling material from the cloud, inject turbulence in the ISM and modify its chemistry. Little is known, however, on how protostellar jets originate. There are two principal schools of thought regarding where protostellar jets are launched from: the X-wind and the Disc-wind models (). While disc-wind models assume ejection from a large spread of radii from the disc, X-wind models assume that the ejection of material takes place only at a single annulus at the interaction region between the stellar magnetosphere and the inner edge of the disc. Both models were born in an attempt to explain the kinematical and physical properties observed at optical wavelengths in jets from classical TTauri stars (e.g., ). Very few studies have been done, however, regarding the physical properties of Class I jets. Since these objects are still highly embedded in their molecular clouds, they are affected by a large extinction. Thus, it is not possible to detect the region near to the exciting source at optical wavelengths. In this context, infrared spectroscopy is a very useful tool to probe the physical properties and kinematics of Class I jets close to their base, where their characteristics have not yet been modified by the interaction with the surrounding material.

Several studies have been carried out in recent years employing near-IR (NIR) line diagnostic on protostellar jets (e.g., ). The main lines used to probe physical and kinematical properties in NIR are \[\] (e.g. 1.644 $\mu$m, 1.600 $\mu$m) and H$_2$ lines (e.g. 2.122 $\mu$m). These studies revealed that the kinematical structure at the jet base of Class I and classical T Tauri stars (CTTSs) jets is very similar. Both show a broad line emission near the source consisting of a collimated and large scale jet at high velocity (the so-called HVC) and a slower velocity component (the so-called LVC) that is only detected around the central source. Noticeably, this kind of velocity structure is often observed in both the atomic and molecular components of the jets, the latter probed through the H$_2$ emission and called Molecular Hydrogen Emission Line regions . Concerning the physical properties, Class I jets show higher densities and mass loss rates than CTTS jets, as expected for less evolved objects. Both disc-wind and X-wind models predict the presence of a large spread of velocity at the jet base as shown by few synthetic position velocity diagrams (PVDs) constructed for both models (), although attempts to reproduce the specific characteristics (e.g. kinematics, presence of the MHEL region, physical parameters) displayed by the Class I jets are still lacking . We have now started a project aimed to determine few basic physical parameters of embedded jets as a function of both velocity and distance from the driving source, using near-IR (NIR) medium resolution (R$\sim$`<!-- -->`{=html}10 000) spectra taken with ISAAC on the Very Large Telescope (VLT). The goals of this study are to make a quantitative comparison between the physical properties of Class I and CTTS jets and to constrain the origin of the different velocity components and the mechanism responsible for their excitation. In a previous paper (), we have applied our NIR diagnostic techniques to two jets, HH34 and HH1.

```latex
\begin{table*}
\begin{minipage}[t]{\textwidth}
\caption{Lines observed in the knot Z1 of the HH46-47 jet.                                                                               }
\label{tab:z1_lines}
\vspace{0.1cm}
%\label{tab:z1_lines}
\centering
\renewcommand{\footnoterule}{}  % to avoid a line before footnotes
\begin{tabular}{cccccccc}
\hline     \hline
Line id. & $\lambda$ &  F & $\Delta$F & Line id. & $\lambda$ &  F & $\Delta$F\\
 ~       &  ($\mu$m)    & \multicolumn{2}{c}{(10$^{-16}$ erg cm$^{-2}$ s$^{-1}$)} &~        & ($\mu$m)    & \multicolumn{2}{c}{(10$^{-16}$ erg cm$^{-2}$ s$^{-1}$)} \\
\hline
[\ion{Ti}{ii}]\,$^2$G$_{7/2}$-$^4$F$_{7/2}$    & 1.140 & 8.3 & 3.5 &   H$_2$ 1-0 S(6)             & 1.788 & 9.4 & 0.5 \\
H$_2$ 2-0 S(1)              & 1.162 & 5.8 & 2.2 &   [\ion{Fe}{ii}]\,a$^4$D$_{3/2}$-a$^4$F$_{3/2}$ & 1.797 & 9.8 & 1.1\\
[\ion{P}{ii}]\,$^3$P$_2$-$^1$D$_2$       & 1.188 & 3.5 & 1.0 &   [\ion{Fe}{ii}]\,a$^4$D$_{5/2}$-a$^4$F$_{5/2}$ & 1.800 & 7.1 & 0.8\\
[\ion{Fe}{ii}]\,a$^4$D$_{7/2}$-a$^6$D$_{9/2}$ & 1.257 & 106.0 & 0.8&   [\ion{Fe}{ii}]\,a$^4$D$_{7/2}$-a$^4$F$_{7/2}$ & 1.810 & 38.2 & 2.1\\
[\ion{Fe}{ii}]\,a$^4$D$_{1/2}$-a$^6$D$_{1/2}$ & 1.271 & 5.9 & 1.0  &   H$_2$ 2-1 S(5)             & 1.945 & 11.0 & 1.5  \\
[\ion{Fe}{ii}]\,a$^4$D$_{3/2}$-a$^6$D$_{3/2}$ & 1.279 & 7.8 & 0.1  &   H$_2$ 2-1 S(4)             & 2.004 & 2.7 & 0.3 \\
[\ion{Fe}{ii}]\,a$^4$D$_{5/2}$-a$^6$D$_{5/2}$ & 1.295 & 11.9 & 0.9 &   H$_2$ 1-0 S(2)             & 2.034 & 26.1 & 0.6 \\
[\ion{Fe}{ii}]\,a$^4$D$_{3/2}$-a$^6$D$_{1/2}$ & 1.298 & 6.7 & 0.1 &    H$_2$ 2-1 S(3)             & 2.074 & 8.1 & 0.5  \\
[\ion{Fe}{ii}]\,a$^4$D$_{7/2}$-a$^6$D$_{7/2}$ & 1.321 & 306.0 & 0.8  &     H$_2$ 1-0 S(1)             & 2.122 & 68.5 & 0.3 \\
[\ion{Fe}{ii}]\,a$^4$D$_{5/2}$-a$^6$D$_{3/2}$ & 1.328 & 8.4 & 0.9  &   H$_2$ 2-1 S(2)             & 2.154 & 3.9 & 0.3   \\
[\ion{Fe}{ii}]\,a$^4$D$_{7/2}$-a$^6$D$_{5/2}$ & 1.372 & 71.7 & 1.0 &   H$_2$ 2-1 S(1)                 & 2.248 & 8.5 & 0.5 \\
[\ion{Fe}{ii}]\,a$^4$D$_{5/2}$-a$^4$F$_{9/2}$ & 1.534 & 173.0 & 0.7 &  H$_2$ 3-2 S(1)             & 2.386 & 1.6 & 0.4\\
[\ion{Fe}{ii}]\,a$^4$D$_{3/2}$-a$^4$F$_{7/2}$ & 1.600 & 10.6 & 0.5 &   H$_2$ 1-0 Q(1)             & 2.407 & 50.0 & 0.8     \\
[\ion{Fe}{ii}]\,a$^4$D$_{7/2}$-a$^4$F$_{9/2}$ & 1.644 & 160.0 & 0.6 &      H$_2$ 1-0 Q(2)                 & 2.413 & 18.3 & 0.9     \\
[\ion{Fe}{ii}]\,a$^4$D$_{1/2}$-a$^4$F$_{5/2}$ & 1.664 & 7.0 & 0.7 &    H$_2$ 1-0 Q(3)             & 2.424 & 47.4 & 0.9  \\
[\ion{Fe}{ii}]\,a$^4$D$_{5/2}$-a$^4$F$_{7/2}$ & 1.677 & 142.0 & 0.3 &  H$_2$ 1-0 Q(4)                     & 2.437 & 18.9 & 1.3 \\
H$_2$ 1-0 S(9)             & 1.687 & 4.2 & 0.5 &    H$_2$ 1-0 Q(5)             & 2.455 & 42.9 & 1.5    \\
[\ion{Fe}{ii}]\,a$^4$D$_{3/2}$-a$^4$F$_{5/2}$ & 1.712 & 2.1 & 0.4 &    H$_2$ 1-0 Q(5)             & 2.455 & 42.9 & 1.5    \\
[\ion{Fe}{ii}]\,a$^4$D$_{1/2}$-a$^4$F$_{3/2}^*$\footnotetext{$^*$Blend of the two indicated lines.}
                   & 1.745 & 6.3 & 0.8 &    H$_2$ 1-0 Q(7)           & 2.500 & 47.4 & 3.7  \\
H$_2$ 1-0 S(7)$^*$             & 1.748 & 150.0 & 0.6&                   &   &   &   \\

\hline
\end{tabular}
%~ $^*$ Blend of the two indicated lines.\\
\end{minipage}
\end{table*}
```

We now extend this previous study to the HH46-47 jet. This known Class I jet is at a distance of $\sim$`<!-- -->`{=html}450 pc emerging from a dense reflecting nebula. The jet is located at the border of a Bok globule and powers an atomic and molecular bipolar flow. The driving source (HH46-IRS) is in a phase of high accretion () and is known to be a deeply embedded binary system (). The northeastern (blue-shifted) portion of the flow is detected at optical wavelengths giving rise to strong HH objects . Recently, the kinematics of the internal region of this optical jet has been studied in details by . At infrared wavelengths, the HH46 jet and its red-shifted counter-jet are detected down to the central source (), thus this object represents a very suitable target for our NIR spectroscopy study.

In Sect. 2, we present the observations and the data reduction. In Sect. 3 we describe the results of our observations, while the kinematics of the atomic and molecular components are presented in Sect. 4. In Sect. 5 and 6 we describe the spectral diagnostic analysis applied to ISAAC spectra obtained at low and medium resolution, respectively. We have compared the results found on the HH46-47 jet with the HH34 jet in Sect. 7 and the main conclusions of our work are finally summarised in Sect. 8.

# Observations and data reduction

The observations were made on 29-30 December 2004 at ESO VLT telescope on Cerro Paranal, Chile, using the infrared spectrograph and camera ISAAC. The spatial scale of the instrument is 0 148/pixel. We have taken low resolution spectra in the J-band (1.1-1.4 $\mu$m ) and both, medium and low resolution spectra in the H (1.42-1.82 $\mu$m) and K (1.82-2.5 $\mu$m) bands. The adopted slit width were 0 and 0 for the low and medium resolution, respectively, corresponding to nominal resolutions of 860 (in J), 840 (in H) and 750 (in K) at low resolution (LR) and 10 000 (in H) and 8900 (in K) at medium resolution (MR). The slits were all aligned along the jet, with a position angle (P.A.) of $\sim$`<!-- -->`{=html}57. Total integration times were 600 s for each filter in the LR mode and, 3600 s and 7200 s for the K- and H-band in the MR mode.

Data reduction was performed using standard IRAF[^2] tasks. Wavelength calibration was done using the atmospheric OH emission at MR and an argon lamp at LR. The atmospheric spectral response was corrected by dividing the object spectra by the spectrum of a telluric standard star for both modes. Flux calibrations were performed using photometric standards observed at an air mass and seeing similar to our target observations. This procedure probably leads to some flux losses due to the finite slit width with respect to the jet width, especially in the case of the bow shaped knot Z1. In MR spectroscopy, the continuum of the HH46-IRS source was subtracted using the IRAF task BACKGROUND.

The reduced MR spectra on the source position have been already presented in (reduced and analysed in the same way as explained above) and thus they will not be discussed in the present paper.

# Results

Fig.  shows a H$_2$ 2.12 $\mu$m continuum-subtracted image of the HH46-47 jet. The slit position is depicted over the image and the covered knots are named following the nomenclature of . In addition, we name as knot S the emission that peaks at the source position and extends for $\sim$`<!-- -->`{=html}3 in the blue-shifted jet. The observations cover the blue-shifted jet knots HH46-1 and 2 and the knot B8, which is located at the apex of a bow shock. In the red-shifted lobe, the slit comprises knots Z and Y in that have been here separated in knots Z1 and Z2, and Y1, Y2 and Y3.

The low resolution spectra present several lines of both atomic and molecular species in the different knots. Figure  shows the complete spectrum of knot Z1, which is among the brightest ones along the jet. A list of the observed lines, fluxes and identification in knot Z1 is also reported in Table , while Tables  and in the Appendix  list all the lines detected in the other knots. \[\] transitions from the first 12 fine-structure levels, and H$_2$ transitions from the two first vibrational levels have been detected in all of the knots at various intensity levels. The knot S is, together with the knot Z1, the richest in ionic lines. Here \[\] $^3P_2-^1D_2$ 1.189 $\mu$mhas also been detected.

The medium resolution K-band spectra show several lines, the brightest being H$_2$ 1-0S(1), 3-2S(4) and 2-1S(2), \[\] 2.1349 and 2.1609 $\mu$m  and Br$\gamma$ (see, Fig. ). In addition, the \[\] 1.600 and 1.644 $\mu$m lines have been detected in the H-band spectra. The presence of the Br$\gamma$ near the source and the H$_2$ 3-2S(4) line at a distance of 10 to 25 from HH46-IRS testifies to the high excitation conditions in these regions. In addition, the on-source spectrum shows other features, as the Br14 and Br12 and CO transitions (see also, ).

# Kinematics

In order to study the kinematics of the atomic and molecular component of the HH46-47 jet as a function of distance from the central source, we have constructed Position Velocity Diagrams (PVDs) of the \[\] 1.644 $\mu$m  and H$_2$ 2.122 $\mu$m lines (see, Fig. ) from the MR spectral images. The velocity has been expressed with respect to the Local Standard of Rest (LSR) and corrected for a parental cloud velocity of +20 km s$^{-1}$  (). In the Y-axis the distance from the driving source HH46-IRS, in arcsec, is represented. The continuum of the source has been subtracted in both the PVDs to more clearly see the structure of the lines near HH46-IRS. The intensity scale is different in the two PVDs in order to show the different condensations in the atomic and molecular gas.

Emission down to the central source is detected for both the atomic and molecular components (knot S). The \[\]  emission broaden as it approaches the source position and spans velocities from $\sim$ -200 km s$^{-1}$ down to 0 km s$^{-1}$ within 2  from the source. Inside 1  there is also emission at red-shifted velocities up to $\sim$ +100 km s$^{-1}$. We will call the blue-shifted component at high velocity that can be traced up to large scale the high velocity component (HVC) and the more compact emission component from $\sim$ -150 km s$^{-1}$ to $\sim$ 0 km s$^{-1}$ the low velocity component (LVC). These two components have been also evidenced in H$\alpha$ optical observations . At variance with the ionic emission, the H$_2$ emission close to the source (knot S) shows only one component at nearly 0 km s$^{-1}$.

The radial velocities of the \[\] 1.644 $\mu$m and H$_2$ 2.122 $\mu$m lines are reported in Table . They have been computed by a Gaussian-fit to the line profile of every knot. The velocities of the \[\] emission range from -235 km s$^{-1}$ to -177 km s$^{-1}$ and from +144 km s$^{-1}$ to +94 km s$^{-1}$ in the blue- and red-lobes, respectively: thus in both lobes the peak velocity decreases as the distance from the driving source increases in both lobes. The HVC and LVC in knot S peak at -213 km s$^{-1}$ and around -138 km s$^{-1}$. At knot Z2 the emission splits in two separate velocity components (at +144 km s$^{-1}$ and +92 km s$^{-1}$) whose origin is likely connected with the presence of the large bow shock structure.

The radial velocities of the H$_2$ emission vary from -15 km s$^{-1}$ to -48 km s$^{-1}$ in the blue-lobe an from +26 km s$^{-1}$ to +94 km s$^{-1}$ in the red-lobe. At variance with the \[\] emission, knot S only shows a single velocity component at -15km s$^{-1}$ while both knots Z1 and X present two velocity components at $\sim$ +90 km s$^{-1}$  and +10 km s$^{-1}$. The high and low velocity components present in these knots and the broad profiles seen in H$_2$ (see, Fig. ) are similar to the profiles observed in other molecular jets (e.g., ). As shown in Fig. , the relative contribution of the high and low velocities components to the total flux changes from knot Z1 (where the component at 0 km s$^{-1}$ is larger than that at high velocity) to knot X (where the component at 0 km s$^{-1}$ is significantly reduced). These profiles are similar to those expected from bow-shocks structures viewed at a certain inclination angle (). With respect to the models, the HVC and LVC contribution to the total flux depends, in our case, not only on the viewing angle of the bow-shock but also on how the H$_2$ cooling is distributed from the apex to the wings of the bow. In particular, the profiles of the knots Z1 and X are consistent with bow-shocks seen at 30 with respect to the line of sight, but with a different relative contribution to the H$_2$ cooling between the apex and the wing. In knot X the apex mostly contribute to the total flux while in knot Z1 the situation is the opposite. Such an effect could be actually due to a not good alignment of the slit with the bow-shock apex in knot Z1.

|        |                    |                     |     |
|:------:|:------------------:|:-------------------:|:---:|
|        |                    |                     |     |
|  Knot  | \[\] 1.644 $\mu$m  | H$_2$ 2.122 $\mu$m  |     |
|        |  v(km s$^{-1}$ )   |   v(km s$^{-1}$ )   |     |
|        |                    |                     |     |
|   B8   |        -177        |                     |     |
| HH46-1 |        -235        |         -20         |     |
|   S    |    -213,(-138)     |         -15         |     |
|   Z2   |     +144, +92      |         +26         |     |
|   Z1   |        +112        |      +89, +10       |     |
|   X    |        +94         |      +93, +14       |     |
|   Y3   |                    |         +94         |     |
|   Y2   |                    |         +92         |     |
|   Y1   |                    |         +92         |     |

Observed radial velocities along the HH46-47 jet.

 Note: Radial velocities corrected from a cloud velocity of +20 km s$^{-1}$ () and with respect to the LSR. The radial velocity error is 2 km s$^{-1}$.

# Low resolution spectral analysis

## Extinction

Visual extinction values can be derived from the \[\] 1.644/1.257 $\mu$m ratio: these lines share the same upper level and thus, their theoretical ratio is a function of the frequencies and probabilities of the transition and are independent of the plasma conditions. To convert the observed ratios into $A_v$ values, we have adopted the radiative transition probabilities given by using the relativistic Hartree-Fock (HFR) computer program. The extinction errors have been estimated directly from the flux error of each line. The results are reported in Table  for the individual knots where the S/N of the two lines is larger than 10.

|      |                                  |
|:----:|:--------------------------------:|
|      |                                  |
| Knot | A$_V\pm \bigtriangleup$A$_V$[^3] |
|      |              (mag)               |
|      |                                  |
|  S   |   6.6$\pm$`<!-- -->`{=html}0.2   |
|  Z2  |  12.5$\pm$`<!-- -->`{=html}1.6   |
|  Z1  |   6.1$\pm$`<!-- -->`{=html}0.1   |

A$_V$ along the HH46-47 jet.

A$_V$ varies from $\sim$`<!-- -->`{=html}6 in the knots Z1 and S to $\sim$`<!-- -->`{=html}12 in the knot Z2. found a value of A$_V=9.38\pm\,1.49$ mag in a region that covers our knots HH46-1 and S. This value has been however derived employing the theoretical \[\] 1.644/1.257 $\mu$m ratio given by the radiative rates of that predict higher values with respect to the rates (). On the other hand, found an A$_V\,\sim$`<!-- -->`{=html}40 mag on-source, indicating a large density gradient towards the central object. One should note here that the extinction found by on the basis of photometric measurements coupled with Br$\gamma$ emission, is larger than the one we found on the knot S, since \[\] lines trace more external regions. In addition, the knot S covers a region that extends $\sim$`<!-- -->`{=html}3 around the source position.

The extinction in the knot Z2 is roughly twice the extinction of the knots S and Z1. This fact could be due to the collision of the jet with stationary material on a side of the cavity. note the presence of an oblique shock due to the impact of the blue-shifted lobe of the jet with the cavity at $\sim$`<!-- -->`{=html}6 NE of the source. The same process may occur at the same distance in the red-shifted counter-lobe, giving rise to an increase in extinction.

|  |  |  |  |  |
|:--:|:--:|:--:|:--:|:--:|
|  |  |  |  |  |
| Knot | $dv_t^a$ | T$^b$ | N(H$_2$)$^c$ | $\dot{M}_{H_2}$$^d$ |
|  | (km s$^{-1}$) | \(K\) | (10$^{17}$ cm$^{-2}$) | (M$_{\odot}$ yr$^{-1}$) |
|  |  |  |  |  |
| Z1 | 131 | $2797\pm100$ | 3.3 | 4.5$\times$`<!-- -->`{=html}10$^{-9}$ |
| X | 19 | $2078\pm42$ | 3.7 | 7.3$\times$`<!-- -->`{=html}10$^{-10}$ |
| Y3 | 122 | $2564\pm53$ | 3.6 | 4.6$\times$`<!-- -->`{=html}10$^{-9}$ |
| Y2 | 122 | $2330\pm50$ | 5.1 | 6.4$\times$`<!-- -->`{=html}10$^{-9}$ |
| Y1 | 122 | $2093\pm42$ | 2.4 | 3.0$\times$`<!-- -->`{=html}10$^{-9}$ |

d$v_t$, T, N($H_2$), $\dot{M}_{H_2}$ along the HH46-47 jet.

  $^a$ Tangential velocities from . $^b$ H$_2$ temperature. $^c$ H$_2$ column density. $^d$ H$_2$ mass ejection rate

## H$_2$ temperature and mass flux

Using the different H$_2$ detected transitions, excitation diagrams for several knots (Z1, X, Y3, Y2 and Y1) along the jet showing enough H$_2$ lines have been constructed. As an example, Fig.  shows the excitation diagram of the knot Z1, the brightest knot observed in HH46-47. The excitation diagrams for the rest of the knots are reported in the Appendix . In this kind of diagrams the natural logarithm of $N(\nu\,,J)/g_{\nu\,,J}$ versus the excitation energy $E(\nu\,,J)$ of a given level $(\nu\,,J)$ is represented, where $N(\nu\,,J)/g_{\nu\,,J}$ is the ratio of the column density over the statistical weight. The different symbols indicate lines coming from different vibrational levels, while the straight line represents the best linear fit through our data. The slope of the line is proportional to the inverse of the gas temperature. Extinction values as derived from the \[\] lines have been adopted. The extinction can, in principle, be also derived from the H$_2$ 1-0S(1)/1-0Q(3) line ratio. However, this method involves lines close in wavelength and thus it is not sensitive enough to extinction variations. In addition, the Q lines fall in a poor atmospheric transition region (around $\sim$`<!-- -->`{=html}2.3 $\mu$m) being their fluxes affected by large uncertainties. The fact that our data can be well traced by a straight line on the rovibrational diagram indicates, however, that the extinction values derived from the \[\] lines are in good agreement with the H$_2$ ones. The resulting temperature values are indicated in Table 4 and range between $\sim$`<!-- -->`{=html}2000 K and $\sim$`<!-- -->`{=html}2800 K.

The mass flux carried out by the warm molecular component ($\dot{M}_{H_2}$) has been also estimated from the observed H$_2$ transitions in the knots Z1, X, Y3, Y2 and Y1. $\dot{M}_{H_2}$ can be inferred from the relationship $\dot{M}_{H_2}$=$2\, N(H_2)\, A\, dv_t / dl_t$. Here, A is the area of the emitting region sampled by the slit, $dl_t$ and $dv_t$ are the projected length and the tangential velocity, and $N(H_2)$ is the total column density. $\dot{M}_{H_2}$ has been derived in the same spatial region extracted for the \[\] line analysis. The $dv_t$ value has been taken from , while $N(H_2)$ for each knot has been found from the intercept to zero of the straight line fitted to the H$_2$  transitions in the Boltzmann diagram. The derived values for each knot are reported in Table . The average $\dot{M}_{H_2}$ value along the jet is $\sim3.8\times10^{-9}$ M$_{\odot}$ yr$^{-1}$. This estimate is however a lower limit since we are only considering the warm component of the gas.

## Electron density

The electron density (n$_e$) can be derived from \[\]  lines coming from levels with similar excitation energies. This is the case of the ratio \[\] 1.600/1.644 $\mu$m , which is sensitive to n$_e$ values between $10^3-10^5 cm^{-3}$ and weakly dependent on the temperature . This ratio has been fitted with a NLTE code including the first 16 fine-structure levels of the \[\] ().

|  |  |  |  |  |
|:--:|:--:|:--:|:--:|:--:|
|  |  |  |  |  |
| Knot | r$_t$[^4] | n$_e\pm \bigtriangleup$n$_e$[^5] | n$_e$(HVC)[^6] | n$_e$(LVC)$^b$ |
|  | ( ) | (cm$^{-3}$) | (cm$^{-3}$) | (cm$^{-3}$) |
|  |  |  |  |  |
| S | (-3.4,+2.8) | 6300$^{+1700}_{-1300}$ | 5400 | 7650 |
| Z2 | (-9.3,-5) | 1300$^{+1800}_{-1200}$ | 2350 | 4600 |
| Z1 | (-14.8,-9.3) | 3200$^{+700}_{-850}$ | 3100 |  |

Electron density along the HH46-47 jet.

The electron density has been derived integrating the total flux of the line profile of every extracted knot for both lines. The n$_e$  values and the intervals used to extract the knots are reported in Table . Previous studies on protostellar jets, like HH1, HH111 and HH34, have shown evidences of a decrease of the electron density with distance (see, e.g., ). The same behaviour may also occur in HH46-47. Indeed the electron density roughly decreases from a value of 6300 cm$^{-3}$ in knot S to a value of 3200 cm$^{-3}$ in knot Z1. These two knots are displaced, however, in different lobes of the jet. In addition, the increase of n$_e$ from knot Z2 to knot Z1 and the the lack of further \[\] emitting knots prevent us to properly probe the dependence on distance of n$_e$.

## \[\] depletion

Refractory such species as iron are expected to be locked into dust grains in the quiescent conditions of molecular clouds. High velocity shocks inside the jet beam are, however, supposed to destroy the grains and release Fe atoms in gaseous form. In recent years several studies have been done in order to quantify the presence of dust along protostellar jets and measure the shock efficiency in disrupting the dust grain cores (see e.g., ). The iron gas phase abundance can be measured comparing the emission of \[\] with that of a non-refractory species of known abundance. A very suitable ratio is the one between the \[\] 1.257 $\mu$m line and the \[\] 1.188 $\mu$m line . These two lines are very close in wavelength and thus their ratio is poorly affected by extinction. In addition, both lines are excited under similar conditions and can be assumed in the first ionised state at similar percentage. Assuming a solar abundance for both elements, the expected theoretical line ratio is \[\] / \[\]$\sim$`<!-- -->`{=html}1/2 \[Fe / P\]$\sim$`<!-- -->`{=html}56 . Thus, observed values lower than this indicate that some of the iron is locked in grains.

Along the HH46-47 jet, both the \[\] 1.257 $\mu$m  and the \[\] 1.188 $\mu$m lines have been detected in knots S and Z1. The measured \[\] / \[\] ratio is $\sim$`<!-- -->`{=html}7.3 in knot S and $\sim$`<!-- -->`{=html}25.6 in knot Z1. These values indicate that around 88% and 58% of iron is still in dust grains in knots S and Z1, respectively. This leads to a ratio (Fe/H)$_{gas}\sim3.92\times10^{-6}$ in the knot S and a (Fe/H)$_{gas}\sim1.18\times10^{-5}$ in the knot Z1. The strong iron depletion at the jet base is still lower than the 99% diffuse gas iron depletion (see, e.g., ), indicating that a small fraction of the iron have come back into gas phase at the base of the jet with respect to the interstellar value. Evidence that the gas phase iron abundance is low in knots close to the source and increases with the distance have been also found in the HH1 jet ().

In knot Z1, the \[\] 1.140 $\mu$m line has been also detected. Ti is expected to be fully ionised in the jet plasma, since it has a low ionisation potential of 6.82 eV. As iron, the titanium is a high-refactory element and thus the Fe/Ti ratio can give us some clues about the relative abundance of both elements, as well as to the selective depletion pattern of both elements in the dust along protostellar jets. With this aim we have computed the \[\] 1.257 $\mu$m/ \[\] 1.140 $\mu$m intensity ratio using a NLTE model for these species . The observed ratio, assuming the physical conditions present in knot Z1 is $\sim$`<!-- -->`{=html}70, indicating a Fe/Ti ratio 5 times smaller than the theorically expected of \[Fe/Ti\]$_\odot$ = 354 using the solar abundances of . The small Fe/Ti is consistent with what found in the HH1 jet , where a Fe/Ti ratio 2-3 times lower than solar was derived.

# Medium resolution spectral analysis

## Electron density and Mass flux

The \[\] 1.600 and 1.644 $\mu$m  lines have been also detected at medium resolution in the knots S, Z1 and Z2. In these knots, we can test how the electron density varies as a function of the radial velocity, by measuring the 1.600/1.644 $\mu$m  ratio in each pixel along the spectral profile. The \[\]  ratio was computed only for the velocity points where the intensity is greater than S/N $\sim$ 3. Figure  shows electron density variations along the MR spectral profile of the knots S, Z1 and Z2 (upper panels) together with the normalised line profile of the \[\] 1.600 $\mu$m and 1.644 $\mu$m  lines (lower panels). The electron density increases as the velocity decreases in all of the knots where two velocity components were detected in \[\]. In particular, the knot S close to the source has a behaviour very similar to what was found in HH34 (), with the electron densities higher in the gas at low velocity. We have separately measured the n$_e$ in the HVC and LVC components. Near to the source (knot S), we have defined a HVC ranging from $\sim$-239 km s$^{-1}$  to $\sim$-181 km s$^{-1}$ (consistent with the FWHM of a Gaussian-fit through the line), and a LVC from $\sim$-181 km s$^{-1}$  to $\sim$-50 km s$^{-1}$. Far from the source, only the knot Z2 shows a clear double velocity component: here we have defined the intervals from $\sim$`<!-- -->`{=html}110 km s$^{-1}$  to $\sim$`<!-- -->`{=html}167 km s$^{-1}$  and from $\sim$`<!-- -->`{=html}80 km s$^{-1}$  to $\sim$`<!-- -->`{=html}110 km s$^{-1}$  for the high and low velocity gas, respectively.

The n$_e$ values for the integrated velocity components are reported in Table . The electron density of the LVC (n$_e$(LVC)$\sim$`<!-- -->`{=html}4600-7600) is larger than the electron density of the HVC (n$_e$(HVC)$\sim$`<!-- -->`{=html}2300-5000) as evidenced by Fig. . The behaviour found in knot S is similar to what we have already found at the HH34 jet base, and contrast with the results on T Tauri stars, where the highest electron density is associated with the high velocity gas pertaining to the more collimated inner jet section, while the low velocity component is a less collimated gas at lower density (e.g., ). These contrasting results may reflect a different excitation conditions in the structure of Class I jets, or may be a result biased by the low spatial resolution of our observations that does not allow us to resolve the same spatial scales probed in T Tauri jets, namely within 100-200 AU.

At the bow shock positions far from the source, like in the Z2 knot, variations of the electron density with velocity may depends on the bow inclination angle and section of the bow intercepted by the slit, as shown by . According to this model, a bow shock seen on-axis at an inclination angle of $\sim$`<!-- -->`{=html}30 degree, as in our case, shows qualitatively a behaviour like the one we observe, namely with the highest electron densities displaced at low velocity.

|  |  |  |  |  |
|:--:|:--:|:--:|:--:|:--:|
|  |  |  |  |  |
| Knot | dv$_t$(HVC)[^7] | $\dot{M}_{jet}$(HVC)[^8] | dv$_t$(LVC)$^a$ | $\dot{M}_{jet}$(LVC)$^{b}$ |
|  | km s$^{-1}$ | 10$^{-7}$ M$_{\odot}$ yr$^{-1}$ | km s$^{-1}$ | 10$^{-8}$ M$_{\odot}$ yr$^{-1}$ |
|  |  |  |  |  |
| S | 316 | 0.3-1.9 | 205 | 0.5-3.6 |
| Z2 | 213 | 0.4-0.9 | 136 | 0.2-0.4 |
| Z1 | 166 | 0.4-1.0 |  |  |

$\dot{M}_{jet}$ along the HH46-47 jet.

In order to compute the contribution to the mass flux of the atomic component, we have derived $\dot{M}_{jet}$  from the luminosity of the \[\] 1.644 $\mu$m  line, following the approach described in . To compute the theoretical \[\]  lines fractional population, the n$_e$ values derived separately for the LV and HV components have been assumed. A constant value of 10 000 K have been instead assumed for the electron temperature: the derived populations are only a little sensitive to this value and the results do not change significantly if the temperature is maintained in between $\sim$ 7000 K and 15 000 K. An inclination angle of the jet with respect to the plane of the sky, $i\sim34\degr$ (), has been assumed and used to infer the velocity of the knots projected perpendicular to the line of sight through our measurements of the radial velocity. These values are reported in Table , while the adopted length of the knots projected perpendicular to the line of sight is listed in Table . The \[\] 1.644 $\mu$m line flux has been dereddened using the extinction derived from the ratio \[\] 1.644/1.257 and reported in Table .

$\dot{M}_{jet}$ values have been derived both assuming a solar abundance of iron and considering the gas-phase Fe abundance measured from the Fe/P analysis, in the assumption that the same dust depletion factor is valid for both the HVC and LVC. The corresponding range of values are listed in Table . Values of the order of 0.5-1$\times$`<!-- -->`{=html}10$^{-7}$ M$_{\odot}$ yr$^{-1}$ are found in the HVC, while the LVC shows $\sim16$ times lower values.

# Discussion

The \[\] and H$_2$ emission structure at the base of HH46-47 is very similar to the one observed in several Class I jets (e.g., ). As in the case of CTTS jets, the Forbidden-Emission Line (FEL) regions of Class I jets are characterised by the presence of two velocity components at the jet base at high and low velocity. The MHEL regions, as traced by H$_2$ emission, show on contrast just a LVC near the source while higher velocity H$_2$ is usually detected further downsteam. In particular, the kinematics and physical parameters of the HH46-47 jet are very similar to those found in our previous work about HH34 where the physical properties have been also derived as a function of velocity. For instance, Fig.   shows the \[\] 1.644 $\mu$m PVDs of the inner region of these two jets. Since the two objects are at a similar distance ( i.e. 450 pc), the emission regions have the same physical extent in this figure. In both the PVDs, the \[\] lines broaden and emission at lower velocities, down to 0 km s$^{-1}$ appears within $\sim$`<!-- -->`{=html}2 from the central source, i.e. up to distances of $\sim$`<!-- -->`{=html}1000 AU. The extend of the LVC is comparable with the typical size of the envelope of Class I sources (see, e.g., ). Thus this result may indicate an interaction of a low-velocity disc wind with the source envelope as the possible origin of the LVC in Class I jets. The large extend of the LVC is at variance with the PVDs of most of the CTT, where the LVC is usually confined within $\sim$ 200 AU from the source .

Also the values of electron density and mass flux rate that we derive in HH46-47, as well as their dependence with velocity are similar to those inferred on HH34, i.e., $n_e$ $\sim$ 0.5-1$\times$`<!-- -->`{=html}10$^4$ cm$^{-3}$ in the HVC and $\sim$`<!-- -->`{=html}1-2$\times$`<!-- -->`{=html}10$^4$ cm$^{-3}$ in the LVC, and $\dot{M}_{jet}$  of the order 10$^{-7}$ M$_{\odot}$ yr$^{-1}$. Similar values have been also estimated on a number of Class I YSO jets (e.g., ).

At variance with \[\], the H$_2$ PVDs of HH46-47 shows a different behaviour with respect to the one of HH34. In HH34 the H$_2$ PVD shows spatially- and kinematically-separated LVC and HVC, and only the LVC is visible down to the central source. In HH46-47,on the contrary, a single velocity component near the source is detected. The morphology and kinematics of the H$_2$ close to the source (the so-called Molecular Emission Line, MHEL, regions; ) in class I objects varies indeed significantly from source to source and this is another element that makes the origin of the MHEL regions unclear.

In we have compared the \[\] 1.644 $\mu$m PVDs of HH34 with those of the synthetic PVDs available for the disc-wind and X-wind models . Most of this discussion is also valid for the HH46-47 jet. Briefly, none of these models are able to explain the persistency of the LVC at large distances from the launching regions. This may suggest that the low velocity that we observe far from the source represent dense gas entrained by the high-velocity collimated jet, rather than gas directly ejected from the acceleration region.

From the observed HH46-47 peak radial velocity of the HVC, corrected for the inclination angle, we estimate a jet poloidal velocity around 350 km s$^{-1}$. This value is just at the border of the range of poloidal velocities predicted by X-wind models and it is also in agreement with disc-wind models with launching radii in the range 0.07-0.15 AU and magnetic lever arms larger than $\sim$ 5 .

Further constraints on MHD launching models may be derived from the presence of dust in the initial beam of the HH46-47 jet, as suggested by . We have in fact seen that around 88% of the iron within 450 AU from the source is depleted, implying that a large fraction of dust grains are still present at the jet base. Dust grains of the ambient medium are expected to be destroyed by the passage of the initial leading bow-shock, that have velocities higher than 100 km s$^{-1}$ . Since the amount of iron depletion decreases toward the external knots (only 58% of iron is found to be depleted in grains at $\sim$`<!-- -->`{=html}5000 AU from the source) dust grains are unlikely to come from entrained material. In addition they cannot be reformed along the jet beam since the time required for grain reformation is $\sim$`<!-- -->`{=html}10$^7$-10$^8$ yr , while the jet takes $\sim$`<!-- -->`{=html}1300 yr to travel from the central source to the final bow-shock . Therefore, the larger amount of grains near the source may suggest that they have been removed from the accretion disc and transported through the jet. Interestingly it has been showed that, in the case of Herbig stars and TTauri stars, the disc is populated by dust grains only beyond the so-called dust evaporation point, R$_{evp}$ . Future similar measurements of R$_{evp}$ for Class 0/I sources would help to constraint the region from which dusty jets are launched from.

# Conclusions

We have presented medium resolution (MR) (in the H- and K- band) and low resolution (LR) (in the J-, H- and K-band) spectra of the Class I driven HH46-47 jet. These observations allow us to resolve two velocity components at the jet base and to study the kinematics and physical properties of the jet as a function of velocity. From the \[\] 1.644/1.600 $\mu$m lines the electron density has been derived along the jet and as a function of velocity. In addition, from the luminosity of the \[\] 1.644 $\mu$m line the mass flux for the different velocity components has been derived. Finally, the \[\] / \[\] ratio has been used to retrieve important information about the dust depletion inside the jet beam. We summarise our results as follows:

-   We were able to trace the HH46-47 jet down to the central source. While the atomic component shows a HVC and LVC near the source, only a single velocity component has been detected for the molecular gas. Within 1 from the source, the atomic emission broaden down to 0 km s$^{-1}$ and even reaches red-shifted velocities.

-   From the ratio of the \[\] 1.644, 1.257 $\mu$m lines detected in the LR spectra, the visual extinction for different knots have been derived. We have found an A$_V$ ranging from $\sim$`<!-- -->`{=html}6 mag to $\sim$`<!-- -->`{=html}12 mag along the jet.

-   Several H$_2$ lines have been detected from the LR spectra allowing us to construct excitation diagrams for different knots. From these diagrams we have derived the temperature and mass flux for the warm molecular component of the jet. The temperature has an average value around $\sim$`<!-- -->`{=html}2300 K, while we have found an average mass flux for the warm molecular component of $\gtrsim 3.7\times10^{-9}$ M$\odot$ yr$^{-1}$.

-   The electron density, derived from the \[\] 1.600/1.644 $\mu$m ratio, roughly decreases from the internal to the more external knots from 9400 to 3200 cm$^{-3}$. Larger electron density values are found in the LVC with respect to the HVC for all the extracted knots, with an average value of $\sim$`<!-- -->`{=html}6000 and $\sim$`<!-- -->`{=html}4000 cm$^{-3}$ for the LVC and HVC, respectively.

-   From the \[\] / \[\] ratio, we have estimated the iron depletion in the knots S and Z1. We have found that around 88% and 58% of the iron is depleted in grains in the knot S and Z1.

-   The mass flux rate transported by the \[\] has been derived for both the velocity components assuming the Fe gas-phase abundance derived in this paper. We found that the HVC is transporting the bulk of the mass along the jet, with average values of $\dot{M}_{jet}$(HVC)$\sim$`<!-- -->`{=html}1.2$\times$`<!-- -->`{=html}10$^{-7}$ M$_{\odot}$ yr$^{-1}$ and $\dot{M}_{jet}$(LVC)$\sim$`<!-- -->`{=html}2$\times$`<!-- -->`{=html}10$^{-8}$ M$_{\odot}$ yr$^{-1}$. As in the case of HH34 (), the difference in tangential velocity between the HVC and LVC is not enough to account for the much hihger $\dot{M}_{jet}$ value in the HVC, indicating a significantly larger value of the (n$_H$V)[^9] product in the HVC than in the LVC (from a factor $\sim$`<!-- -->`{=html}1.5 in the knot Z2 to $\sim$`<!-- -->`{=html}3.5 in knot S).

-   Many of the derived properties of the HH46-47 are common to jets from YSOs in different evolutionary states. The derived densities and mass flux values are typical of Class I objects or very active T Tauri stars. However, the observed spatial extent of the LVC and the velocity dependence of the electron density are not explained by the current jet formation models.

```latex
\begin{appendix}
\onecolumn
\section{knot fluxes at low resolution}
\label{app:fluxes}

%%%%%%%%%%%%%%%%%%%%%%  knot fluxes, atomic lines %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{table}[!h]
\begin{minipage}[t]{\textwidth}
\caption{Observed unreddened lines along HH46-47: atomic lines.}
\label{tab:atomic_fluxes}
\centering
\vspace{0.1cm}
\renewcommand{\footnoterule}{}  % to avoid a line before footnotes
    \begin{tabular}[h]{ccccccc}
 \hline     \hline \\[-5pt]

Line id. & $\lambda$($\mu$m) & \multicolumn{5}{c}{F ($\Delta$ F)(10$^{-16}$erg s$^{-1}$cm$^{-2}$)} \\
        &                      &   S      & HH46-1   & B8       & Z2       & X    \\
\hline \\[-5pt]
[\ion{P}{ii}]\,$^3$P$_{2}$-$^1$D$_{2}$      & 1.188 & 6.2(1.2) & ...      & ...      & ...      & ...      \\
[\ion{Fe}{ii}]\,a$^4$D$_{5/2}$-a$^6$D$_{7/2}$ & 1.249 & 1.9(0.6) & ...      & ...      & ...      & ...      \\
[\ion{Fe}{ii}]\,a$^4$D$_{7/2}$-a$^6$D$_{9/2}$ & 1.257 & 54.2(0.8)& 15.8(0.9)& 11.9(0.7)& 7.1(0.9) & 6.4(1.0) \\
[\ion{Fe}{ii}]\,a$^2$G$_{9/2}$-a$^4$D$_{7/2}$ & 1.267 & 3.2(0.8) & ...      & ...      & ...      & ...      \\
[\ion{Fe}{ii}]\,a$^4$D$_{1/2}$-a$^6$D$_{1/2}$ & 1.271 & 2.0(0.3) & ...      & ...      & ...      & ...      \\
[\ion{Fe}{ii}]\,a$^4$D$_{3/2}$-a$^6$D$_{3/2}$ & 1.279 & 2.4(0.6) & ...      & ...      & ...      & ...      \\
[\ion{Fe}{ii}]\,a$^4$D$_{5/2}$-a$^6$D$_{5/2}$ & 1.295 & 8.9(1.1) & ...      & ...      & ...      & ...      \\
[\ion{Fe}{ii}]\,a$^4$D$_{3/2}$-a$^6$D$_{1/2}$ & 1.298 & 3.4(0.9) & ...      & ...      & ...      & ...      \\
[\ion{Fe}{ii}]\,a$^2$G$_{7/2}$-a$^4$D$_{3/2}$ & 1.300 & 1.7(0.6) & ...      & ...      & ...      & ...      \\
[\ion{Fe}{ii}]\,a$^4$D$_{7/2}$-a$^6$D$_{7/2}$ & 1.321 & 13.1(0.4)& 4.5(1.4) & 3.5(0.5) & 3.0(1.2) & 2.4(1.2) \\
[\ion{Fe}{ii}]\,a$^4$D$_{5/2}$-a$^6$D$_{3/2}$ & 1.328 & 4.3(0.6) & ...      & ...      & ...      & ...      \\
[\ion{Fe}{ii}]\,a$^4$D$_{5/2}$-a$^4$F$_{9/2}$ & 1.534 & 9.9(1.0) & ...      & ...      & 0.7(0.4) & ...      \\
[\ion{Fe}{ii}]\,a$^4$D$_{3/2}$-a$^4$F$_{7/2}$ & 1.600 & 11.2(1.0)& ...      & ...      & 0.9(0.4) & ...      \\
[\ion{Fe}{ii}]\,a$^4$D$_{7/2}$-a$^4$F$_{9/2}$ & 1.644 & 85.8(0.7)& 8.9(0.5) & 8.7(0.8) & 20.1(0.5)& 4.4(0.5) \\
[\ion{Fe}{ii}]\,a$^4$D$_{1/2}$-a$^4$F$_{5/2}$ & 1.664 & 5.7(0.8) & ...      & ...      & 1.1(0.7) & ...      \\
[\ion{Fe}{ii}]\,a$^4$D$_{5/2}$-a$^4$F$_{7/2}$ & 1.677 & 13.3(0.9)& ...      & ...      & 1.8(0.4) & ...      \\
[\ion{Fe}{ii}]\,a$^4$D$_{3/2}$-a$^4$F$_{3/2}$ & 1.797 & 5.2(0.9) & ...      & ...      & ...      & ...      \\
[\ion{Fe}{ii}]\,a$^4$D$_{5/2}$-a$^4$F$_{5/2}$ & 1.800 & 14.3(0.7)& ...      & ...      & ...      & ...      \\
[\ion{Fe}{ii}]\,a$^4$D$_{7/2}$-a$^4$F$_{7/2}$ & 1.810 & 52.6(1.1)& ...      & ...      & ...      & ...      \\
[\ion{Fe}{ii}]\,a$^2$P$_{3/2}$-a$^4$P$_{3/2}$ & 2.133 & 3.2(0.5) & ...      & ...      & ...      & ...      \\
\hline
    \end{tabular}
\end{minipage}

\end{table}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
%\begin{table}
%\begin{minipage}[t]{\textwidth}
%\caption{Lines observed in the knot Z1 of the HH46-47 jet.                                                                               }
%\label{tab:z1_lines}
%\vspace{0.1cm}
%\label{tab:z1_lines}
%\centering
%\renewcommand{\footnoterule}{}  % to avoid a line before footnotes

%%%%%%%%%%%%%%%%%%%%%%  knot fluxes, molecular lines %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\begin{table}[!h]
%\begin{center}
\begin{table}
\begin{minipage}[t]{\textwidth}
\caption{ Observed unreddened lines along HH46-47: H$_2$ lines.}
\label{tab:molecular_fluxes}
\centering
\vspace{0.1cm}
\renewcommand{\footnoterule}{}  % to avoid a line before footnotes
\begin{tabular}[h]{cccccccc}
 \hline     \hline \\[-5pt]

Line id. & $\lambda$($\mu$m) & \multicolumn{6}{c}{F ($\Delta$ F)(10$^{-16}$erg s$^{-1}$cm$^{-2}$)} \\
        &       &   S      & Z2       & X    & Y3       & Y2        &Y1   \\
\hline \\[-5pt]
H$_2$ 2-1 S(5) & 1.945  & ...      & ...      & ...      & ...      & ...      & 2.7(0.7)   \\
%H$_2$ 1-0 S(3)\footnote{Blend with \fe\ a$^4$D$_{7/2}$-a$^4$F$_{5/2}$}
%               & 1.958 & ...       & ...      & 10.4(0.8)& 8.5(0.3) &  \\
H$_2$ 1-0 S(2) & 2.034 & ...       & 2.1(0.6) & 26.6(0.6)& 10.0(0.6)& 13.2(0.4)& 8.7(0.4)         \\
H$_2$ 2-1 S(3) & 2.074 & ...       & ...      & 3.7(0.5) & 2.3(0.2) & 3.9(0.4) & ...            \\
H$_2$ 1-0 S(1) & 2.122 & 12.0(0.5) & 5.6(0.3) & 36.3(0.3)& 27.0(0.3)& 3.3(0.2) & 22.7(0.2)  \\
H$_2$ 2-1 S(2) & 2.154 & ...       & ...      & 1.1(0.2) & ...      & 1.6(0.2) &...     \\
H$_2$ 1-0 S(0)\footnote{Blend with [\ion{Fe}{ii}]\ b$^2$F$_{5/2}$-a$^2$F$_{7/2}$}
           & 2.224 & 12.7(0.6) & 3.1(0.6) & 7.7(0.4) & 5.4(0.5) & 6.9(0.3) & 5.2(0.2)  \\
H$_2$ 2-1 S(1) & 2.248 & ...       & 1.4(0.4) & 3.4(0.3) & 3.0(0.5) & 4.6(0.2) & 3.5(0.3) \\
H$_2$ 1-0 Q(1) & 2.407 & 16.6(1.3) & 4.8(0.6) & 28.9(0.6)& 20.8(0.8)& 24.3(0.7)& 17.8(0.5)  \\
H$_2$ 1-0 Q(2) & 2.413 & 13.8(1.5) & 2.3(0.3) & ...      & ...      & ...      & ...    \\
H$_2$ 1-0 Q(3) & 2.424 & 16.2(1.3) & 5.8(0.5) & 30.7(0.6)& 23.3(1.5)& 26.5(0.7)& 17.8(0.5)  \\
H$_2$ 1-0 Q(4) & 2.437 & 9.3(1.1)  & ...      & 8.4(0.7) & 6.1(1.2) & 8.0(0.6) & 5.2(0.6)   \\
H$_2$ 1-0 Q(5) & 2.455 & ...       & ...      & 23.4(0.9)& 15.7(1.6)& 21.6(0.8)& 14.9(0.7) \\
H$_2$ 1-0 Q(6) & 2.476 & ...       & ...      &      & ...      & 6.6(0.6) & ...    \\
\hline

\end{tabular}

%\end{center}
\end{minipage}

\end{table}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5

%%%%%%%%%%%%%%%%%%%%%%  knot fluxes, other lines %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\begin{table}[!ht]
%\begin{center}
%\caption{\label{tab:other_fluxes} Observed unreddened lines along HH46-47: other lines.}
%\vspace{0cm}
%\renewcommand{\footnoterule}{}  % to avoid a line before footnotes
%    \begin{tabular}[h]{cccc}
% \hline     \hline \\[-5pt]

%Line id. & $\lambda$(\um) & \multicolumn{2}{c}{F ($\Delta$ F)(10$^{-16}$erg s$^{-1}$cm$^{-2}$)} \\
%       &       &   S      & HH46-1       \\
%\hline \\[-5pt]
%Pa$\beta$& 1.282        & 19.8(1.2)& 2.7(0.7)  \\
%Br$\gamma$&2.166        & 9.4(0.8) & 1.1(0.5) \\
%CO (2-0) & 2.294        &          & ...      \\
%CO (3-1) & 2.323        & 4.7(1.4) & ...      \\
%\hline

%    \end{tabular}
%\end{center}
%\end{table}
\newpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
\end{appendix}
```

[^1]: Based on observations collected at the European Southern Observatory, Paranal, Chile (ESO programmes 0.74.C-0286(A)).

[^2]: IRAF (Image Reduction and Analysis Facility) is distributed by the National Optical Astronomy Observatories, which are operated by AURA, Inc., cooperative agreement with the National Science Foundation.

[^3]: Visual extinction measured from the ratio \[\] 1.64/1.25 $\mu$m

[^4]: Distance from the source in arcsec. Negative values correspond to the southeastern, redshifted jet axis.

[^5]: Electron density measured from the ratio \[\] 1.60/1.64 $\mu$m .

[^6]: Electron density measured from the ratio \[\] 1.60/1.64 $\mu$m  for the HVC and LVC.

[^7]: Tangential velocity derived from the observed radial velocities assuming an orientation angle of the jet with respect to the plane of the sky of 34 ().

[^8]: $\dot{M}_{jet}$ measured from the luminosity of the \[\]  1.64 $\mu$m for the HVC and LVC. The lower value has been derived assuming an iron solar abundance, while the upper value has been inferred assuming the iron gas-phase abundance derived from the \[\]/\[\] ratio.

[^9]: where n$_H$ and V are the total density and the emitting volume, see for more details.


abstract: Littering quantification is an important step for improving cleanliness of cities. When human interpretation is too cumbersome or in some cases impossible, an objective index of cleanliness could reduce the littering by awareness actions. In this paper, we present a fully automated computer vision application for littering quantification based on images taken from the streets and sidewalks. We have employed a deep learning based framework to localize and classify different types of wastes. Since there was no waste dataset available, we built our acquisition system mounted on a vehicle. Collected images containing different types of wastes. These images are then annotated for training and benchmarking the developed system. Our results on real case scenarios show accurate detection of littering on variant backgrounds.
author: Mohammad Saeed Rad, Andreas von Kaenel, Andre Droux, Francois Tieche, Nabil Ouerhani, Hazım Kemal Ekenel, Jean-Philippe Thiran
title: A Computer Vision System to Localize and Classify Wastes on the Streets

# INTRODUCTION

Urban littering, defined as the waste products disposed improperly in cities, has recently become a major concern for our modern cities. Major European cities place urban cleanliness as a top priority for the authorities, as it directly impacts the concern and satisfaction of their citizens and the attractiveness of their economy and tourism. At a recent Clean Europe Network summit[^1], the lack of data has been pointed out as one of the major difficulty in addressing properly this environmental issue.

The key to properly manage urban cleanliness is to implement a continuous improvement management system. The measurement of urban litter is mandatory for such a process. Anti-littering organizations such as AVPU[^2] and cities worldwide are assessing urban cleanliness by means of human audits. Zurich -ranked third over 83 European cities for the satisfaction of its citizens regarding cleanliness[^3]- is conducting 14'000 audits a year to assess and manage its cleanliness. To provide such a measurement, as an index of cleanliness, a key step is to be able to recognize different types of wastes on urban places, to quantify and to classify them by their type.

In this study, we propose and develop a computer vision application based on deep CNN algorithms to localize and classify urban wastes such as bottles, leaves, etc. in an automated manner in RGB images. This measurement is realized by an image acquisition system consisting of a high-resolution camera, mounted on the top of a vehicle, facing the ground. The front surface of the vehicle are covered by the camera view. The system must be able to detect the smallest defined waste -a cigarette butt, seen from a camera placed at a height of two to three meters. The output of this application is a geo-localized density of different categories of urban wastes. An overview of the system is shown in Fig. .

The remainder of this paper is structured as follows. Section presents related works. Then, in Section , the deep neural network used for detection -including its implementation details- is explained. In Section , we present the data collection setup and use it to obtain a waste dataset. In Section we test our application on a real case scenario and present results. Finally, Section summarizes our work and discusses about future work.

# RELATED WORK

Different methodologies have been developed worldwide to obtain an index of cleanliness for a city. These approaches are mostly focused on human interpretations of cleanliness. However, an automated approach has not yet been developed.

The closest work to this study is a trash related project designed to coarsely segment a pile of garbage in an image . They also provide an Android application, which allows citizens to track and report garbage in their neighborhoods. Bing Image Search API[^4] was used to create their dataset. They have labeled images as containing garbage or not. The authors utilize a pre-trained AlexNet model and obtain 83.96% of sensitivity with 90.06% specificity. Their approach focuses on segmenting a pile of garbage in an image and provides no details about types of wastes in that segment.

There exist approaches that classify garbage into recycling categories; proposes an automated recognition system using deep learning algorithm which classifies objects as biodegradable and non-biodegradable. They propose a model and have its implementation done in Caffe . However, there are no experimental results presented. In , they propose a system to classify waste in high schools. They design a box containing a camera inside it. In order to do the classification, objects are required to be placed inside the box. Their image processing module is based on finding correlation between the image of the object in the box and 50 different images, then choosing the best one as the right category. The developed system classifies three kinds of waste: PET bottle, soda cans and cartoon box, with a classification performance over 70%.

An automatic waste sorting approach is presented in . They use two different methods: Convolution Neural Networks and Support Vector Machines. Their input is $256 \times 256$ pixel resolution image of the waste. For their CNN architecture, they use AlexNet model. Their SVM utilizes a bag of features obtained by passing a $8 \times 8$ window over the whole image. Each algorithm creates a different classifier that separates waste into three main categories: plastic, paper, and metal. They achieved a classification accuracy of 94.8% with SVM, while CNN had an accuracy of 83%. As they have mentioned in their paper, the main reason of not having better results with CNN is the insufficient number of images in their training set. Their approach focuses on classifying a specific object and not to localize it from a far distance.

# METHODOLOGY

In this section, we describe each step of our approach. We explain how we localize and classify the wastes on given input images, then we discuss about the implementation details.

## Waste Localization and Classification

The proposed system must take care of two main tasks: The first task is to localize all objects in the image. The second task is to classify all detected objects on their right littering category. In this section, all tasks are addressed using a single framework and a shared feature learning base.

The fact that CNNs are trained end-to-end, from raw pixels to final classes, makes them much more advantageous for many tasks than manually designing a suitable feature extractor. Our approach is similar to OverFeat model which proposes a multi-scale deep learning approach that can be used for classification, localization and detection. We replace its classification architecture by GoogLeNet . For localization, as OverFeat put forward, starting from the classification-trained network, the classifier layers are replaced by a regression network and trained to predict object bounding boxes at each spatial location and scale. Then the regression predictions with the classification results are combined at each location to obtain detection results. Object bounding box predictions are generated by running the classifier and regressor networks for all locations and scales. Considering that these two networks are sharing the same feature extraction layers; after computing the classification net, only the final regression layers must be recomputed. The final output layer of regression network has 4 units which correspond to coordinates for the bounding box of the detected object.

We use OverFeat-GoogLeNet model presented in . The original version of OverFeat relies on image representation based on AlexNet . In , they were able to directly substitute the GoogLeNet architecture into the OverFeat model and denoted the new model as OverFeat-GoogLeNet. They show that Overfeat-GoogLeNet performs significantly better than OverFeat-AlexNet. GoogLeNet is initially trained on 1.2 million images for 1000-classes object recognition. Overfeat-GoogLeNet uses expressive image features from GoogLeNet that in our implementation are fine-tuned as part of our system. The size of the input layer is fixed to $640 \times 480$ pixels. The model is constructed to encode the input image into a $15 \times 20$ grid where each cell contains 1024-dimensional top level GoogLeNet features and has a receptive field of size $139 \times 139$. Cells are trained to produce the set of all bounding boxes intersecting the central $32 \times 32$ region. The convolutional layers are followed by two fully connected layers containing 3092 and 4096 neurons, respectively. At the end, the output layer contains 25 neurons corresponding to different categories of waste.

## Implementation

An open source implementation of OverFeat on Tensorflow was used as a starting point. Then, some modifications were done to perform multi-classification. The image of a cigarette butt must contain at least same number of pixels as the smallest possible bounding box for the network. To fulfill this last criterion, and also regarding to the height of the camera, the resolution is fixed to $1920 \times 1480$ pixels. During training, these images occupy a considerable amount of memory while loading their batches. Due to this and the challenge of having a cheaper system capable of processing and detecting wastes onboard on an embedded system, we decided to pass a $640 \times 480$ pixels sliding window with an overlapping factor over the input image and keep the network input size same as the window size. The final result is produced by converting the detection coordinates with respect to initial full image. Detections within the same category are merged in case of having an overlapping factor of more than 60%. The model is fine-tuned on Tensorflow using Nvidia K40 GPUs for 350,000 iterations with a batch size of 16. Validation is performed every 2,000 iterations.

# THE DATASET

Convolutional Neural Networks have lots of advantages over methods requiring to design a suitable feature extractor. However, one of their drawbacks is the need for a large amount of labeled training samples.

There is no waste image dataset currently available, which differentiates different types of litters/wastes. Our initial idea was to gather a diverse set of images, for example using image search by entering the category names as the keywords or using ImageNet , to train our system. However, the final decision was to not use them for training as their conditions like camera view, illumination, etc. were too different from what our system captures. To collect our own dataset, we have built our own acquisition system, mounted on a vehicle and drove several hours in Geneva area, Switzerland. We have obtained 18,676 images. To avoid overlapping between training images we have decreased number of images from 2 to 0.4 frame per second and among them we have annotated 469 full images, which corresponds to 4338, $640 \times 480$ pixel resolution images. Because of the time and season of our acquisition process, most of wastes found in images were leaves and cigarette butts.

## Categories

Another important step is to define what the waste is and needs to be considered for a cleanliness measure, and also how the categories should be defined in order to cover most of litters. Different organisations use different waste classifications. The OFEV[^5] approach, for example, does not take into account gums or excrement, which nevertheless play an important role in the perception of cleanliness and urban pollution. To give an example, in Roma, 5.54 million gums are discarded every year that take about 5 years to degrade. In this work, after some discussion with different cities we have decided to classify different wastes into one of the 25 general categories. Here we mention some important ones: 1. Beverage and meal packages, 2. Cigarettes and derivatives, 3. Leaves, 4. Newspapers and papers, 5. Vegetable waste, etc.

## Setup

We equipped an automatic street sweeper car with a camera and an embedded system to obtain and store our dataset. As it is shown in Fig. , the camera was installed on a metallic arm, on top and coming out of the vehicle, having a flat view of the ground. The camera has a rolling shutter with a 1/2.3 inch CMOS sensor and 4K resolution, however after tuning the input image size of the network, the camera was configured to an output of $1920 \times 1480$ pixel resolution images. The camera was set to get two frames per second and the average speed of the vehicle was twelve kilometers per hour.

## Annotations

Similar to other object recognition problems, our model also requires considerable amount of labeled training samples. We have developed an annotation tool to label a sequence of images by putting a bounding box around each waste and assigning an integer number to it showing its class number. A screenshot of this tool is shown in Fig. . This approach is based on the hypothesis that each object is well-separated, countable and has its particular shape, which is not the case for all categories. For example during autumn, the ground is covered by leaves where each individual leaf will not appear the same way that it appears alone. A significant improvement was observed in the correct classification accuracy once two different classes were introduced for leaves: a class for single leaves and another class for piles of leaves. However, for the cleanliness measurement both classes are considered as one category. This approach helped the network to have a better generalization for each type, separately. An example of these two classes is shown in Fig. .

# RESULTS AND DISCUSSION

The proposed application was validated using a test set consisting of 62 non-overlapping full-size images collected from our setup, equal to 558 $640 \times 480$ images that are fed to the network. Rectangular ground-truth bounding boxes were defined on each image. In total, they consist of 69 cigarettes, 958 leaves and 394 bounding boxes on piles of leaves. Although other types of waste had been annotated and were used during training, they were not considered for the evaluation. Their number was not sufficient and could not provide a reliable training/testing. For example, in total we have: 8 bottles, 5 cans, 6 goblets in training set.

We have reached to process images at 2 frames ($1920 \times 1480$) per seconds. This could be interpreted as: with a camera mounted at a height of 3 meters, we can detect a cigarette butt with a speed up to 12 kilometers per hour (this number of frame per second enables us to have 15% of overlap between two consecutive images). Both training and testing processes were done on a Nvidia K40 GPU.

## Precision-recall analysis

To evaluate the performance of the proposed application in a quantitative manner, a precision-recall analysis was performed . The precision ($P$) and recall ($R$) rates of the system are simply defined as: $P = CD/ (CD + FP)$ and $R = CD/N$ where $CD$, $FP$ and $N$ are the total number of correct detections, false positive and ground truth objects respectively.

In order to calculate these parameters, first, each detection needs to be labeled as either correct detection or false positive by reference to the ground truth. For cigarette butts category, a detection is marked as correct when the overlap between its detected bounding boxes and the corresponding ground truth is at least 50%. In Fig. .(a) the precision and recall of cigarette butts is illustrated. Different values for $P$ and $R$ are obtained by varying a threshold on final detection score for this category. We have reached 63.2% of precision while having 61.02% of recall for the cigarette butts class.

This method of defining correct detection and false positive could pose a problem while evaluating the application for some categories like leaves. Let's imagine a scene covered by leaves. As explained previously, our ground-truth is defined by different overlapping bounding boxes, with different sizes, on some random position, covering leaves. In this case, the algorithm would correctly return different detections on top of leaves' regions, but not exactly the same position that was defined in the ground-truth. To avoid this issue, only for this category, a binary image of detection/ground-truth was produced for each image. Pixels set to 0 indicate background and pixels set to 1 show ground-truth/detection. Comparing these two binary images pixel by pixel gives $CD$ and $FP$ parameters. Fig. .(b) shows precision-recall curve for leaves category. We have obtained 77.35% of precision while having 60% of recall for the leaves class.

Although the quantitative results may not seem to be too high, it should also be taken into account that the system is designed to localize very small objects such as cigarette butts in relatively large images, covering five meters of a street. Considering this challenge, these results are promising for waste localization and classification even if they are seen from a distance.

## Qualitative assessment

Some localization and classification results obtained on sample representative images are shown in Fig. . The proposed approach performs well for small objects like a cigarette butt from a three meters height on a clear background as well as in backgrounds crowded by other types of waste. Also, the method is able to detect multiple/overlapped wastes. It should be noted that some leaves/cigarettes were missed on some images, which could be due to our limited training-set. Examples of a false positive detection and a missed detection are shown in Fig. .

# SUMMARY AND FUTURE WORK

In this paper, a novel application for measuring cleanliness of a place, using a deep learning framework was proposed. The application localizes and classifies wastes in RGB images taken by a camera facing ground from three meters of height. Since there was no waste dataset available, we used our proposed acquisition setup to obtain images. We have also developed an annotation tool to label objects in our dataset for 25 different types of waste. Experimental results on a real case scenario -on a test-set obtained by our proposed acquisition setup- show promising performance on variant backgrounds.

As a future work, our dataset could be expanded by adding more images, especially for categories different than cigarette butts and leaves, to be able to detect all existing classes of wastes, and also to increase the accuracy of the current system.

# ACKNOWLEDGMENT

The authors would like to thank Mr. Niels Michel, Manager of Dialog & Service at City of Zurich for sharing his in-depth experience on cleanliness measurement thus significantly contributing to this project.
The final publication is available at link.springer.com via <http://dx.doi.org/10.1007/978-3-319-68345-4_18>.

[^1]: http://www.cleaneuropenetwork.eu/de/measuring-litter/aus/

[^2]: http://www.avpu.fr/pdf%20AVPU/formation%20grille%20IOP-2014.pdf

[^3]: http://ec.europa.eu/regional_policy/sources/docgener/studies/pdf/urban/survey2015_en.pdf

[^4]: https://www.microsoft.com/cognitive-services/en-us/bing-image-search-api

[^5]: http://www.bafu.admin.ch/publikationen/publikation/01604/index.html?lang=fr


author: B. D. Fulcher[^1]; N. S. Jones
title: Automatic time-series phenotyping using massive feature extraction

#### Summary

Across a far-reaching diversity of scientific and industrial applications, a general key problem involves relating the structure of time-series data to a meaningful outcome, such as detecting anomalous events from sensor recordings, or diagnosing patients from physiological time-series measurements like heart rate or brain activity. Currently, researchers must devote considerable effort manually devising, or searching for, properties of their time series that are suitable for the particular analysis problem at hand. Addressing this non-systematic and time-consuming procedure, here we introduce a new tool, *hctsa*, that selects interpretable and useful properties of time series automatically, by comparing implementations over 7 700 time-series features drawn from diverse scientific literatures. Using two exemplar biological applications, we show how *hctsa* allows researchers to leverage decades of time-series research to quantify and understand informative structure in their time-series data.
Time-series data, repeated measurements of a quantity taken through time, are being recorded in increasing volumes in biology and medicine. This wealth of data has opened the door to a range of new research problems, including diagnosis of pathology from biomedical data streams in human patients , understanding the role of specific neural circuits for behavior , and linking genotype to phenotype to understand gene function or disease processes . While differences in scalar phenotypes are relatively simple to calculate (such as the body length of a worm or the blood pressure of a human subject), it is less clear how to compare complex time-varying data streams (such as the movement dynamics of a worm, the heart rate fluctuations of a clinical patient, or the sequence of reaction times across a cognitive task). In all of these diverse applications, we require a method for reducing complex time-series data streams to informative, low-dimensional summaries.

A common way of summarizing a time series is by measuring a simple statistic such as its sample mean, which has the advantage of being easily interpretable—e.g., knocking out the gene *unc-9* decreases the mean movement speed of the nematode worm, *Caenorhabditis elegans* . However, this approach fails for many real-world applications in which the phenotypic differences are more subtle than simple mean shifts. Sophisticated tools for measuring structure in time-series data have been developed by a broad range of researchers, including contributions from the fields of statistics, electrical engineering, economics, statistical physics, dynamical systems, and biomedicine. This interdisciplinary literature includes summaries of the distribution of values in the data (e.g., Gaussianity, properties of outliers), autocorrelation structure (including power spectral measures), stationarity (how properties change over time), information theoretic measures of entropy and temporal predictability, linear and nonlinear model fits to the data, and methods from the physical nonlinear time-series analysis literature . There is currently no systematic way of leveraging this giant corpus of scientific work to determine which of these thousands of possible summary statistics best address a particular scientific hypothesis, because the methods have typically been locked in discipline-specific journal articles. Here we introduce a software package for performing highly comparative time-series analysis, *hctsa*, that opens up the interdisciplinary time-series analysis literature in the form of over 7 700 *features*, each of which captures a different type of interpretable structure in a univariate time series. By comparing the performance of these features on a given dataset, *hctsa* facilitates data-driven, statistically-controlled selection of informative time-series summary statistics for phenotyping applications, overcoming an otherwise time-consuming and subjective manual task.

The general problem is depicted in Fig. , where we focus on distinguishing time series recorded from two different classes for demonstration (e.g., a patient group and a control group), although we note that the same general framework applies to multiclass classification or regression problems . After measuring time-series data, *hctsa* is used to perform massive feature extraction, where the behavior of over 7 700 different scientific analysis methods applied to the dataset can be visualized as a feature matrix with a row for every time series and a column for every feature, shown in Fig. . The rich structure of the feature matrix reveals some sets of features (i.e., areas of the scientific time-series analysis literature) that capture meaningful differences between groups (e.g., lighter color for type A and darker color for type B in Fig. ) and thus represent promising candidates as quantitative phenotypes for distinguishing data of the two types. In addition to facilitating massive feature extraction, *hctsa* includes a comprehensive suite of analytics for extracting useful and interpretable insights into the structure of the dataset, including: (i) identifying scientific methods that best quantify differences between labeled groups of data, providing interpretable insights into the phenotypic differences (incorporating permutation testing to statistically control for multiple hypothesis testing), (ii) building a classifier that draws on the full diversity of scientific methods to optimize the accuracy of phenotypic classification, and (iii) visualizing low-dimensional structure in the dataset to understand potential clustering structure or other relationships between the time series. By leveraging a comprehensive interdisciplinary literature on time-series analysis, *hctsa* thus enables researchers to gain a range of interpretable and useful insights into their data.

To demonstrate the approach, we applied *hctsa* to two case studies of *C. elegans* and *Drosophila melanogaster* movement, as shown in Fig. . Sample time series of the movement speed dynamics of five different strains of *C. elegans* are shown in Fig. a (upper). Being noisy empirical recordings with no clear visual differences between strains, it is unclear what types of analysis methods might capture differences between the genotypes. Using *hctsa* to compute the behavior of over 7 700 different time-series features (subsequently filtered down to 6 504 well-behaved features, see *Online Methods*), we found that the feature set as a whole predicted genotype from the short, noisy time series with a ten-fold cross-validated balanced accuracy of 80% (using a linear SVM; chance level: 20%). A total of 4 499 different features of movement speed time series were individually informative of the genotype label ($q < 0.05$, FDR-corrected, permutation test), with the 40 most informative features spanning diverse methodological literatures, including AR and state space model fitting methods, detrended fluctuation analysis, local mean forecasting, multiscale Sample Entropy, and wavelet decompositions of the signal, shown as a structured pairwise correlation plot in Fig. a (lower). One of the multiscale entropy measures is highlighted in Fig. a (middle), which computes the Sample Entropy, $\text{SampEn}(2,0.15)$, at a scale level 3 (corresponding to 100 ms bins), which can be thought of as quantifying the 'unpredictability' of the time series at this timescale. Violin plots in Fig. a reveal physiologically interpretable differences between the genotypes, with the lab strain N2 and wild isolate strain CB4856 showing the most predictable time series at this timescale, the morphological mutant, *dpy-20* being intermediate, and neural mutants like the *unc-38* and *unc-9* being the least predictable. Along with many other time-series properties discovered by *hctsa*, we thus find that this multiscale entropy measure constitutes a useful quantitative phenotype for *C. Elegans* movement, that also provides new interpretable insights beyond simple summaries like the mean speed. For example, the two neural mutants *unc-38* (which encodes a nicotinic acetylcholine receptor alpha subunit) and *unc-9* (which encodes a structural component of gap junctions) display similar movement speeds, but our analysis shows that they affect movement distinctly, exhibiting significant differences in their movement predictability. Furthermore, the selection of this multiscale entropy measure, achieved automatically using *hctsa*, mirrors detailed manual research proposing the similar concept of 'compressibility' of posture sequences as a quantitative phenotype for *C. elegans* . By comparing a wide interdisciplinary literature of analysis methods, *hctsa* thus selects biologically informative quantitative phenotypes for these time-series data.

We also applied *hctsa* to 12 h movement speed time series of *Drosophila* restricted to a one-dimensional tube, labeled as either 'day' (light on) or 'night' (light off), and as either 'male' or 'female', as shown in Fig. b . Leveraging the full feature library, we successfully classified recordings made during the day versus at night with a mean 10-fold cross-validated balanced accuracy of 98%, and also clearly distinguished the sex of the organisms (96%). The *hctsa* package selected interpretable quantitative time-series features for different groupings of the data, as annotated in Fig. b (upper), highlighting the increased spectral flatness and shorter durations between outliers in females relative to males (driven by their less predictable movement), and increased stationarity of movement dynamics during the day, with fewer extreme outliers than at night (which is dominated by more bursty patterns between sleep and activity). Taking four combination classes (colored in Fig. b), the mean balanced 10-fold cross-validated balanced accuracy remains high, at 95%. Again, *hctsa* identifies interpretable features like the standard deviation of incremental differences in the $z$-scored time series, shown as a violin plot in Fig. b (middle). This elementary measure gives higher values to time series exhibiting greater changes from one time point to the next, providing a simple but easily interpretable measure of temporal predictability, which is increased during the day, and in females. Even when class labels are not used, *hctsa* can draw on the combined behavior of thousands of scientific methods to provide an informative low dimensional principal components representation of the dataset, shown in Fig. b (lower), in which the four classes are clearly separated. The subtle quantitative phenotypes of *Drosophila* movement provided automatically by *hctsa* go beyond simple comparisons of the overall amount of movement between day and night, or between males and females . For example, while it is known that females have shorter sleep bouts than males, *hctsa* quantifies the sexually dimorphic behavior by selecting new measures of, for example, predictability of movement (reduced in females) or time intervals between large movements (reduced in females). The use of *hctsa* thus provides us with a picture of more erratic female *Drosophila* movement that may reflect their need to forage for food and select egg laying sites , in contrast to the more predictable male behavior of conserving energy to avoid predators. Our results demonstrate the benefits of leveraging a wide variety of time-series analysis methods to automatically learn and interpret structure in biological time-series data.

In summary, we introduce a new software framework, *hctsa*, which automates the selection of quantitative phenotypes from time-series data by leveraging a large and interdisciplinary literature on time-series analysis. In a reversal of the typical time-series analysis process in which methods are selected manually by researchers, here we show that statistical machine learning can aid this process of human learning by subjecting time-series data to thousands of scientific methods. In addition to the high throughput phenotyping applications demonstrated here, *hctsa* has general utility, including behavioral phenotyping in cognitive science, and diagnosis of disease from biomedical data streams such as heart rates or brain dynamics. Furthermore, although we focus on classification problems here, we note that the same approach applies to regression problems, where one aims to find time-series features that vary with a continuous variable (such as the dosage of a drug, a standardized depression score of a patient, etc.) . Code for running *hctsa* in Matlab has been developed and refined over many years through a range of diverse applications and is available at www.github.com/benfulcher/hctsa, with accompanying comprehensive documentation at www.gitbook.com/book/benfulcher/hctsa-manual.

#### Acknowledgements

We thank Andre Brown and Bertalan Gyenes for sharing the *C. elegans* movement dataset, and helpful feedback on the resulting analysis and manuscript. We thank Giorgio Gilestro and Quentin Geissmann for sharing the *Drosophila* movement dataset, and helpful feedback on the resulting analysis. Many thanks to Rachael Fulcher for help with graphic design, and to Alex Fornito and Iain Johnston for useful feedback on the manuscript.

# Supplementary Information

## Software details and reproducibility

Following from the original concept and proof of principle for a highly comparative approach to time-series analysis , this article introduces a well-documented and user-friendly Matlab-based software platform for performing it (Matlab is a product of The MathWorks, Natick, MA). The set of over 7 700 features has been developed and refined through applications to a wide range of research and industrial problems over many years. A full analysis pipeline has also been built to allow researchers to run highly comparative analysis on their own data, including functions for initiating new analysis tasks, computing features locally in Matlab or through an interface to a mySQL server (enabling distributed computing for large datasets), processing the results of the feature extraction (including options for filtering features on their behavior and feature normalization), and a range of other analytic outputs to facilitate scientific interpretation (including the plots shown in this paper).

### Dataset availability

The two datasets analysed here, including the labeled time series and the full results of *hctsa* feature extraction, are available in the form of Matlab files (.mat) for *C. elegans*: <https://dx.doi.org/10.4225/03/580478f951263>, and for *Drosophila*: <https://dx.doi.org/10.4225/03/5804798d2a2ec>.

### Code availability

Analyses presented here were computed using v0.92 of *hctsa*, which contains a total of 7 749 features. The *hctsa* software is freely available at github.com/benfulcher/hctsa/. Analysis pipelines used to produce the results reported here (as well as many other outputs from *hctsa*) are available at github.com/benfulcher/hctsa_phenotypingWorm/ and github.com/benfulcher/hctsa_phenotypingFly/ for the *C. elegans* and *Drosophila* datasets, respectively.

## Analysis details

### Feature filtration and normalization

For any given analysis, we filtered out any features that were constant across the dataset or contained any 'special' values (e.g., due to applying a method that is inappropriate for the data, such as fitting a positive-only distribution to data that are not positive only, or attempting to fit a model to the data that does not converge, etc.). Due to this filtering, a different number of total features will be usable for a given dataset, depending on its properties.

When searching for discriminative individual features, we did not normalize or rescale feature values to enable results to be interpreted in the natural scale of each feature. However, when computing the Principal Components of a dataset, or learning a classifier in the full feature space, we normalized each feature to the unit interval using a scaled robust sigmoid function : $$\label{eqn:scaledSQzscore}
\hat{\mathbf{f}} = \left[1+\exp\left(-\frac{\mathbf{f}-m_\mathbf{f}}{1.35 r_\mathbf{f}}\right)\right]^{-1},
% \hat{\mathbf{f}} = 1/\{1+\exp[-\pi(\mathbf{f}-\overline{f})/\sqrt{3}\sigma_f]\},$$ where $\hat{\mathbf{f}}$ represents the normalized feature values across a time-series dataset, $\mathbf{f}$ is the vector of un-normalized feature values, $m_\mathbf{f}$ is the median of $\mathbf{f}$, and $r_\mathbf{f}$ is its interquartile range.

### Classification

For multi-class classification, we trained linear support vector machine classifiers in Matlab 2015b (a product of The MathWorks, Natick, MA) using the `fitcecoc` function with a linear kernel SVM. To compare single univariate features, we used simple linear discriminant analysis (using `classify`). When training SVM classifiers, we weighted each observation, $x$, as the inverse probability of its class label across the dataset to account for class imbalance.

Due to imbalance of observations across the multiclass classification problems investigated here, we report balanced classification accuracy, $C_\mathrm{bal}$, over $m$ classes in terms of the number of correctly identified examples of a given class $t_i$, and the total number of examples of each class, $c_i$, as $$C_\mathrm{bal} = \frac{1}{m} \sum_{i=1}^m t_i/c_i .$$ Balancing the accuracy in this way ensures that all classes contribute equally to the classification statistic.

## Datasets

### *Caenorhabditis elegans* movement speed

Movement speed time-series data were obtained from approximately 15 min videos obtained using tracking microscopes (see wormbase.org for more information). A total of 226 movement time series sampled at 30.03 Hz were obtained from the CB4856 (Hawaiian wild isolate, 29 time series) and N2 (lab strain, 100 time series) strains, and the mutants *dpy-20* (34 time series), *unc-9* (20 time series), *unc-38* (43 time series). For the *dpy-20*, *unc-9*, *unc-38* knockouts and the CB4856 strain, all available data at the specified frame rate were used. For the wildtype N2 strain, we took a random sample of 100 of the 1 200 time series recorded at a sampling rate of 30.03 Hz. If missing data in a time series made up less than 15% of its length and in a contiguous block at the beginning or end of the recording, the time series was retained with this section of missing data removed, otherwise the time series was removed.

### *Drosophila melanogaster* movement speed

We analysed time series of the movement speed of flies restricted to a one-dimensional tube and tracked continuously for between 3 and 6 days using video tracking . Movement speed was estimated as the maximum speed of the measured data (sampled at approximately 2 Hz) in each non-overlapping 10 s time window, where displacements are measured as the euclidean distance between successive co-ordinates of the fly. In this way, here we analyze these time series of movement speed, sampled at a rate of 0.1 Hz. Time series were split into 12 h segments and labeled as either 'day' (light on, 574 time series) or 'night' (light off, 574 time series), and as either 'male' (554 time series) or 'female' (594 time series).

[^1]: Lead Contact