-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial refactoring #4
base: master
Are you sure you want to change the base?
Conversation
samaloney
commented
Apr 25, 2020
- Now works on some data obatained from vso
- Removed some repeated code
- Formating and imports
* Now works on some data obatained from vso * Removed some repeated code * Formating and imports
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine by me, thanks!
* Might work on windows now * Sperate CLI from funcions * Docstrings * Pass config as dict * Address lint and format warnings and errors
So further updates also see comments on this PR |
if instrument == 'mdi': | ||
run = 'checkpoints/mdi/20200312194454_HighResNet_RPRCDO_SSIMGradHistLoss_mdi_19' | ||
run_dir = Path('checkpoints/mdi/20200312194454_HighResNet_RPRCDO_SSIMGradHistLoss_mdi_19') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should alway try to use pathlib.Path
for all paths in general also if we want this work on window is is a must.
@@ -14,7 +14,5 @@ torch==1.1.0 | |||
torchvision==0.3.0 | |||
tensorboard==1.14.0 | |||
tensorboardX==1.8 | |||
gitpython==3.1.0 | |||
tensorflow==1.15.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should remove any other used requirements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should there be a python requirement in here?
|
||
from source.utils import disable_warnings, get_logger | ||
|
||
disable_warnings() | ||
logger = get_logger(__name__) | ||
|
||
|
||
def map_prep(file, instrument, *keyward_args): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kwargs weren't used
header['RSUN_REF'] = 696000000 | ||
|
||
# Adding distance to header |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed currently unused/supported instruments
@@ -383,21 +294,20 @@ def plot_magnetogram(amap, file, scale=1, vmin=-2000, vmax=2000, cmap=plt.cm.get | |||
ppxx = pxx / fszh # Horizontal size of each panel in relative units | |||
ppxy = pxy / fszv # Vertical size of each panel in relative units | |||
ppadv = padv / fszv # Vertical padding in relative units | |||
ppadv2 = padv2 / fszv # Vertical padding in relative units | |||
# Never used so commented out |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are not ever used I would delete them but no totally sure what they are for?
|
||
# Detecting need for rescale | ||
if rescale and np.abs(1 - (map.meta['cdelt1']/0.504273)/upscale_factor) > 0.01: | ||
map = scale_rotate(map, target_factor=upscale_factor) | ||
if self.rescale and np.abs(1 - (amap.meta['cdelt1']/0.504273) / self.upscale_factor) > 0.01: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit of a magic number not totally sure what we are doing here I would suggest
- create a constant at the top for the file and reference that or
- since this is a class put it in the
__init__
with a default value and document it