ALBATROS-Experiment / albatros_analysis

analyse albatros radio signals
https://albatros-experiment.github.io/albatros_analysis/
1 stars 0 forks source link

Jack working #1

Closed Sulla2012 closed 1 year ago

Sulla2012 commented 1 year ago

This pull request add the ability to slice along time from the command line to quick_spectra, which was requested by Eamon

mohanagr commented 1 year ago

Thanks for your edits, Jack. Would you rather have time slice for direct file in number of rows or number of minutes? Latter might be more user-friendly? You could go from minutes to rows using accumulation time calculated in the script.

I'm also wondering about the utility of row slicing, in general. Each direct file is only an hour long. If we were in the regime where we care about the really fine details, we might just wanna load up the file in a manual python script/Jupyter notebook to work with it. I'm fine with the changes. Just curious what Eamon had in mind.

mohanagr commented 1 year ago

As for the median-scaled spectra, my suggestion is that we add the scaling as an option to quick_spectra.py. In my experience, there is very limited use to just plotting one pol's autospectra. Sooner or later the user will plot other pol too. Comparing scaled autospectra of both inputs, as well as the cross-spectra, gives more idea about what's going on with the instrument.

We could probably introduce another option to control the number of panels in the plot. But just adding -s or --scale would be a good start.

Sulla2012 commented 1 year ago

So after talking to Eamon, what he really wants is basically to be able to use "human readable" times with plot_overnight_new. It seems like this was already possible. I think it would still be nice to be able to take slices with quick_spectra. Minutes is more human readable so I'll rewrite to use that. I think this will be useful in the field and it doesn't seem like it's too complexity-creep so I'm preferential to adding it.

Sulla2012 commented 1 year ago

Yeah I agree I have no particular desire to only view one pol. In terms of rescaling (to differentiate from plot scaling), what other scalings were you thinking? Mean/max/???

mohanagr commented 1 year ago

I think mean and median scaling is good enough, with default to median. There's already too much information when on field, and the plots too have a lot going on. So sticking with median scaling would be informative enough as first-pass. (We'll also need to look at non-scaled version too, so lots of plots to peruse.)

And yes, plot_overnight_new supports human-friendly timestamps as input in UTC. The output in the plot (axis label and title) are in local time.

If you'd like to pass human timestamps in localtime as input, you'll need to make SNAPFiletools's timestamp2ctime() pytz timezone aware. plot_overnight_new has a timezone input stored in mytz. I did not go through that trouble because when using plot_overnight_new, we're generally plotting many many hours of data. So I just input one ctime from night start, and another from night end.

There's lots of wiggle room in terms of input timestamps. Timezone really matters in the output, since we need easy interpretation of when a feature occurred last night. For this reason, all time values in the plot are in local time.

Sulla2012 commented 1 year ago

Ok so right now quick_spectra does no rescaling: do we want to leave that as the default instead?

Sulla2012 commented 1 year ago

Ok I'm going to merge this and work on rescaling as a separate PR if that's ok with you.

mohanagr commented 1 year ago

Merged the PR. If you're OK to start a new branch for scaled spectra, please go ahead and delete this upstream branch.