Routine to extract airmasses and magnitudes from a LEMON database