Nope. You only get to prepare spells directly after resting 8 hours.
Rest: To prepare her daily spells, a wizard must have a clear mind. To clear her mind, the wizard must first sleep for 8 hours. The character does not have to slumber for every minute of the time, but she must refrain from movement, combat, spellcasting, skill use, conversation, or any other fairly demanding physical or mental task during the rest period. If the wizard's rest is interrupted, each interruption adds 1 hour to the total amount of time she has to rest in order to clear her mind, and the wizard must have at least 1 hour of rest immediately prior to preparing her spells. If the character does not need to sleep for some reason, she still must have 8 hours of restful calm before preparing any spells.
Recent Casting Limit/Rest Interruptions: If a wizard has cast spells recently, the drain on her resources reduces her capacity to prepare new spells. When she prepares spells for the coming day, all spells she has cast within the last 8 hours count against her daily limit.
Preparation Environment: To prepare any spell, the wizard must have enough peace, quiet, and comfort to allow for proper concentration. The wizard's surroundings need not be luxurious, but they must be free from overt distractions, such as combat raging nearby or other loud noises. Exposure to inclement weather prevents the necessary concentration, as does any injury or failed saving throw the character might suffer while studying. Wizards also must have access to their spellbooks to study from and sufficient light to read them by.