SALEM – A Peabody man who was about to go on trial on firearm and ammunition charges instead opted to plead guilty and received 18 months in jail to be followed by three years of probation.Jonathan Ramos, 22, last known address of 47 Washington St., #2, changed his plea of innocent to guilty to charges of illegal possession of a shotgun and possession of ammunition without a license before Judge David A. Lowy.The judge adopted the joint recommendation offered by Assistant District Attorney Michael Sheehan and defense lawyer Jesse P. Dole.The charges arise out of an incident in Peabody on Aug. 28, 2009 when Ramos attended his cousin’s house for a party at 14-A Hardy St. in Peabody.The group drank and played games for the evening. Then at about 4 a.m. Ramos stepped outside armed with a shotgun and fired shots into the air near an elderly housing complex.Peabody police officers Eric Ricci and Douglas Marcus investigating the incident found pellet fragments in the area of 18 Walnut St., near an elderly housing complex.The judge credited Ramos for the 210 days he has spent in jail awaiting trial on the case.Because the penalty is a House of Corrections sentence, instead of state time, Ramos will only have to serve a few more months at the Middleton Jail before he is eligible for parole. A House of Corrections jail sentence is half the time while a state prison term is for the full punishment, with no early parole.