<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Processing a Collection of spectra
SpecDAL provides Collection class for processing multiple spectrum files in conjunction and for grouping operations.
Manual way of loading files into Collection object
Step1:  We can access spectra by name
Step2:  As a list
Step3:  As a DataFrame
Step4:  Like the Spectrum class, Collection also provides wrappers around pandas.DataFrame methods. We can easily plot a collection as follows
Step5:  If you look closely, there are jumps at wavelengths 1000, and 1800
Step6:  Spectrum objects provide jump_correct() method to deal with this. Collection class provides the same method which iterates through the spectrum objects and applies the jump correction. 
We could similarly apply other spectral transformations such as resampling and overlap stitching on the entire collection.
Step7:  We can easily calculate aggregate functions (mean, median, min/max, std, etc.), which will return a Spectrum object
<ASSISTANT_TASK:>
Python Code:
import os
datadir = "/home/young/data/specdal/aidan_data2/ASD/"
c = Collection(name='myFirst')
for f in sorted(os.listdir(datadir))[1:11]:
    spectrum = Spectrum(filepath=os.path.join(datadir, f))
    c.append(spectrum)
Explanation: Processing a Collection of spectra
SpecDAL provides Collection class for processing multiple spectrum files in conjunction and for grouping operations.
Manual way of loading files into Collection object:
End of explanation
print(type(c["ACPA_F_A_SU_20160617_00000"]))
print(c["ACPA_F_A_SU_20160617_00000"])
Explanation: We can access spectra by name:
End of explanation
print(type(c.spectra))
for s in c.spectra[0:2]:
    print(s)
Explanation: As a list:
End of explanation
print(type(c.data))
c.data.head()
Explanation: As a DataFrame:
End of explanation
c.plot(legend=False, ylim=(0, 0.5))
plt.show()
Explanation: Like the Spectrum class, Collection also provides wrappers around pandas.DataFrame methods. We can easily plot a collection as follows:
End of explanation
c.plot(legend=False, xlim=(900, 1100), ylim=(0.4, 0.5))
plt.show()
Explanation: If you look closely, there are jumps at wavelengths 1000, and 1800
End of explanation
c.jump_correct(splices=[1000, 1800], reference=0)
c.plot(legend=False, ylim=(0, 0.5))
c.plot(legend=False, xlim=(900, 1100), ylim=(0.4, 0.5))
plt.show()
Explanation: Spectrum objects provide jump_correct() method to deal with this. Collection class provides the same method which iterates through the spectrum objects and applies the jump correction. 
We could similarly apply other spectral transformations such as resampling and overlap stitching on the entire collection.
End of explanation
mean = c.mean()
print(type(mean))
mean.plot()
plt.show()
c.std(append=True) # append the spectrum to the original collection
c.plot(legend=False)
plt.show()
Explanation: We can easily calculate aggregate functions (mean, median, min/max, std, etc.), which will return a Spectrum object:
End of explanation
<END_TASK>