Not long ago, a colleague remarked that he was hiring a new marine technician. “You’d be great,” he told me, “but it has to be a man. We travel a lot, and my wife would not let us share staterooms on a ship.”

Throughout my career as an oceanographer and mariner, exchanges like this and worse have been common. As a graduate student, I was elated when senior scientists invited me to conduct research aboard the same science research vessel christened by Sylvia Earle, a female pioneer of marine biology. I loved the job despite another colleague’s increasingly crude comments about my body, all of which seemed benign until he came into my room one night while I was sleeping and groped me. When I complained, my shifts were cut. When I asked why my job duties were being altered, I was barred from attending dive school and harassed further. But I kept doing my job. I wanted to be as tough as any other Gulf Coast sailor out here.

Within the science, technology, engineering and math fields, men generally outnumber women 3:1. The disparities grow for jobs outside rigorous academic settings, such as research ships, field camps and machine shops that make high-level research possible. This exclusion is pervasive and real. About 40 percent of men with STEM degrees are working in a STEM job; only 26 percent of women with a STEM degree go on to hold STEM jobs, a huge waste of talent and education. There are many reasons we lack women in STEM jobs, but the outright harassment and discrimination explains part of it.

I could never work hard enough to persuade my employers that my interest in engines and boats was not a whim, an excuse to flirt with men nor outside my abilities — according to one colleague, I was not “mechanically minded.” But it can be hard to demonstrate your “mechanical mindedness” as a woman on a ship. Try operating a half-million-dollar shipboard gyrocompass and multibeam sonar system while the captain of the boat shoves a meter stick between your legs, asking, “Are you moody because it’s that time of the month?

In male-dominated careers, it’s difficult to distinguish run-of-the-mill heckling from the kind of sexual harassment and discrimination that hurts your career. When an employer whom I also considered a friend and mentor stared at my chest and commented that I must be chilly, I wasn’t especially alarmed. But when does the harassment become professional discrimination? It was only after working in an environment where harassment was no longer pervasive that I could appreciate the impact it had on my ability to do my job.

Both the ocean and I suffered from it. As first mate on one vessel, I asked our cook to bag our galley trash while we conducted coastal surveys, in accordance with federal regulations. The captain heard my instruction, dismissed me as “silly,” then dumped a bucket of trash into the shallow waters along Galveston beach. When I objected, he continued emptying galley trash into the same waters where children surfed and swam for the next two weeks. I watched a man with so much contempt for me belittle my authority and compromise the marine ecosystem that I have spent my whole life pursuing.

I reported the incident to the the Office of National Marine Sanctuaries within the National Oceanic and Atmospheric Administration office in Galveston. I was told that the office did not get involved in personnel decisions of its contractors. The superintendent of the office, after I e-mailed him, informed the contractor, who immediately found a replacement mate for me on the vessel. The superintendent declined to tell me where to go for help. Three months later, I e-mailed the director of Office of National Marine Sanctuaries. I reported the groping to them, as well as other harassment and the trash-dumping violations. When I asked what I should have done about being forced to share a room, they suggested that I should have just walked off the boat and refused to work. Of course, their employee had already threatened to fire me if I refused to work or spoke to anyone, and the whole point was that I wanted to do my job, not quit.

It was soul-crushing to realize that I was expected to endure sexual harassment at sea as though it was no different than rough waters or long hours.

Why should I or other women pursue careers in which our colleagues devalue us in this manner? Because discrimination will never compare to the joy of sailing out toward the clouds, salt spray soaking the air. The difficulty is distinguishing between courage and acquiescence. About half-way through my graduate career, a student called me into the women’s restroom on a research vessel and pointed to a small hole in the wall. She asked me awkwardly if I thought men in the adjoining room had drilled it there to use as a peep-hole. I told her yes, took the bubble gum out of my mouth, plugged up the hole and shrugged. I would have walked away without a second thought, as this kind of harassment is usually written off as a joke by men who have spent too much time offshore away from their wives. I wouldn’t have bothered to even report the problem once I had plugged the hole myself — why create drama and give the men another reason to complain about allowing women on the ship? But this younger student undertaking her very first research cruise stared at me in disbelief that I wouldn’t report the violation and reminded me that we should be able work in an environment that doesn’t turn our presence into a joke. The generations following us will only expect better than a “man’s world” if we, too, are brave enough to demand better.

Nobel Prize-winning scientist Tim Hunt suggested in June that women working in laboratories would only fall in love with their male colleagues and cry when criticized. Too many women still feel the burden of this unfortunate kind of thinking when it comes to women and science. This is not a world I should have been expected to endure while learning to change the oil in a 1600hp engine. It is not a world I want the next generation of girls to expect for themselves. The leaders of our research institutions and the women pursuing STEM careers need to demand better expectations. I want future female deckhands, technicians, captains and other professionals to expect without hesitation that they, too, can embrace science and the sea.